I am trying to install IMDbPY on my MacBook running on 10.12.4 with python version 3.5.2. I did find a couple of question threads addressing the issue but the suggestions offered do not seem to help me.
Following are the outputs from my terminal.
host-vlth5x-205:IMDbPY-3.5 apple$ pip install IMDbPY
Collecting IMDbPY
Using cached IMDbPY-5.1.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/gd/f_5prpbn13j_xy22k_4nlvgh0000gn/T/pip-build-k_hgg84y/IMDbPY/setup.py", line 200
print 'Created locale for: %s.' % ' '.join(languages)
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/gd/f_5prpbn13j_xy22k_4nlvgh0000gn/T/pip-build-k_hgg84y/IMDbPY/
Post this, I have tried downloading the latest stable version of IMDbPY-3.5 here and installing the package manually via the terminal, which gave me the following error:
host-vlth5x-205:IMDbPY-3.5 apple$ python setup.py
File "setup.py", line 128
except SystemExit, e:
^
SyntaxError: invalid syntax
Please help me figure this out. Thanks!
Currently, IMDbPY is a Python 2.7-only library. It can't (yet) work on Python 3.x.
To fix your problem, install Python 2.7
Related
I am trying to install turtle package in pycharm, but while installing i got this error:
Collecting turtle
Using cached turtle-0.0.2.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Ptr\AppData\Local\Temp\pycharm-packaging\turtle\setup.py", line 40
except ValueError, ve:
except ValueError, ve:
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1
I don't know what to do, help me please.
pip installs turtle 0.0.2 from PyPI. Released in 2009. The code is obviously Python2-only.
You don't need to install turtle — it's a module from the standard library since at least Python 2.6. Just import it and use.
I am having problems trying to install PyGObject on a mac:
Collecting PyGObject
Using cached pygobject-2.28.3.tar.bz2
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/pb/4p0s32g54dl1vg3s25kch71w0000gn/T/pycharm-packaging/PyGObject/setup.py", line 272
raise SystemExit, 'ERROR: Nothing to do, gio could not be found and is essential.'
^
SyntaxError: invalid syntax
The Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/pb/4p0s32g54dl1vg3s25kch71w0000gn/T/pycharm-packaging/PyGObject/
This is what I get back. I have Python 3 and I use PyCharm. I tried to install PyGObject and I can not make it work. I have tried several approaches but nothing has worked. Can someone help me please?
I'm trying to install BeautifulSoup package through PyCharm, I have also tried to download it through the command line. But I just cannot seem to get to it to run on PyCharm. I keep getting the following error
Collecting BeautifulSoup
Using cached BeautifulSoup-3.2.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Hemesh\AppData\Local\Temp\pycharm-packaging\BeautifulSoup\setup.py", line 22
print "Unit tests have failed!"
^
SyntaxError: Missing parentheses in call to 'print'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\Hemesh\AppData\Local\Temp\pycharm-packaging\BeautifulSoup\
You are using pip version 8.1.1, however version 8.1.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
Can anyone help?
thanks in advance
Are you used to using Python 2.7? It seems to be asking for Python 3.X syntax for your print statement, so it might be an issue with the versions you're trying to use?
BeautifulSoup 3.2.1 only works with Python 2.7 (and is obsolete), if you get BeautifulSoup 4, it should work with both versions.
I'm trying to install pystashop module.
I have a Python 3.4 installed on Windows 7 64 bits.
When I try pip install pystashop I get this error:
Collecting pystashop
Downloading pystashop-0.4.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "C:\Users\Me\AppData\Local\Temp\pip-build-zyt3yyca\pystashop\setup.py", line 12, in <module>
execfile(os.path.join('pystashop', 'version.py'))
NameError: name 'execfile' is not defined
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\Me\AppData\Local\Temp\pip-build-zyt3yyca\pystashop
how can I solve this?
ADD:
I tryed to install and run 'python ez_setup.py' and after run 'easy_install pip' but with no success. Still getting the same error.
execfile is a standard library builtin in Python 2. It was removed in Python 3, which means that pystashop does not support Python 3. You should try contacting the developer(s) and request Python 3 support, and in the meantime see if you can get by with Python 2.
You can attempt to remedy the situation yourself by cloning the GitHub repo, making changes, and installing with python3 setup.py install, but there's no guarantee that it will work properly. The offending code seems to be here:
execfile(os.path.join('pystashop', 'version.py'))
You can replace this with the following:
exec(open(os.path.join('pystashop','version.py')).read())
This will provide the expected functionality. From a cursory glance over the code, everything else appears to be compatible with Python 3, though I may have missed something.
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.
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).