0

I've banged my head many hours trying to solve this, any help would be much appreciated.

I had Python 2.7.3 installed, and I never had any problems using pip. I installed Python 3.4 following the README with no errors, and now there are several packages that return errors when trying to install through pip3. For some packages it works fine though.

Here's the error I get when, for example, I try sudo pip3 install pysqlite http://pastebin.com/xTTK3zep and the log file: http://pastebin.com/23X8cmjU

Also happened when trying to install matplotlib, for example, with the same error:

Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/pysqlite

If there's anything else I could provide to help answer the question, just let me know. Is this a bug, or am I doing something stupid? Thanks!

4

1 回答 1

2

pip 不会检查包是否已针对您的 Python 版本进行了更新。似乎 pysqlite没有- 从日志文件中:

  File "/tmp/pip_build_root/pysqlite/setup.py", line 85

    print "Is sphinx installed? If not, try 'sudo easy_install sphinx'."

                                                                       ^

SyntaxError: invalid syntax

这是一个 SyntaxError,因为print 是Python 3 中的一个函数,而不是一个语句。唯一的解决方案是使用已更新的包,或自己更新此包。您可以考虑内置 sqlite3 模块是否满足您的需求。据我所知,它似乎是同一个模块;根据文档,它肯定是由同一个人最初编写的。

于 2014-05-03T12:17:57.360 回答