I'm trying to install a package using python setup.py build, but it fails when it cannot find setuptools.version. In fact:
import setuptools
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/gpajer/anaconda/lib/python2.7/site- packages/setuptools/__init__.py", line 11, in <module>
import setuptools.version
ImportError: No module named version
Shouldn't there be a file .../anaconda/lib/python2.7/site-packages/setuptools/version.py? There is no such file. Any ideas?
From https://anaconda.org/anaconda/setuptools:
To install this package with conda run:
conda install -c anaconda setuptools=21.2.1
Related
The error message is:
(base) PS C:\Users\15257> pip --version
Traceback (most recent call last):
File "D:\Anaconda\Scripts\pip-script.py", line 6, in <module>
from pip._internal.cli.main import main
ModuleNotFoundError: No module named 'pip._internal.cli.main'
(base) PS C:\Users\15257> pip3 --version
Traceback (most recent call last):
File "D:\Anaconda\Scripts\pip3-script.py", line 6, in <module>
from pip._internal.cli.main import main
ModuleNotFoundError: No module named 'pip._internal.cli.main'
I tried to reinstall PIP, but it didn't work.
After I reinstall anaconda, pip works fine in the base environment, but after creating a new environment, pip does not work.
(base) PS C:\Users\15257> pip --version
pip 21.0.1 from D:\Anaconda3\lib\site-packages\pip (python 3.8)
(paddle_env) PS C:\Users\15257> pip --version
Traceback (most recent call last):
File "D:\Anaconda3\envs\paddle_env\Scripts\pip-script.py", line
6, in <module>
from pip._internal.cli.main import main
ModuleNotFoundError: No module named 'pip._internal.cli.main'
I'm getting below error:
Traceback (most recent call last):
File "TicketGeneration_test.py", line 6, in <module>
from MysqlConnection import SQLConnection
File "/Users/ashish.kumar/MerchantRisk/June5th/reports/MysqlConnection.py", line 1, in <module>
import MySQLdb
ImportError: No module named MySQLdb
I've already tried :
pip install MySQL-python
pip install mysqlclient
My python version is Python 2.7.16
I seem to have messed up my python install. I can't install new python packages:
$ pip install arq
Traceback (most recent call last):
File "/usr/local/bin/pip", line 6, in <module>
from pkg_resources import load_entry_point
File "/Users/me/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 48, in <module>
import six
ImportError: No module named six
And trying to address this error directly gives the same error:
$ pip install six
Traceback (most recent call last):
File "/usr/local/bin/pip", line 6, in <module>
from pkg_resources import load_entry_point
File "/Users/me/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 48, in <module>
import six
ImportError: No module named six
I'm not really sure what to do. All pip operations seem to fail for the same reason. pip freeze and just pip give the same result.
I'm on osx.
This is inspired by #Christian Dean's comment. But I am on OSX so what I did was to just reinstall pip from here:
http://pip.readthedocs.io/en/stable/installing/
I had python pip installed and it was working fine but I did something wrong now it is broken.
Now when I execute pip command to install new packages, I get an error.
like if execute pip list then I get the below error.
root#dragonwarrior-Latitude-3440:~# pip list
Traceback (most recent call last):
File "/usr/local/bin/pip", line 7, in <module>
from pip import main
File "/usr/local/lib/python2.7/dist-packages/pip/__init__.py", line 4, >in <module>
import locale
File "/usr/lib/python2.7/locale.py", line 15, in <module>
import encodings
ImportError: No module named encodings
In my root project folder I have created a virtual environment for python 3.4 using the following commands:
$ virtualenv -p /Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4 venv
$ source venv/bin/activate
Now I would like to install some packages with pip only for this project and I do:
$ venv/bin/pip install html
And I get the following error (full traceback except I have replaced path with '...'):
Collecting html
Using cached html-1.16.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 2218, in _find_and_load_unlocked
AttributeError: 'module' object has no attribute '__path__'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 3, in <module>
File ".../venv/lib/python3.4/site-packages/setuptools/__init__.py", line 11, in <module>
from setuptools.extension import Extension
File ".../venv/lib/python3.4/site-packages/setuptools/extension.py", line 8, in <module>
from .dist import _get_unpatched
File ".../venv/lib/python3.4/site-packages/setuptools/dist.py", line 16, in <module>
from setuptools.depends import Require
File ".../venv/lib/python3.4/site-packages/setuptools/depends.py", line 6, in <module>
from setuptools import compat
File ".../venv/lib/python3.4/site-packages/setuptools/compat.py", line 44, in <module>
from html.entities import name2codepoint
ImportError: No module named 'html.entities'; 'html' is not a package
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/xz/15p_y6cn09bdc55vkvx6vrd80000gn/T/pip-build-lgl2qvpz/html
Note that I can install this package without problems globally for python 2.7.5 which is the default version on my mac.
The package I am trying to install is this one:
https://pypi.python.org/pypi/html/1.16
This package is obsolete not compatible with current packaging tools, its last release was more than 8 years ago. I really doubt that packages published so long time ago are still usable with recent python(s).