3

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

The python interpreter that's installed in the virtualenv is 3.4.1.

When I run explicetly:

pip install pyspatialite==2.6.2-spatialite.2.4.0-4

I get this:

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.

Jenia.

Jenia Ivanov
  • 2,485
  • 3
  • 41
  • 69

1 Answers1

1

I looked briefly at this problem (having had the same problem myself) and unfortunately the news is not good.

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.

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.

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).

Hiebert
  • 66
  • 1
  • 4