问题描述
我无法安装pyspatialite.当我尝试时,会出现此错误:
I can't install pyspatialite. When I try it gives me this error:
pip install pyspatialite
Downloading/unpacking pyspatialite
Could not find a version that satisfies the requirement pyspatialite (from versions:
2.6.2-spatialite.2.3.1, 2.6.2-spatialite.2.4.0-4, 3.0.1-alpha-0)
Cleaning up...
No distributions matching the version for pyspatialite
Storing debug log for failure in /home/jenia/.pip/pip.log
virtualenv中安装的python解释器是3.4.1.
The python interpreter that's installed in the virtualenv is 3.4.1.
当我明确奔跑时:
pip install pyspatialite==2.6.2-spatialite.2.4.0-4
我明白了:
Running setup.py (path:/home/jenia/pip/app/build/pyspatialite/setup.py) egg_info for package pyspatialite
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/home/jenia/pip/app/build/pyspatialite/setup.py", line 83
print "Is sphinx installed? If not, try 'sudo easy_install sphinx'."
^
SyntaxError: invalid syntax
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/home/jenia/pip/app/build/pyspatialite/setup.py", line 83
print "Is sphinx installed? If not, try 'sudo easy_install sphinx'."
^
SyntaxError: invalid syntax
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /home/jenia/pip/app/build/pyspatialite
Storing debug log for failure in /home/jenia/.pip/pip.log
有人知道如何解决此错误吗?
Does anyone know how to fix this error?
提前感谢您的时间和关注.
Thanks in advance for your time and kind concern.
杰尼亚.
推荐答案
我简短地看了这个问题(我自己也遇到了同样的问题),但不幸的是,这个消息并不好.
I looked briefly at this problem (having had the same problem myself) and unfortunately the news is not good.
事实证明,在大多数情况下,pysqlite的安装脚本甚至都不支持Python3.您看到的错误与此行代码有关,是在Python3中已弃用,而推荐使用print函数.
It turns out that pysqlite's install script doesn't even support Python3 for mostly trivial reasons, in this case. The error that you are seeing is related to this line of code, a print statement which was deprecated in Python3 in favor of the print function.
因此,您所看到的错误(当然,也是我所看到的)实际上是setup.py脚本中的语法错误.这是非常不幸的,因为在这种情况下,对已经被弃用了将近6年的语法来说,这几乎是微不足道的更改.
So the error that you were seeing (well, that I'm seeing as well) is actually a syntax error in the setup.py script. This is pretty unfortunate, since in this case, it would have been a mostly trivial change to a syntax that has been deprecated for almost 6 years now.
现在,这并不是唯一不是Python3安全包的东西,因此,现在可以肯定地说pysqlite不支持Python3. (我将亲自查看一下,看看是否需要进行足够小的更改,以至于我可以在几个小时内提出合并请求).
Now that may not be the only thing that's not Python3 safe in the package, so for now it's safe to say that Python3 is not supported by pysqlite. (I'll personally take a look and see if the changes required would be trivial enough that I can put together a pull request in a couple hours).
这篇关于无法使用python3和sqlite3安装pyspatialite的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!