在我的工作站(Ubuntu Linux)的virtualenv中安装preppy时,它可以工作,但是在Amazon Linux实例上以相同的方式安装preppy时,会出现如下错误:
(env)[ec2-user@server t]$ pip install preppy
Downloading/unpacking preppy
Downloading preppy-2.3.2.tar.gz (42kB): 42kB downloaded
Running setup.py (path:/home/ec2-user/t/env/build/preppy/setup.py) egg_info for package preppy
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/home/ec2-user/t/env/build/preppy/setup.py", line 13, in <module>
import preppy
File "/home/ec2-user/t/env/build/preppy/preppy.py", line 72, in <module>
isPy3 = sys.version_info.major == 3
AttributeError: 'tuple' object has no attribute 'major'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/home/ec2-user/t/env/build/preppy/setup.py", line 13, in <module>
import preppy
File "/home/ec2-user/t/env/build/preppy/preppy.py", line 72, in <module>
isPy3 = sys.version_info.major == 3
AttributeError: 'tuple' object has no attribute 'major'
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /home/ec2-user/t/env/build/preppy
Storing debug log for failure in /home/ec2-user/.pip/pip.log
这在检查Python版本是什么时暗示了一个问题,但是这次四处搜寻并没有帮助我。
我知道python软件包有时会依赖于主机软件,例如要安装psycopg2,我必须首先在操作系统上安装Postgres开发软件包。
那么我该如何解决该错误呢?
您的ec2实例需要(至少)运行python 2.7。
sys.version_info
直到2.7才成为命名元组。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句