问题描述
我用sudo pip install awsebcli --upgrade --user
运行eb --version
时,出现以下错误.
When running eb --version
I get the following error.
Traceback (most recent call last):
File "/home/andrew/.local/bin/eb", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/local/google-cloud-sdk/platform/google_appengine/lib/setuptools-0.6c11/pkg_resources.py", line 2603, in <module>
working_set.require(__requires__)
File "/usr/local/google-cloud-sdk/platform/google_appengine/lib/setuptools-0.6c11/pkg_resources.py", line 666, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/google-cloud-sdk/platform/google_appengine/lib/setuptools-0.6c11/pkg_resources.py", line 565, in resolve
raise DistributionNotFound(req) # XXX put more info here
pkg_resources.DistributionNotFound: awsebcli==3.12.4
有什么想法吗?
这是我的pip --version
:
pip 9.0.3 from /usr/local/lib/python2.7/dist-packages (python 2.7)
推荐答案
问题是您以root
用户身份安装了awsebcli
,但以非root
用户身份执行了eb --version
.因此,就非root
用户而言,awsebcli
从未安装.
The problem is that you installed awsebcli
as the root
user, but performed eb --version
as a non-root
user. So, as far as the non-root
user is concerned, awsebcli
never got installed.
要以非root
用户身份运行eb
:
-
pip install awsebcli
(无sudo
)
要验证是否有效,请在pip list
To verify this worked, find awsebcli
in the output of pip list
如果1.引起问题,建议您在设置 virtualenv
.基本上,virtualenv
分隔了您的Python软件包,因此您不会弄乱系统版本的Python和root
用户.
If 1. causes you a problem, I recommend installing the awsebcli
after setting up a virtualenv
. Basically, virtualenv
compartmentalizes your Python packages so you do not mess with the system's version of Python and the root
user.
这篇关于Elastic Beanstlak CLI安装错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!