我已经安装了pyhash,为什么它总是说找不到模块?有人能帮我吗?在
这是我的。特拉维斯·伊梅尔公司名称:
language: python
before_install:
- sudo apt-get -qq update
- sudo apt-get install libboost-all-dev
python:
- "2.7"
install:
- sudo pip install pyhash
script: py.test
这是我的项目目录:
^{pr2}$错误消息是:
ImportError: No module named pyhash
但我看到它安装在命令窗口。在
TL;DR:尝试删除所有
sudo
调用,使用附加组件:易于安装boost requirements和pip install user pyhash
(但是这对python3.5没有帮助)。在我做了几个测试,看起来如果您使用
sudo pip install
来安装包,那么安装脚本用户就看不到它了。例如,请参见this travis build。 在我的测试中,sudo: required
是否被添加到.travis.yml
中并不重要。在不幸的是without sudo由于
PermissionError: [Errno 13] Permission denied: '/usr/lib/libboost_python.so'
错误,pip install pyhash
是不可能的。在不过,我在stackoverflow上也发现了this问题,看起来你可以用}。在
pip install user
代替{我也tested这种方法,不幸的是你不能在我的配置中使用
user
。错误是:Can not perform a ' user' install. User site-packages are not visible in this virtualenv.
所以最后我试着用apt addon代替
sudo apt-get install
来确保sudo:required
没有被使用,但它也是did not help。在如果不尝试为travis-ci创建问题,也许您在python2.7上会更幸运
相关问题 更多 >
编程相关推荐