本文介绍了蟒蛇的virtualenv导入错误芹菜和台球的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是建设有蟒蛇2.7.10作为默认的一个新的亚马逊实例。之后,我已经跑在我的机器配置脚本和真理的时刻到来时,芹菜给了我一个进口,所以我调试的问题桌球。

i am building a new amazon instance with python 2.7.10 as default.after i have ran my machine provisioning scripts and the moment of truth arrives, celery gave me an import so i debugged the problem to billard.

包装似乎是正确的路径,即

the package appears to be in the correct path i.e.

sudo find -name "billiard"
./srv/ia-live/lib64/python2.7/dist-packages/billiard

其中ia-住的是我的virtualenv的路径。在检查通道通过Python的virtualenv执行

where ia-live is the path of my virtualenv. checking the path in via python virtualenv executable

import sys
sys.path

['',
 '/srv/ia-live/bin',
 '/srv/ia-live/src/django-devserver-redux-master',
 '/usr/lib/python2.7',
 '/srv/ia-live/local/lib64/python2.7/site-packages',
 '/srv/ia-live/local/lib/python2.7/site-packages',
 '/srv/ia-live/lib64/python2.7',
 '/srv/ia-live/lib/python2.7',
 '/srv/ia-live/lib64/python2.7/site-packages',
 '/srv/ia-live/lib/python2.7/site-packages',
 '/srv/ia-live/lib64/python2.7/lib-dynload',
 '/srv/ia-live/local/lib/python2.7/dist-packages',
 '/srv/ia-live/local/lib/python2.7/dist-packages',
 '/srv/ia-live/lib/python2.7/dist-packages',
 '/usr/lib64/python2.7',
 '/usr/lib/python2.7',
 '/srv/ia-live/local/lib/python2.7/dist-packages/IPython/extensions',
 '/home/ec2-user/.ipython']

这似乎是正确的,但是当我做

which appears to be correct, but when i do

import billiard
ImportError: No module named billiard

我不明白为什么有可能是问题

i don't understand why there could be problem

推荐答案

我能找出问题所在。它与带有EC2-AMI

i was able to identify the problem. It is with the default python27 virtualenv and devel packages that comes with ec2-ami

对我来说,我不得不更新系统画中画和系统virutalenv

for me, i had to update the system pip and system virutalenv

使用

sudo -i
pip install --upgrade pip
pip install --upgrade virtualenv

和我硬RAN的/ usr / bin中/的virtualenv来创建一个新的virtualenv。它解决了我的问题。

and the i hard ran /usr/bin/virtualenv to create a new virtualenv. it solved the problem for me.

希望它可以帮助别人了。

hope it helps somebody else too.

这篇关于蟒蛇的virtualenv导入错误芹菜和台球的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-18 14:07
查看更多