Excuse me if this is a noob's question, but I am blank if it comes to Python...
I am trying to install the Python av library on a Raspberry Pi 3. But all I get is
pi#raspberrypi:~/camera_proxy $ sudo pip install av
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting av
Downloading https://files.pythonhosted.org/packages/40/e6/da37b548e9e1312fb11ffd0f31f8679e1b96d3859790a77e93a113394d34/av-8.0.3.tar.gz (2.3MB)
100% |████████████████████████████████| 2.3MB 49kB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-Mwk4pG/av/setup.py", line 9, in <module>
from shlex import quote
ImportError: cannot import name quote
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-Mwk4pG/av/
I already purged and reinstalled all Python (1&3) to no avail. The Raspbian is the latest stable release.
There seems to be a quote item not found, that supposedly would be part of the shlex library?
The solution for me was to use pip3 instead of pip.
Related
I am trying to write some script which requires ropper. (install only via pip)
How can i fix this problem?
I am trying to install it on linux, tried to upgrade setuptools, install old version and followed this, only one topic, which i found:
the link!
This is the error message:
$ pip install ropper
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting ropper
Using cached https://files.pythonhosted.org/packages/94/b1/922dfab5083ff439ce70358c7f3e49185c54e6ea6ee2bb7cd292e63eac06/ropper-1.12.1.tar.gz
Collecting filebytes>=0.9.18 (from ropper)
Using cached https://files.pythonhosted.org/packages/0b/3a/9fc0c62bd74583137a8bbc3c8020d6a8234b9cf8bc1e99fe929688b19093/filebytes-0.9.20.tar.gz
ERROR: Complete output from command python setup.py egg_info:
ERROR: Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-d44HeD/filebytes/setup.py", line 3, in <module>
from pathlib import Path
ImportError: No module named pathlib
----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-d44HeD/filebytes/
filebytes==0.9.20 release is not compatible with Python 2; the package maintainer already fixed this, but the new version is not yet uploaded to PyPI. Restrict filebytes to previous version for now:
$ pip install "filebytes<0.9.20" ropper
Once next version (0.9.21) is released, you can update it if you want:
$ pip install --upgrade "filebytes>0.9.20"
I am new in python on flask, when i try to install mysql-python by entering the
following command in terminal
pip3 install mysql-python
it shows the following error:
Collecting mysql-python
Using cached https://files.pythonhosted.org/packages/a5/e9/51b544da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/MySQL-python-1.2.5.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-4nev4id4/mysql-python/setup.py", line 13, in <module>
from setup_posix import get_config
File "/tmp/pip-install-4nev4id4/mysql-python/setup_posix.py", line 2, in <module>
from ConfigParser import SafeConfigParser
ModuleNotFoundError: No module named 'ConfigParser'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-4nev4id4/mysql-python/
and then I use this command
sudo apt install default-libmysqlclient-dev in terminal which has been suggested by many i checked on stackoverflow.
and then I retry to install mysql-python but also it is showing the same error, can anyone please help me.
mysql-python only supports Python 2.x, while you seem to be using Python 3. From the linked PyPI page:
MySQL-3.23 through 5.5 and Python-2.4 through 2.7 are currently
supported. Python-3.0 will be supported in a future release.
To connect to MySQL from Python 3 you can use other alternatives:
mysqlclient
mysql-connector-python
pymysql
cymysql
MySQL-python does not support python3. That is why you get this particular error
ModuleNotFoundError: No module named 'ConfigParser'
In python3 ConfigParser is renamed configparser
One option to connect to MySQL DB is official python connector
Another option is pyodbc
Other options are provided in other answers
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 have python 3.5 and 2.7 installed (I don't know if this might be the problem) and I need to use ZeroC Ice and when I do:
sudo pip install ice
I get the following error in the terminal:
Collecting ice
Using cached ice-0.0.1.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-MoRI5C/ice/setup.py", line 32, in <module>
import ice
File "ice.py", line 46, in <module>
import urllib.parse
ImportError: No module named parse
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-MoRI5C/ice/
But parse is already installed (I guess):
sudo -H pip install parse
Requirement already satisfied (use --upgrade to upgrade): parse in /usr/local/lib/python2.7/dist-packages
How can I solve this please?
THanks
This is a simple mistake, try this instead.
pip install zeroc-ice
This should do the correct job.
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.