I'm seeing the following error when trying to run pip after having just installed, on MacOS:
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 584, in _build_master
ws.require(__requires__)
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 901, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 792, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (pip 20.1.1 (/usr/local/lib/python3.8/site-packages), Requirement.parse('pip==20.0.2'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/opt/python#3.8/bin/pip3", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3255, in <module>
def _initialize_master_working_set():
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3238, in _call_aside
f(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3267, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 586, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 599, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 787, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==20.0.2' distribution was not found and is required by the application
What should I do to correct that?
Maybe just reinstall Python, I had that issue and it worked for me. Another solution, that I didn't test is using this python file https://bootstrap.pypa.io/get-pip.py. You could also install it by brew or easy_install(I heard it will be deprecated)
Related
I'm trying to install and use Python 3.11 on ubuntu 20.04
At the moment I'm having problem with the 'pip3'
It was installed using the following command:
apt install python3-pip
when I execute the following command:
python3.11 -m pip --version
it shows correct output:
pip 23.0 from /home/myuser/.local/lib/python3.11/site-packages/pip (python 3.11)
however, when I try this: 'pip3 --version' - it returns an error:
/home/myuser/.local/lib/python3.11/site-packages/pkg_resources/__init__.py:123: PkgResourcesDeprecationWarning: 0.1.36ubuntu1 is an invalid version and will not be supported in a future release
warnings.warn(
/home/semyuel/.local/lib/python3.11/site-packages/pkg_resources/__init__.py:123: PkgResourcesDeprecationWarning: 0.23ubuntu1 is an invalid version and will not be supported in a future release
warnings.warn(
Traceback (most recent call last):
File "/home/semyuel/.local/lib/python3.11/site-packages/pkg_resources/__init__.py", line 581, in _build_master
ws.require(__requires__)
File "/home/semyuel/.local/lib/python3.11/site-packages/pkg_resources/__init__.py", line 909, in require
needed = self.resolve(parse_requirements(requirements))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/semyuel/.local/lib/python3.11/site-packages/pkg_resources/__init__.py", line 800, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (pip 23.0 (/home/semyuel/.local/lib/python3.11/site-packages), Requirement.parse('pip==20.0.2'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/pip3", line 6, in <module>
from pkg_resources import load_entry_point
File "/home/semyuel/.local/lib/python3.11/site-packages/pkg_resources/__init__.py", line 3259, in <module>
#_call_aside
^^^^^^^^^^^
File "/home/semyuel/.local/lib/python3.11/site-packages/pkg_resources/__init__.py", line 3234, in _call_aside
f(*args, **kwargs)
File "/home/semyuel/.local/lib/python3.11/site-packages/pkg_resources/__init__.py", line 3272, in _initialize_master_working_set
working_set = WorkingSet._build_master()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/semyuel/.local/lib/python3.11/site-packages/pkg_resources/__init__.py", line 583, in _build_master
return cls._build_from_requirements(__requires__)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/semyuel/.local/lib/python3.11/site-packages/pkg_resources/__init__.py", line 596, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/semyuel/.local/lib/python3.11/site-packages/pkg_resources/__init__.py", line 795, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==20.0.2' distribution was not found and is required by the application
File "/usr/bin/uvicorn", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3254, in <module>
def _initialize_master_working_set():
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3237, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3266, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 584, in _build_master
ws.require(__requires__)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 901, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 787, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'uvloop>=0.14.0' distribution was not found and is required by uvicorn
install this package fastapi-socketio.
your error is gone away.
this is basic packages requirement for fastapi run
bidict==0.21.3
click==7.1.2
fastapi==0.68.1
fastapi-socketio==0.0.8
h11==0.9.0
httptools==0.1.2
pydantic==1.8.2
python-engineio==4.2.1
python-socketio==5.4.0
starlette==0.14.2
typing-extensions==3.10.0.2
uvicorn==0.11.5
uvloop==0.16.0
websockets==8.1
You must add uvloop=* at your Pipfile, then install it with command pipenv install
install this package fastapi-socketio.
fastapi-socketio==0.0.8
your error is gone away.
check basic packages requirement for FASTAPI
bidict==0.21.3
click==7.1.2
fastapi==0.68.1
fastapi-socketio==0.0.8
h11==0.9.0
httptools==0.1.2
pydantic==1.8.2
python-engineio==4.2.1
python-socketio==5.4.0
starlette==0.14.2
typing-extensions==3.10.0.2
uvicorn==0.11.5
uvloop==0.16.0
websockets==8.1
I am trying to install "missinglink" using:
python -m pip install missinglink
However, I get the error:
Exception:
Traceback (most recent call last):
File "C:\Users\kntsaluba001\AppData\Local\Continuum\miniconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2851, in _dep_map
return self.__dep_map
File "C:\Users\kntsaluba001\AppData\Local\Continuum\miniconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2685, in __getattr__
raise AttributeError(attr)
AttributeError: _DistInfoDistribution__dep_map
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\kntsaluba001\AppData\Local\Continuum\miniconda3\lib\site-packages\pip\basecommand.py", line 209, in main
status = self.run(options, args)
File "C:\Users\kntsaluba001\AppData\Local\Continuum\miniconda3\lib\site-packages\pip\commands\install.py", line 310, in run
wb.build(autobuilding=True)
File "C:\Users\kntsaluba001\AppData\Local\Continuum\miniconda3\lib\site-packages\pip\wheel.py", line 748, in build
self.requirement_set.prepare_files(self.finder)
File "C:\Users\kntsaluba001\AppData\Local\Continuum\miniconda3\lib\site-packages\pip\req\req_set.py", line 360, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "C:\Users\kntsaluba001\AppData\Local\Continuum\miniconda3\lib\site-packages\pip\req\req_set.py", line 647, in _prepare_file
set(req_to_install.extras) - set(dist.extras)
File "C:\Users\kntsaluba001\AppData\Local\Continuum\miniconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2810, in extras
return [dep for dep in self._dep_map if dep]
File "C:\Users\kntsaluba001\AppData\Local\Continuum\miniconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2853, in _dep_map
self.__dep_map = self._compute_dependencies()
File "C:\Users\kntsaluba001\AppData\Local\Continuum\miniconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2877, in _compute_dependencies
parsed = next(parse_requirements(distvers))
File "C:\Users\kntsaluba001\AppData\Local\Continuum\miniconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2980, in parse_requirements
"version spec")
File "C:\Users\kntsaluba001\AppData\Local\Continuum\miniconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2956, in scan_list
raise RequirementParseError(msg, line, "at", line[p:])
pip._vendor.pkg_resources.RequirementParseError: Expected ',' or end-of-list in gitpython >=2.1.9<2.2 at <2.2
I tried uninstalling gitpython in an attempt to fix the issue, I thought that it would just be reinstalled since its a dependency however I still get the same issue.
Consider upgrading pip version. This should solve the issue
I wanted to install simplekml for python3. So I tried to install simplekml with the sudo python3 -m pip install simplekml command. But I am getting an error:
Collecting simplekml
Downloading https://files.pythonhosted.org/packages/a7/dd/a7628e278507d76b3708a81f60bb719af58ca0123cbee50094f7d90e560f/simplekml-1.3.0.zip (52kB)
100% |████████████████████████████████| 61kB 286kB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 11, in <module>
from setuptools.extern.six.moves import filterfalse, map
File "/usr/lib/python3/dist-packages/setuptools/extern/__init__.py", line 1, in <module>
from pkg_resources.extern import VendorImporter
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2927, in <module>
#_call_aside
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2913, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2952, in _initialize_master_working_set
add_activation_listener(lambda dist: dist.activate())
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 956, in subscribe
callback(dist)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2952, in <lambda>
add_activation_listener(lambda dist: dist.activate())
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2515, in activate
declare_namespace(pkg)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2097, in declare_namespace
_handle_ns(packageName, path_item)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2047, in _handle_ns
_rebuild_mod_path(path, packageName, module)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2066, in _rebuild_mod_path
orig_path.sort(key=position_in_sys_path)
AttributeError: '_NamespacePath' object has no attribute 'sort'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-o8a_7rsc/simplekml/
Actually, I don't know how to solve this problem. So, can anyone please help me why I am getting this error? And How to solve this error?
This looks like an old bug in the python setuptools module - https://github.com/pypa/setuptools/issues/885
You should update your setuptools and try again.
System info:
UBUNTU - 16.04
Python 2.7 (in global workspace)
Python 3.5.4 ( in virtual environment)
Description:
I have installed ROS in global workspace. And now am trying to use a virtual environment to work on it.
Running the command 'pip', I get this error :
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/_vendor/__init__.py", line 33, in vendored
__import__(vendored_name, globals(), locals(), level=0)
ImportError: No module named 'pip._vendor.pkg_resources'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/abhisek/anaconda2/envs/pytorch35/bin/pip", line 7, in <module>
from pip._internal import main
File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 13, in <module>
from pip.exceptions import InstallationError, CommandError, PipError
File "/usr/lib/python2.7/dist-packages/pip/exceptions.py", line 6, in <module>
from pip._vendor.six import iteritems
File "/usr/lib/python2.7/dist-packages/pip/_vendor/__init__.py", line 75, in <module>
vendored("pkg_resources")
File "/usr/lib/python2.7/dist-packages/pip/_vendor/__init__.py", line 36, in vendored
__import__(modulename, globals(), locals(), level=0)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2927, in <module>
#_call_aside
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2913, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2952, in _initialize_master_working_set
add_activation_listener(lambda dist: dist.activate())
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 956, in subscribe
callback(dist)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2952, in <lambda>
add_activation_listener(lambda dist: dist.activate())
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2515, in activate
declare_namespace(pkg)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2097, in declare_namespace
_handle_ns(packageName, path_item)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2047, in _handle_ns
_rebuild_mod_path(path, packageName, module)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2066, in _rebuild_mod_path
orig_path.sort(key=position_in_sys_path)
AttributeError: '_NamespacePath' object has no attribute 'sort'
I have tried upgrading setuptools and pip but of no help.
One thing I notice is that int the traceback it keeps on pointing to /usr/lib/python2.7/dist-packages/pip. But I dont know how to make things correct.