I try to install local instance of Read the Docs on my Win10
When I follow this documentation:
http://docs.readthedocs.io/en/latest/install.html
and type:
pip install -r requirements.txt
I get this error:
Collecting Distutils2==1.0a3 (from -r requirements/pip.txt (line 65))
Using cached Distutils2-1.0a3.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\USER\AppData\Local\Temp\pip-build-xseiavup\Distutils2\setup.py", line 9, in <module>
from distutils2.util import find_packages
File "C:\Users\USER\AppData\Local\Temp\pip-build-xseiavup\Distutils2\distutils2\util.py", line 174
except KeyError, var:
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\USER\AppData\Local\Temp\pip-build-xseiavup\Distutils2\
Anyone know this error?
My pip version: 8.1.2;
python: 3.5
Is it possible you are running the Python 2 pip? The error message clearly indicates that the code is being executed under Python 3 but has Python 2 syntax. Do you get better results with
python -m pip install -r requirements.txt
I wonder? If not then verify that
python
runs version 3.5 ...
Oh. I just checked and the disutils2 page on PyPI says
Distutils2 development is stopped.
tl;dr: keep using setuptools and pip for now, don’t use distutils2.
It looks like there was never a Python 3 version. Looks like you might need to update your code.
Related
so I am new to Python and what is a good way to learn it is to do some personal project :) So I am on my Windows and using virtualenv to contain environment
So, I need to use the Scrappy module:
pip install scrappy
Collecting scrappy
Using cached Scrappy-0.3.0.alpha.4.tar.gz
Collecting guessit (from scrappy)
Using cached guessit-2.1.4.tar.gz
Collecting tvdb_api (from scrappy)
Using cached tvdb_api-2.0.tar.gz
Collecting hachoir-metadata (from scrappy)
Using cached hachoir-metadata-1.3.3.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\USERPH\AppData\Local\Temp\pip-build-__zp7zbj\hachoir-metadata\setup.py", line 65
except OSError, err:
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\USERPH\AppData\Local\Temp\pip-build-__zp7zbj\h
achoir-metadata\
Its because hachoir-metadata is a Python2 dependent package, so I tried installing their Python 3 version
pip install hachoir3
I confirmed that it was installed using
pip list | Select-String hachoir3
so I tried running
pip install scrappy again
but same error.
Any work around to install scrappy? I cannot go down to Python 2.
Thanks!
Scrappy itself contains code that only works in Python 2. I.e. Scrappy cannot be used with Python 3+.
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 hope someone here can help me cause iam really struggling with this for about 12 hours+.
I try to use Django with MongoDb Using the following Instruction for the packages http://docs.mongodb.org/manual/tutorial/write-a-tumblelog-application-with-django-mongodb-engine/
which want me to install
pip install ***ps://bitbucket.org/wkornewald/django-nonrel/get/tip.tar.gz
pip install ***ps://bitbucket.org/wkornewald/djangotoolbox/get/tip.tar.gz
pip install ***ps://github.com/django-nonrel/mongodb-engine/tarball/master
I managed the first 2, however I get the following errors when I try to install the mongodb-engine.
I tried various forms to install it like "pip install django-mongodb-engine"
I get the following error:
"C:\Users\Burnie\Anaconda3\Scripts>pip install django-mongodb-engine
Collecting django-mongodb-engine
Using cached django-mongodb-engine-0.6.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 20, in
File "C:\Users\Burnie\AppData\Local\Temp\pip-build-ntl4z4sp\django-mongodb-engine\setup.py", line 3, in
import django_mongodb_engine as distmeta
File "C:\Users\Burnie\AppData\Local\Temp\pip-build-ntl4z4sp\django-mongodb-engine\django_mongodb_engine__init__.py", line 12,
in
from django.conf import settings
File "C:\Users\Burnie\Anaconda3\lib\site-packages\django\conf__init__.py", line 88
except ImportError, e:
^
SyntaxError: invalid syntax
Command "python setup.py egg_info" failed with error code 1 in C:\Users\Burnie\AppData\Local\Temp\pip-build-ntl4z4sp\django-mongodb-
engine"
MySystem:
Windows 7,
Anaconda (as python distribution) 64bit
I hope someone can help me on that.
The bitbucket versions of the code are pretty old now. You should use the ones on github instead.
pip install https://github.com/django-nonrel/django/tarball/master
pip install https://github.com/django-nonrel/mongodb-engine/tarball/master
pip install https://github.com/django-nonrel/djangotoolbox/tarball/master
There's also some more up to date instructions on getting this working available in the mongodb-engine documentation
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).