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.
Related
I am trying to install python module turtle to my Ren'Py game. However, it will not install even if I clean the cache and download a fresh version of turtle:
pip install --target game/python-packages turtle
Collecting turtle
Downloading https://files.pythonhosted.org/packages/ff/f0/21a42e9e424d24bdd0e509d5ed3c7dfb8f47d962d9c044dba903b0b4a26f/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 "/private/var/folders/np/9134zq452dj8pt6435_dqb6h0000gn/T/pip-install-lzh_pa9s/turtle/setup.py", line 40
except ValueError, ve:
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/np/9134zq452dj8pt6435_dqb6h0000gn/T/pip-install-lzh_pa9s/turtle/
The syntax except ValueError, ve: is Python2-syntax and you're installing the module with Python3. The module was not updated since 2009, it's certainly Python2-only.
The actual module turtle is a part of the standard library, you don't need to install it, it must always be available.
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
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 have python3 installed on linux. In the python interpreter, I tried
import sqlite3
and got
ImportError: No module named '_sqlite3'
so i installed sqlite with
sudo apt-get install libsqlite-dev
and then recompiled python according to the instructions in the README file:
cd ~/Python-3.4.2;
./configure;
make;
make test;
and during test there was an error saying
[ 97/389] test_sqlite
test_sqlite skipped -- No module named '_sqlite3'
and then when I finished the install and tried to run the same python code, I still got the same ImportError. What am I doing wrong?
---EDIT---
I tried
pip install pysqlite
and got this error, which seems to be an issue between Python2.7 and Python3.4:
Downloading/unpacking pysqlite
Downloading pysqlite-2.6.3.tar.gz (76kB): 76kB downloaded
Running setup.py (path:/tmp/pip_build_plat/pysqlite/setup.py) egg_info for package pysqlite
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_plat/pysqlite/setup.py", line 85
print "Is sphinx installed? If not, try 'sudo easy_install sphinx'."
^
SyntaxError: Missing parentheses in call to 'print'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_plat/pysqlite/setup.py", line 85
print "Is sphinx installed? If not, try 'sudo easy_install sphinx'."
^
SyntaxError: Missing parentheses in call to 'print'
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_plat/pysqlite
Storing debug log for failure in /home/plat/.pip/pip.log
After install libsqlite-dev you should install pysqlite
pip install pysqlite
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).