在我的工作站(Ubuntu Linux)上的virtualenv中安装preppy时,它可以工作,但是当在Amazon Linux的实例上以相同的方式安装它时,我会收到如下错误:
(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开发包。
那我该如何解决这个错误?
答案 0 :(得分:0)
你的ec2实例需要运行(至少)Python 2.7。
直到2.7, sys.version_info
才成为命名元组。