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).
Related
I have installed Python 3 via Anaconda 3 to my PC which runs Windows10.
In trying to install pattern I get an error message:
(base) C:\Users\Alienware\Documents>pip install pattern
Collecting pattern
Using cached https://files.pythonhosted.org/packages/bf/50/d09941d53416f2a86676bd0dc341d5968b599a763b73f5d13f51c57b5641/pattern-2.6.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\ALIENW~1\AppData\Local\Temp\pip-install-w36z8q7u\pattern\setup.py", line 40
print n
^
SyntaxError: Missing parentheses in call to 'print'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\ALIENW~1\AppData\Local\Temp\pip-install-w36z8q7u\pattern\
Moreover at Github (https://github.com/clips/pattern) it is stated that:
Pattern supports Python 2.7 and Python 3.6+. The Python 3 version is
currently only available on the development branch.
But how do I access the 'development branch'?
On the other hand, I have successfully installed pattern3 to use with Python 3 but I can not find documentation for pattern3 (compatible with Python 3) using Google.
Update
#Roshan, I am running into an exception. See below:
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.
I need to install a module txsckjs,but when I run pip install txsockjs it shows me some error and I don't know what happened.
The error is following:
(venv)lk#linux-7hhe:~/MyImprove/project> pip install txsockjs
Collecting txsockjs
Using cached txsockjs-1.2.2.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-5pxhyr0u/txsockjs/setup.py", line 73
except Exception, e:
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-5pxhyr0u/txsockjs/
It is possible that the version of Python you are using is not compatible with the given module.
I have Python 3.5.2 and was able to reporduce your error. It should work on Python 2 I suppose.
Try replacing except Exception, e with except Exception as e in txsockjs/setup.py.
As underlined by SilentMonk and Saket, Python version matters in this case. See Python try…except comma vs 'as' in except and the reference, PEP 3110 -- Catching Exceptions in Python 3000.
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.
I am trying to install pydoop via following command
pip3.4 install pydoop
The installation is interrupted with following error
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "/tmp/pip-build-jwy57_9u/pydoop/setup.py", line 41
print 'using setuptools version', setuptools.__version__
^
SyntaxError: Missing parentheses in call to 'print'
I think the error has to do with mismatch in python version as there should be parantheses in call to 'print' in python3.
I am able to install other packages using pip3.4 install
The docs clearly state that Pydoop requires Python 2.7 (or 2.6) as a pre-requisite. As far as I know, there is no current support for Python 3 provided by Pydoop. In short, you need to switch to Python 2.7 (or 2.6).
As sgp mentioned, pydoop is only supported by Python 2. I suggest to preview the slides here and particularly
where comparison to Python and Java for Hadoop. Because Hadoop is natively written in Java, the Python community on hadoop is far smaller.
where the native implementation in Java outperforms the other ones.
Other options contain
use Java with Hadoop
or other libraries such as Hadoopy, mrjob and dumbo: Hadoopy not mentioning Python version explicitly on its 2-4 years old-dated repos in github, mrjob supports Python 3 as well by this and dumbo's websites are down from github here.
octopy