2017-12-18 80 views
0

我嘗試使用sudo pip install Django命令安裝Django,它已經下載但出現錯誤 - Command "python setup.py egg_info" failed with error code 1無法在我的Mac中安裝Django - | setup.py egg_info「failes with'module'object has no attribute'lru_cache'

終端

enter image description here

我已經安裝了Python 3.6.3,但pip仍指向Python 2.7,是上述問題的發生是由於PIP沒有指向python 3.6.3

終端

enter image description here

+1

創建的virtualenv與Python 3.6,然後運行 –

+0

使用Anaconda內PIP ..沒有結合OS –

回答

2

您可以使用

python3.6 -m pip install 

但是,如果你的Python 3.6創建的virtualenv,然後在它

1

正如前面提到的,你會安裝軟件包會更好更好地使用虛擬環境進行安裝。

看看pipenv它簡化了管理虛擬環境的整個過程。

pipenv --python 3.6 install django 

上面的命令將使用Python 3.6創建一個虛擬環境,並安裝Django

相關問題