Vim shows: ImportError: No module named site. while I am using Canopy1.1

大兔子大兔子 提交于 2019-12-07 09:01:10

问题


I have installed Canopy 1.1 express in Windows Xp 32, and I use vim as editor. When I typing :python print("hello") in command line of vim ,it shows: Importerror: No module named site and crashed. In fact, my vim cannot load and plugin written by python(such as jedi-vim), and cannot execute any statements written in python.

I have set the PYTHONHOME and PYTHONPATH as " User Python Environment ", and have read the answer in stackoverflow. In fact, I can use python, it works well. If I remove Canopy and use python 2.7 from Python Official, vim works well too. That means the environment of the system is right, and vim is right.

I think there must be something wrong between vim and canopy.


回答1:


We've just dealt with a very similar issue here: https://github.com/davidhalter/jedi-vim/issues/207

It's OS X and not Windows, but I think the issue is the same one. You probably need to change sys.path or $PYTHONPATH somehow. I don't know why this is an issue with canopy or vim.




回答2:


please check existence of site directory

Hint: python version below 2.7 does not have the jedi-vim support, so better disable jedi-vim and try

If the problem still persisting remove your existing python and try re-installing it



来源:https://stackoverflow.com/questions/19089654/vim-shows-importerror-no-module-named-site-while-i-am-using-canopy1-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!