简体   繁体   English

使用pip3安装python 3.4软件包时出错

[英]Error installing python 3.4 packages with pip3

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. 我安装了Python 2.7.3,使用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. 我在README之后安装了Python 3.4,没有任何错误,现在有几个软件包在尝试通过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 这是我得到的错误,例如,我尝试sudo pip3 install pysqlite http://pastebin.com/xTTK3zep和日志文件: httpsudo pip3 install pysqlite

Also happened when trying to install matplotlib, for example, with the same error: 在尝试安装matplotlib时也发生了同样的错误:

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! 谢谢!

pip doesn't check that the package has been updated for your Python version. pip不会检查您的Python版本的软件包是否已更新。 It seems that pysqlite hasn't - from the log file: 似乎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

This is a SyntaxError because print is a function in Python 3, not a statement. 这是一个SyntaxError,因为print是 Python 3中的一个函数 ,而不是一个语句。 The only solution to this is to use a package that has been updated, or to update this one yourself. 解决此问题的唯一方法是使用已更新的软件包,或自行更新此软件包。 You might consider whether the builtin sqlite3 module meets your needs. 您可以考虑内置的sqlite3模块是否满足您的需求。 As far as I can tell, it seems to be the same module; 据我所知,它似乎是同一个模块; it is certainly, according to the docs, originally written by the same person. 根据文档,它当然是由同一个人写的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM