我已尝试重新安装,并收到以下消息:
Requirement already satisfied: troposphere==1.8.2 in /usr/local/lib/python2.7/site-packages (from -r requirements.txt (line 13)我检查了我的python版本,我可以看到这是相同的:
animjain$ python -V
Python 2.7.10当我尝试导入一个模块时,得到以下错误:
animjain$ python
Python 2.7.10 (default, Oct 23 2015, 19:19:21)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from troposphere import Join, Ref, FindInMap
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named troposphere发布于 2017-02-27 22:00:47
您应该使用virtualenv来安装项目的依赖项。你不需要阻塞全局站点包。
例如:
sudo apt-get install virtualenv
cd ~
virtualenv your_test_venv
source your_test_venv/bin/activate
pip install troposphere在此之后,您可以使用您的新包。
当您想要停用您的virtualenv时,可以运行命令deactivate
发布于 2017-02-27 21:45:50
如果您的计算机上有多个Python版本,请使用相同的Python命令进行安装,而不是:
animjain$ pip install troposphere==1.8.2运行:
animjain$ python -mpip install troposphere==1.8.2https://stackoverflow.com/questions/42486550
复制相似问题