python virtualenv ImportError with celery and billiard

♀尐吖头ヾ 提交于 2019-12-08 08:03:42

问题


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

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


回答1:


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

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

using

sudo -i
pip install --upgrade pip
pip install --upgrade 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.



来源:https://stackoverflow.com/questions/33661818/python-virtualenv-importerror-with-celery-and-billiard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!