Trying to install oursql driver for python3x and sqlalchemy0.8 on ubuntu 12.10. It fails with the following error.
sudo pip-3.2 install oursql
Downloading/unpacking oursql
Running setup.py egg_info for package oursql
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/tmp/pip-build/oursql/setup.py", line 53
print "cython not found, using previously-cython'd .c file."
^
SyntaxError: invalid syntax
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/tmp/pip-build/oursql/setup.py", line 53
print "cython not found, using previously-cython'd .c file."
^
SyntaxError: invalid syntax
When I try to install cython I seem to already have it:
sudo pip-3.2 install cython
Requirement already satisfied (use --upgrade to upgrade): cython in /usr/local/lib/python3.2/dist-packages
Cleaning up.
What can I do to make it run?
Had the same error when running pip-3.2.
This is how I made it work:
Created my env using python-3.2:
virtualenv -p /usr/bin/python3.2
Installed the required packages:
sudo apt-get install python-dev
sudo apt-get install libmysqlclient-dev
Then installed:
sudo pip install cython
sudo pip install oursql
Edit1:
I was able to get pass you error with my above recomendations, but i was wrong (python3.2 was unable to read oursql). I tried the following and was able to make a connection:
First:
sudo apt-get install python3.2-dev
Then installed oursql for Python 3 from source (as suggested by it's maintainer here):
Get the Python 3 version of oursql from here and compile it from source (Don't have enough reputation to post the link, just go to oursql official site for installation instructions).
The maintainers have two packages, one for python 2.x and one for python 3.x, you should run:
pip install oursql3
There is nothing about cython.
You just encoutered a syntax error in print, because the print statement doesn't use brackets there. They were optional in Python 2's print statement, but are required in Python 3's print() function.
install it manually - reqs: python-dev, cython
then download oursql package (try 0.9.3.zip)
and
python setup.py install
Related
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 have a problem installing wsgiref:
$ python --version
Python 3.6.0 :: Anaconda 4.3.1 (x86_64)
$ pip --version
pip 9.0.1 from /anaconda/lib/python3.6/site-packages (python 3.6)
My requirement.txt file are shown as below.
numpy==1.8.1
scipy==0.14.0
pyzmq==14.3.1
pandas==0.14.0
Jinja2==2.7.3
MarkupSafe==0.23
backports.ssl-match-hostname==3.4.0.2
gnureadline==6.3.3
ipython==2.1.0
matplotlib==1.3.1
nose==1.3.3
openpyxl==1.8.6
patsy==0.2.1
pyparsing==2.0.2
python-dateutil==2.2
pytz==2014.4
scikit-learn==0.14.1
six==1.7.3
tornado==3.2.2
wsgiref==0.1.2
statsmodels==0.5.0
when I run pip install -r requirement.txt, I got this error
Collecting wsgiref==0.1.2 (from -r requirements.txt (line 20))
Using cached wsgiref-0.1.2.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/xs/y0pbzxkn7gqcdtrz4cpxtwrw0000gn/T/pip-build-hkiqbu1j/wsgiref/setup.py", line 5, in <module>
import ez_setup
File "/private/var/folders/xs/y0pbzxkn7gqcdtrz4cpxtwrw0000gn/T/pip-build-hkiqbu1j/wsgiref/ez_setup/__init__.py", line 170
print "Setuptools version",version,"or greater has been installed."
^
SyntaxError: Missing parentheses in call to 'print'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/xs/y0pbzxkn7gqcdtrz4cpxtwrw0000gn/T/pip-build-hkiqbu1j/wsgiref/
I have tried to run pip install --upgrade setuptools and sudo easy_install -U setuptools but neither works. How can I solve this problem?
wsgiref is already been included as a standard library in Python 3...
So in case if you are trying with Python 3 just go ahead and import wsgiref thats it.
According to this line SyntaxError: Missing parentheses in call to 'print', I think it needs Python 2.x to run the setup.py. Whether to use parentheses in print is the different syntax of Python 2 and Python 3.
This is the solution from the Github issue:
There are a few fixes that will get you running, in order of least work to most:
Switch over to python2.7 for your will installs.
Try to upgrade wsgiref with pip install --upgrade wsgiref, and see if the latest version works with your setup, and with will (if it doesn't, you'd notice the http/webhooks stuff not working.
If you try 2) and it works, submit a PR here with the upgraded version in requirements.txt. (You can find out what versions you've got by using pip freeze).
You can find more about the syntax difference here
Solution:
Flask-restful is deprecated, use version flask-restx
I am new to Python and I am trying to install pypgen.
As explained one the webpage, I first installed "samtools" (via brew install samtools as recommended).
Trying to install pypgen
I tried the 4 ways suggested by the author to install pypgen
$pip3.6 install pypgen
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/yv/n6rkh3sn5mn5qpsn87lvjw4m0000gp/T/pip-build-aQiBgg/pypgen/
$easy_install pypgen
Processing pypgen
error: Couldn't find a setup script in /Users/remi/Downloads/pypgen-0.2.1/pypgen
$pip3.6 install -e git+https://github.com/ngcrawford/pypgen.git
Could not detect requirement name, please specify one with #egg=
I downloaded "pypgen-0.2.1.tar.gz" from the pypgen website, uncompressed it, cd to the folder and did
$python setup.py install
Traceback (most recent call last):
File "setup.py", line 1, in <module>
import distribute_setup
ImportError: No module named distribute_setup
So, I did
$pip3.6 install distribute
but it did not solve the previous issue
Trying to Solve egg_info error
This egg_info error seems to be key. I tried to download this file and did
sudo python ez_setup.py
as recommended on this post but it did not solve the error messages above. I then tried
sudo pip3.6 install --upgrade setuptools
as recommended on this post but I keep receiving the same error messages when doing pip3.6 install pypgen
I am using Python 3.6 but I also have the version 2.7 installed. I tried everything with both versions (pip3.6 and pip2.7) and get the same errors. I am on MAC OS X 10.11.3
I've recently done a clean install of Python 3.6 on my Windows 10 laptop.
I wish to install BeautifullSoup. When i try to use
python -m pip install BeautifulSoup
it returns the following:
C:\Users\mjpvanzuijlen\AppData\Local\Programs\Python\Python36>python -m pip install BeautifulSoup
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\MJPVAN~1\AppData\Local\Temp\pip-build-kopzhsyx\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\MJPVAN~1\AppData\Local\Temp\pip-build-kopzhsyx\BeautifulSoup\
I found others with similair problems with egg_info, but the solutions did not work for me. I have tried to upgrade pip, i downloaded setuptools32.3.2.1, i've upgraded setupttools but all to no avail.
It looks like you are trying to install the wrong package.
Try running: python -m pip install BeautifulSoup4
instead of: python -m pip install BeautifulSoup
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.