无法在我的mac中安装Django - | setup.py egg_info“failes with'module'对象没有属性'lru_cache'

问题描述 投票:0回答:2

我尝试使用sudo pip install Django命令安装Django。它已下载但卡在错误 - Command "python setup.py egg_info" failed with error code 1

终奌站

enter image description here

我已经安装了Python 3.6.3,但pip仍然指向Python 2.7,上面的问题发生是因为pip没有指向python 3.6.3

终奌站

enter image description here

python django python-3.x
2个回答
2
投票

您可以使用

python3.6 -m pip install 

但是如果你为python 3.6创建virtualenv然后在其中安装包会更好


1
投票

如前所述,您最好使用虚拟环境进行安装。

看看pipenv 它简化了管理虚拟环境的整个过程。

pipenv --python 3.6 install django

上面的命令将使用python 3.6创建一个虚拟环境并安装django

© www.soinside.com 2019 - 2024. All rights reserved.