在我使用Cython编译打破我的Ubuntu之后,我喜欢保持系统Python干净.我喜欢互相使用2.7.x和3.4.x,并使用Pyenv拥有一个独立于系统python的全局默认解释器.现在我还想在每个项目的基础上定义本地解释器,通常使用pyenv local.不幸的是,我最喜欢的IDE PyCharm只支持pyenv global,本地.python-version文件显然不被PyCharm识别.
所以我试着在PyCharm中使用pyenv全局解释器和〜/ .pyenv/bin/python-local-exec一起工作,但不幸的是已经弃用了.当我尝试从pyenv Python 3全局解释器创建virtualenv时,它抛出了以下错误:
The following command was executed: virtualenv.py /home/barrios/code/so/venv The error output of the command: pyenv: `python-local-exec' is deprecated and will be removed in the next release. To upgrade: https://github.com/yyuu/pyenv/wiki/python-local-exec Failed to import the site module Traceback (most recent call last): File "/home/barrios/code/so/venv/lib/python3.4/site.py", line 67, inimport os File "/home/barrios/code/so/venv/lib/python3.4/os.py", line 634, in from _collections_abc import MutableMapping ImportError: No module named '_collections_abc' Using base prefix '/home/barrios/.pyenv/versions/3.4.0b3' New python executable in /home/barrios/code/so/venv/bin/python ERROR: The executable /home/barrios/code/so/venv/bin/python is not functioning ERROR: It thinks sys.prefix is '/home/barrios/.pyenv/bin' (should be '/home/barrios/code/so/venv') ERROR: virtualenv is not compatible with this system or executable
如前所述,我不想将Python 3安装到我的Ubuntu系统文件夹中.任何想法如何实现?
TNX很多!
我建议使用https://github.com/yyuu/pyenv-virtualenv为所需的解释器创建virtualenv,然后在PyCharm中将其添加为Python解释器.