2015-04-12 89 views
0

我有Python 2.7版的默認但是我也有單獨安裝得到錯誤嘗試創建巨蟒-3虛擬環境

virtualenv -p /usr/local/bin/python3.5 kivyPy3.5 

蟒蛇3.5,所以我想安裝的Python kivy的應用開發,但我3.5虛擬ENV我得到以下錯誤:

Traceback (most recent call last): 
    File "/Library/Python/2.7/site-packages/enum/__init__.py", line 371, in __getattr__ 
    return cls._member_map_[name] 
KeyError: '_convert' 

During handling of the above exception, another exception occurred: 

Traceback (most recent call last): 
    File "/Library/Python/2.7/site-packages/virtualenv.py", line 23, in <module> 
    import subprocess 
    File "/usr/local/lib/python3.5/subprocess.py", line 364, in <module> 
    import signal 
    File "/usr/local/lib/python3.5/signal.py", line 8, in <module> 
    _IntEnum._convert(
    File "/Library/Python/2.7/site-packages/enum/__init__.py", line 373, in __getattr__ 
    raise AttributeError(name) 
AttributeError: _convert 

任何幫助將不勝感激。

+0

你的python3.5路徑是否正確? '在/ usr/local/bin目錄/ python3.5'? – itzMEonTV

+0

你爲什麼使用python的開發版本? –

+0

@PadraicCunningham的權利,我實際上正在嘗試,但我認爲即使kivy已與我設置env的不兼容性。 –

回答

0
 
Installation: 
step 1: 
>> sudo easy_install virtualenv 

step 2: 
Creating the First Virtual Environment 

>> mkdir first_evn 

>> virtualenv first_env/test_env 
or 
>> virtualenv first_env/test_env --no-site-packages 

-no-site-packages: If you don’t want to use any preinstalled packages from my operating system 

step 3: activating environment 

>> source /first_env/test_env/bin/activate 

step 4: Deactivating Environment 

>> deactivate 

Important: if you have more than one versions of Python on your server or local system and you want to create a viertualenv for a specific version of python then please replace the step 2 with following 

For Ubuntu 
>> virtualenv --python=/usr/bin/python3.3 first_env/test_env 

For Window 

>> virtualenv --python=c:\Python33\python.exe first_env/test_env 

For mac 
virtualenv --python=python3.4 test_env 

Adding virtual env path in .base_profile file 

>>> pico ~/.bash_profile 

And add live alias ff='source ~/PATH_FROM_ROOT/VIRTUAL_ENV_NAME/bin/activate' 
+0

我後來用pyenv3.5來創建虛擬環境。 –

+0

@san您正在使用哪種操作系統? –

+0

我在OSx小牛隊。 –

0

此問題是由安裝在您的系統的Python 2.7使用Python 3.5,你正在嘗試使用的virtualenv中交互的包enum34的版本引起的。

要修復它,請使用與您的系統Python 2.7關聯的pip實例執行以下

pip install --upgrade enum34 

這是關於它的Github問題對話。 https://github.com/pypa/virtualenv/issues/763