So my teacher in Python showed the turtle module, so I want to try it myself, but when I try to install the turtle module on my PC I have an error:
I'm using "pip" to install modules, so when I do "pip install turtle" on a console
(not Python console) I have an 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\Daxxas\AppData\Local\Temp\pip-build-727hpv0w\turtle\setup.py", line40
except ValueError, ve:
^
SyntaxError: invalid syntax
and there is this in red :
Command "python setup.py egg_info" failed with error code 1 C:\Users\Daxxas\AppData\Local\temp\pip-build-727hpv0w\turtle\
And I don't know what to do. There isn't pip's folder in "Temp".
So how can I fix this to be able to install the turtle module ?
ps : Is it possible to copy/paste something in a console ?
Turtle is already included in the Python standard library; you don't need to install anything.
The library you were installing is a completely different thing (an HTTP proxy, apparently) which looks like it's not compatible with any recent Python version.
This might be happening because you are trying to install a library that is already included in the standard library.
For example, I was trying to install hashlib using pip and was getting a similar error
python -m pip install hashlib
Complete output from command python setup.py egg_info:
....
File "C:\Users\bla\AppData\Local\Temp\pip-build-l8pg66yd\hashlib\hashlib.py", line 80
raise ValueError, "unsupported hash type"
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\bla\AppData\Local\Temp\pip-build-l8pg66yd\hashlib\
If you are not able to resolve the library, you might have not correctly setup the python interpreter or SDK in your IDE. Check if that is the case.
If you name your file turtle.py, it will give you this error. I figured it out after I had finished checked my Python interpreter, settings, etc.
Is it possible to copy/paste something in a console ?
YES SHIFT+INSERT
This shortcut works well with console as well as with console tools ie vim, emacs, nano etc.
Related
After installing Anaconda with python3 under C (Path: C:\Anaconda)and setting the path to the environmental variables in windows 10 system, I try to install "pyspec" module to Anaconda in command lines. It turns out to the following messages:
C:\Users\Timothy>pip install pyspec
Collecting pyspec
Using cached https://files.pythonhosted.org/packages/f0/36/fdcd349f2873a5ebd16b7ba2ed4c869a7474e1a77c2f1b6371ff2cfe0ee3/pyspec-0.2-r213.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\Timothy\AppData\Local\Temp\pip-install-a766ikbc\pyspec\setup.py", line 15, in <module>
from ez_setup import use_setuptools
File "C:\Users\Timothy\AppData\Local\Temp\pip-install-a766ikbc\pyspec\ez_setup.py", line 106
except pkg_resources.VersionConflict, e:
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\Timothy\AppData\Local\Temp\pip-install-a766ikbc\pyspec\
And I have no idea what happened. Could anybody help me to fix it?
One of the files in pyspec, namely the file ez-setup.py, has the line
except pkg_resources.VersionConflict, e:
Unfortunately, that syntax is acceptable in Python 2 but not in Python 3. The Python 3 syntax is
except pkg_resources.VersionConflict as e:
This shows that pyspec was written for Python version 2 and will not work with Python version 3. Its PyPI page shows that the package has not been updated since July 21, 2011. Most worrying, there are no versions of Python listed for the package. That means it was indeed written for Python 2 and has not been updated to Python 3.
Your best bet is to use another package. Using such an old, outdated package is not wise. If you really want to try, you could use 2to3 or something similar to attempt to convert pyspec to Python 3. But that would probably be a nightmare.
You could try to contact the authors, Stuart B. Wilkins and Certified Scientific Software, for updated code. (Contact info is in that PyPI page).
Ok so i'm trying to install scapy for python3, but ive been having some issues
when I enter this command:
pip install scapy
This is the output:
Collecting scapy
Using cached scapy-2.3.3.tgz
In the tar file C:\Users\MYNAME~1\AppData\Local\Temp\pip-oao3meyq-
unpack\scapy-2.3.3.tgz the member scapy-2.3.3/README
is invalid: unable to resolve link inside archive
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\MYNAME~1\AppData\Local\Temp\pip-build-
qjegdxw6\scapy\setup.py", line 36
os.chmod(fname, 0755)
^
SyntaxError: invalid token
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in
C:\Users\MYNAME~1\AppData\Local\Temp\pip-build-qjegdxw6\s
capy\
So then I searched around and I tried using this:
pip3 install scapy-python3
But it just says that pip3 isnt a command, so im not sure what to do
Instead of pip3 use pip
pip install scapy-python3
It worked for me. pip3 is usually used if you have both python2 and python3 installed on your machine. It is uesd to distinguish between different pips in your system.
The pip3.exe will be in python3x/scripts/.
Check if there is a pip3.exe is available in your scripts folder.
If the above solution doesn't work for you then try giving the full path of correct pip.exe.
I am new to Python and I am trying to install recsys package.
http://ocelma.net/software/python-recsys/build/html/installation.html
For this i need to install some pre-requiste packages, so i have to run this using pip
pip install csc-pysparse networkx divisi2
But whenever i run this i get the following in logs
Collecting csc-pysparse
Using cached csc-pysparse-1.1.1.4.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\64\AppData\Local\Temp\pip-build-wn7_65_9\csc-pysparse\
setup.py", line 33
print 'setuptools module not found.'
^
SyntaxError: Missing parentheses in call to 'print'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\i054564\
AppData\Local\Temp\pip-build-wn7_65_9\csc-pysparse\
I checked that setuptools exist in my python installation here
C:\Python34\lib\site-packages
I have ran everything from unstinalling setuptools to install it again, upgrade command, but it does not work.
Not able to figure out why setuptools is not found. Is it not found in the path of where pip resolves it from ?
cheers,
Saurav
The code triggering the error is Python 2-specific and is illegal in Python 3.
Apparently, csc-pysparse doesn't support Python 3 (its README only mentions 2.6) and looks abandoned (6 years since last commit).
Some guys out there suggest replacing it with SciPy.
The error is coming from the installation code of recsys package. In order to avoid this error, you need to install setuptools separately.
For debian machines, the below command will work.
sudo apt-get install python3-setuptools
For other machines, please checkout installation instructions at the link
Once setuptools package is installed, you can proceed with csc-pysparse installation.
I need to extract IPTC metadata from images. Most of the things I've read about Python packages on Windows suggest using pre-compiled binaries, but I don't see one for IPTCInfo, thus I tried pip3.
I'm getting an error from pip when trying to install this:
C:\Users\hackr>pip3 install IPTCInfo
Collecting IPTCInfo
Downloading IPTCInfo-1.9.5-6.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\hackr\AppData\Local\Temp\pip-build-v4m344a7\IPTCInfo\setup.py", line 32
print self.get_archive_files()
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\hackr\AppData\Local\Temp\pip-build-v4m344a7\IPTCInfo
So, I tried to open that last temporary file it refrences, but it doesn't appear to exist...
I have the same problem. Appears the IPTCinfo is for python-2. I will upgrade IPTCinfo for python-3.
However I have found the library exvi2 which provides the same type of image support. There is a python interface for this at https://wiki.gnome.org/Projects/gexiv2
I maintain IPTCInfo3 in Pypi. I recommend downloading it via pip3 install iptcinfo3 as it is specifically upgraded for Python3x. Follow the readme and issue comments for examples. Enjoy.
pretty new to Python/PyCharm and I'm having some issues installing packages. Specifically I'm having issues with BeautifulSoup. I get this error when trying to install it using Project Interpreter:
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 20, in <module
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/5d/13rfvrgn3b5c1n52l2ngrhzh0000gn/T/pycharm-packaging1.tmp/BeautifulSoup
I've tried all the other solutions that I can find on the web such as running pip install --user BeautifulSoup, I've updated SetupTools and Pip to be running the most recent version, etc. This only happens when I try to install on the Python 3.4 Project Interpreter.
If I switch to the Python 2.6.8 Interpreter, it will install. However when I try import BeautifulSoup, it says package not found. I'm sure this is an easier fix but if someone could please help that would be great! I'm getting pretty frustrated at this point. :/