I am still a bit new to Python, and when installing various Python packages, I get an error
AttributeError: module 'X' has no attribute 'Y', where X and Y are specific to that package. Most packages install without issues, but some are giving me this error. I have Python 3.8 installed on my Windows 10 64-bit, and, for example, when I try to install this package, I get this error:
C:\WINDOWS\system32>pip install micropython-warnings
Collecting micropython-warnings
Using cached micropython-warnings-0.1.1.tar.gz (630 bytes)
ERROR: Command errored out with exit status 1:
command: 'c:\users\justinas\appdata\local\programs\python\python38-32\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Justinas\\AppData\\Local\\Temp\\pip-install-1aq8t49t\\micropython-warnings\\setup.py'"'"'; __file__='"'"'C:\\Users\\Justinas\\AppData\\Local\\Temp\\pip-install-1aq8t49t\\micropython-warnings\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Justinas\AppData\Local\Temp\pip-pip-egg-info-1od9eu5k'
cwd: C:\Users\Justinas\AppData\Local\Temp\pip-install-1aq8t49t\micropython-warnings\
Complete output (9 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\justinas\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\__init__.py", line 17, in <module>
import setuptools.version
File "c:\users\justinas\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\version.py", line 1, in <module>
import pkg_resources
File "c:\users\justinas\appdata\local\programs\python\python38-32\lib\site-packages\pkg_resources\__init__.py", line 3240, in <module>
warnings.filterwarnings("ignore", category=PEP440Warning, append=True)
AttributeError: module 'warnings' has no attribute 'filterwarnings'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
And this is quite common with lots of packages. How exactly do I fix this?
Related
I am pretty new with python and programming. I started using the turtle library but when I installed the library with pip, this error showed:
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-sr9ppuq0/turtle/setup.py'"'"'; __file__='"'"'/tmp/pip-install-sr9ppuq0/turtle/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-sr9ppuq0/turtle/pip-egg-info
cwd: /tmp/pip-install-sr9ppuq0/turtle/
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-sr9ppuq0/turtle/setup.py", line 40
except ValueError, ve:
^
SyntaxError: invalid syntax
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
When I imported the python library, I got this error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.8/turtle.py", line 107, in <module>
import tkinter as TK
ModuleNotFoundError: No module named 'tkinter'
please help. And I am also on a linux system.
Have you tried python -m pip install PythonTurtle, i think that's the newest installation name
sudo pip install MySQL-python
Collecting MySQL-python
Using cached MySQL-python-1.2.5.zip (108 kB)
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-4dq45q4u/MySQL-python/setup.py'"'"'; __file__='"'"'/tmp/pip-install-4dq45q4u/MySQL-python/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-4dq45q4u/MySQL-python/pip-egg-info
cwd: /tmp/pip-install-4dq45q4u/MySQL-python/
Complete output (7 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-4dq45q4u/MySQL-python/setup.py", line 13, in <module>
from setup_posix import get_config
File "/tmp/pip-install-4dq45q4u/MySQL-python/setup_posix.py", line 2, in <module>
from ConfigParser import SafeConfigParser
ModuleNotFoundError: No module named 'ConfigParser'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
neosoft#neosoft:~$ ^C
Your problem is here:
No module named 'ConfigParser'
That module was renamed configparserin Python 3. So it appears you are trying to install the Python 2 version of mysql in a Python 3 environment.
i am getting the following error when i run the command pip install -e geonode. I am in the process of installing geonode. I am using window 10.
ERROR: Command errored out with exit status 1:
command: 'C:\Users\eidulameen.sh\Documents\geonode_env\Scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\eidulameen.sh\\AppData\\Local\\Temp\\pip-install-wk7ukb8e\\uwsgi_17dc79202ede4643a13c8c5233dc91cc\\setup.py'"'"'; __file__='"'"'C:\\Users\\eidulameen.sh\\AppData\\Local\\Temp\\pip-install-wk7ukb8e\\uwsgi_17dc79202ede4643a13c8c5233dc91cc\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\eidulameen.sh\AppData\Local\Temp\pip-pip-egg-info-71v4l6zx'
cwd: C:\Users\eidulameen.sh\AppData\Local\Temp\pip-install-wk7ukb8e\uwsgi_17dc79202ede4643a13c8c5233dc91cc\
Complete output (7 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\eidulameen.sh\AppData\Local\Temp\pip-install-wk7ukb8e\uwsgi_17dc79202ede4643a13c8c5233dc91cc\setup.py", line 3, in <module>
import uwsgiconfig as uc
File "C:\Users\eidulameen.sh\AppData\Local\Temp\pip-install-wk7ukb8e\uwsgi_17dc79202ede4643a13c8c5233dc91cc\uwsgiconfig.py", line 8, in <module>
uwsgi_os = os.uname()[0]
AttributeError: module 'os' has no attribute 'uname'
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/c7/75/45234f7b441c59b1eefd31ba3d1041a7e3c89602af24488e2a22e11e7259/uWSGI-2.0.19.1.tar.gz#sha256=faa85e053c0b1be4d5585b0858d3a511d2cd10201802e8676060fd0a109e5869 (from https://pypi.org/simple/uwsgi/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement uWSGI==2.0.19.1 (from geonode)
ERROR: No matching distribution found for uWSGI==2.0.19.1
Any ideas how to solve the issue. Thank you in advance.
The issue is related to these production and tests packages in requirements.txt and setup.cfg as they should run in a Linux environment not Windows.
If you try to comment them, the issue will not appear.
Also, you may try the Cartoview Windows Installer. Cartoview is an extension of GeoNode visualizing the layers and maps in geospatial apps.
I am on Ubuntu and I tried to install djangorestframework-gis-distance
I followed the instructions and installed the dependencies which installed fine.
But when I install djangorestframework-gis-distance it gives an error of
ERROR: Command errored out with exit status 1:
command: /home/aarush/git_fudo/food1_back/food1_back/env/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ntgn7sle/djangorestframework-gis-distance/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ntgn7sle/djangorestframework-gis-distance/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: /tmp/pip-install-ntgn7sle/djangorestframework-gis-distance/
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-ntgn7sle/djangorestframework-gis-distance/setup.py", line 9, in <module>
from pip.req import parse_requirements
ModuleNotFoundError: No module named 'pip.req'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Which basically says I think that there is no file called pip.req.
Is there another way I can install djangorestframework-gis-distance?
Lets see: https://pypi.org/project/djangorestframework-gis-distance/ . Latest version 1.0.0 released Feb 7, 2016.
Requires Python 2.7 but not 3+. Django 1.7+ but most probably not Django 2+. The error message indicates setup.py uses forbidden API pip.req which was only available in pip < 19 (IIRC).
The bottom line: the package is abandoned and outdated. Forget about it.
I am trying to install coco-0.4.0.tar.gz in python through pip install, but I'm getting this error:
ERROR: Command errored out with exit status 1:
command: 'C:\Users\brene\anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\brene\\AppData\\Local\\Temp\\pip-install-wbchu6pa\\coco\\setup.py'"'"'; __file__='"'"'C:\\Users\\brene\\AppData\\Local\\Temp\\pip-install-wbchu6pa\\coco\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\brene\AppData\Local\Temp\pip-install-wbchu6pa\coco\pip-egg-info'
cwd: C:\Users\brene\AppData\Local\Temp\pip-install-wbchu6pa\coco\
Complete output (7 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\brene\AppData\Local\Temp\pip-install-wbchu6pa\coco\setup.py", line 9, in <module>
import coco
File "C:\Users\brene\AppData\Local\Temp\pip-install-wbchu6pa\coco\coco.py", line 18, in <module>
from docopt import docopt
ModuleNotFoundError: No module named 'docopt'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
coco 0.4.0, the last release was at Jan 5, 2013. The package announces compatibility with Python 2.6 and 2.7.
setup.py imports module coco (from the file coco.py) which imports docopt without installing it.
My resolution is: the package is buggy, old, outdated and abandoned. Not recommended for any use.
If you want to try it anyway — first install docopt:
pip install docopt