spyder增加模組代碼提示功能

來源:互聯網
上載者:User

最近在配置tensorflow,可是發現使用spyder的時候無法載入tensorflow的代碼提示,需要自己輸入完整的函數名稱,十分不方便,於是從網上找了一些資料,來解決spyder無法出現代碼提示的問題。
1、找到module_completion.py這個檔案,我使用的是anaconda3,路徑如下:D:\anaconda3\Lib\site-packages\spyder\utils\introspection
2、第279行可以看到這樣的代碼:

mods = ['numpy', 'scipy', 'sympy', 'pandas', 'networkx', 'statsmodels','matplotlib', 'sklearn', 'skimage', 'mpmath', 'os', 'PIL','OpenGL', 'array', 'audioop', 'binascii', 'cPickle', 'cStringIO','cmath', 'collections', 'datetime', 'errno', 'exceptions', 'gc','imageop', 'imp', 'itertools', 'marshal', 'math', 'mmap', 'msvcrt','nt', 'operator', 'parser', 'rgbimg', 'signal', 'strop', 'sys','thread', 'time', 'wx', 'xxsubtype', 'zipimport', 'zlib', 'nose','PyQt4', 'PySide', 'os.path', 'tensorflow']

其中tensorflow是我自己加上去的,只要把你常用的模組加到這裡,在編程的時候就會自動出現函數提示
3、刪除C:\Users\Administrator\.spyder-py3\db中的submodules檔案,重啟spyder,就可以解決問題了

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.