DistributionNotFound error even though package is installed - python

I am getting pkg_resources.DistributionNotFound: nose>=1.3.4
error, but i get version 1.3.7 by running the command
pip show nose
Trace :
Traceback (most recent call last): File "/usr/bin/qweez", line 5, in
from pkg_resources import load_entry_point File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 2655, in
working_set.require(requires) File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 648, in
require
needed = self.resolve(parse_requirements(requirements)) File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 546, in
resolve
raise DistributionNotFound(req) pkg_resources.DistributionNotFound: nose>=1.3.4

Related

Tensorboard fails to Launch

Tensorboard fails to launch. I get the following error messages. Can somebody guide. I have reinstalled conda and Tensorflow multiple times. I also looked online for similar issues, have not found anything.
Python 3.7.4 and Tensforflow version 2.1
ERROR: Failed to launch TensorBoard (exited with 1).
Contents of stderr:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\Scripts\tensorboard-script.py", line 9, in
sys.exit(run_main())
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorboard\main.py", line 65, in run_main
default.get_plugins() + default.get_dynamic_plugins(),
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorboard\default.py", line 125, in get_dynamic_plugins
"tensorboard_plugins"
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorboard\default.py", line 124, in
for entry_point in pkg_resources.iter_entry_points(
File "C:\ProgramData\Anaconda3\lib\site-packages\pkg_resources_init_.py", line 2442, in load
self.require(*args, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\pkg_resources_init_.py", line 2465, in require
items = working_set.resolve(reqs, env, installer, extras=self.extras)
File "C:\ProgramData\Anaconda3\lib\site-packages\pkg_resources_init_.py", line 786, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'typing-extensions>=3.7.4; python_version < "3.8"' distribution was not found and is required by yarl
You need to install typing-extensions.

Certbox Error pkg_resources.UnknownExtra: requests 2.6.0 has no such extra feature 'security'

I get below error when i try to renew the certbot,
[root#ip-172-31-24-116 centos]# certbot renew --dry-run
Traceback (most recent call last):
File "/bin/certbot", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 3007, in <module>
working_set.require(__requires__)
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 728, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 631, in resolve
requirements.extend(dist.requires(req.extras)[::-1])
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2497, in requires
"%s has no such extra feature %r" % (self, ext)
pkg_resources.UnknownExtra: requests 2.6.0 has no such extra feature 'security'
Also, my PIP is broken
[root#ip-172-31-24-116 centos]# pip
bash: /usr/local/bin/pip: /usr/bin/python3: bad interpreter: No such file or directory
It's based on another directory
[root#ip-172-31-24-116 centos]# /usr/bin/pip --version
pip 8.1.2 from /usr/lib/python2.7/site-packages (python 2.7)

Cannot install python package in Git Bash

I'm trying to install a package from my company's internal artifactory storage. I'm getting 2 exceptions in Gitbash that I can't understand. When I run Pip Freeze I don't see the install package, so I don't believe it is already installed.
After reading the exceptions, I don't understand what's going on, is anyone familiar with this?
pip install --no-dependencies --user -i https://artifactory.cloud.company.com/artifactory/api/pypi/pypi-python-org/simple git+https://github.kdc.company.com/MandR/package.git
Looking in indexes: https://artifactory.cloud.company.com/artifactory/api/pypi/pypi-python-org/simple
Collecting git+https://github.kdc.company.com/MandR/package.git
Cloning https://github.kdc.company.com/MandR/package.git to c:\users\user_name\appdata\local\temp\pip-req-build-ptb41on4
Exception:
Traceback (most recent call last):
File "c:\users\user_name\appdata\local\continuum\anaconda3\lib\site-packages\pip\_internal\req\req_install.py", line 339, in check_if_exists
self.satisfied_by = pkg_resources.get_distribution(str(no_marker))
File "c:\users\user_name\appdata\local\continuum\anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 476, in get_distribution
dist = get_provider(dist)
File "c:\users\user_name\appdata\local\continuum\anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 352, in get_provider
return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
File "c:\users\user_name\appdata\local\continuum\anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 895, in require
needed = self.resolve(parse_requirements(requirements))
File "c:\users\user_name\appdata\local\continuum\anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 786, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pip._vendor.pkg_resources.ContextualVersionConflict: (tables 3.4.3 (c:\users\user_name\appdata\local\continuum\anaconda3\lib\site-packages), Requirement.parse('tables==3.2.0'), {'package'})
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\user_name\appdata\local\continuum\anaconda3\lib\site-packages\pip\_internal\cli\base_command.py", line 143, in main
status = self.run(options, args)
File "c:\users\user_name\appdata\local\continuum\anaconda3\lib\site-packages\pip\_internal\commands\install.py", line 318, in run
resolver.resolve(requirement_set)
File "c:\users\user_name\appdata\local\continuum\anaconda3\lib\site-packages\pip\_internal\resolve.py", line 102, in resolve
self._resolve_one(requirement_set, req)
File "c:\users\user_name\appdata\local\continuum\anaconda3\lib\site-packages\pip\_internal\resolve.py", line 256, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "c:\users\user_name\appdata\local\continuum\anaconda3\lib\site-packages\pip\_internal\resolve.py", line 221, in _get_abstract_dist_for
req.check_if_exists(self.use_user_site)
File "c:\users\user_name\appdata\local\continuum\anaconda3\lib\site-packages\pip\_internal\req\req_install.py", line 350, in check_if_exists
self.req.name
File "c:\users\user_name\appdata\local\continuum\anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 476, in get_distribution
dist = get_provider(dist)
File "c:\users\user_name\appdata\local\continuum\anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 352, in get_provider
return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
File "c:\users\user_name\appdata\local\continuum\anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 895, in require
needed = self.resolve(parse_requirements(requirements))
File "c:\users\user_name\appdata\local\continuum\anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 786, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pip._vendor.pkg_resources.ContextualVersionConflict: (tables 3.4.3 (c:\users\user_name\appdata\local\continuum\anaconda3\lib\site-packages), Requirement.parse('tables==3.2.0'), {'package'})
It looks like you have the wrong version of the tables package installed. Trying installing the required version with pip install tables==3.2.0.

Trying to run Scrapy

I am trying to run Scrapy and encountering the following error.
It seems that Scrapy can't find TheTwisted 10.0.0 - I've downloaded it but don't know where to place the folder. Thanks!
Traceback (most recent call last):
File "/usr/local/bin/scrapy", line 5, in
from pkg_resources import load_entry_point
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/init.py", line 3095, in
#_call_aside
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/init.py", line 3081, in _call_aside
f(*args, **kwargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/init.py", line 3108, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/init.py", line 658, in _build_master
ws.require(requires)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/init.py", line 959, in require
needed = self.resolve(parse_requirements(requirements))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/init.py", line 846, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'Twisted>=10.0.0' distribution was not found and is required by Scrapy
If using Linux, install Twisted by running pip install Twisted in terminal.
If Windows, the Twisted docs recommend pip install Twisted[windows_platform].
In both cases if you're using a virtual environment (recommended) make sure to install it inside the venv.

broken easy_install and pip after upgrading to OS X Mavericks

Upgraded to OS X 10.9 Mavericks and installed XCode, Command Line Tools, XQuartz, etc. Trying to run a pip install now, but it says that the distribution is not found:
Traceback (most recent call last):
File "/usr/local/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2603, in <module>
working_set.require(__requires__)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require
needed = self.resolve(parse_requirements(requirements))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 565, in resolve
raise DistributionNotFound(req) # XXX put more info here
pkg_resources.DistributionNotFound: pip==1.4.1
So I tried to install pip with an easy_install. Turns out that's borked too:
Traceback (most recent call last):
File "/usr/local/bin/easy_install", line 5, in <module>
from pkg_resources import load_entry_point
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2607, in <module>
parse_requirements(__requires__), Environment()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 565, in resolve
raise DistributionNotFound(req) # XXX put more info here
pkg_resources.DistributionNotFound: setuptools==1.1.6
So some of the other threads say to reinstall setuptools with a sudo python ez_setup.py. It seems to work fine:
Installed /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools-1.1.6-py2.7.egg
Processing dependencies for setuptools==1.1.6
Finished processing dependencies for setuptools==1.1.6
But when running the easy_install pip, the same pkg_resources.DistributionNotFound: setuptools==1.1.6 error occurs. Anyone else have this problem? Any ideas how to fix this?
Install easy_install:
Download ez_setup.py module from https://pypi.python.org/pypi/setuptools
$ cd path/to/ez_setup.py
$ python ez_setup.py
Install pip:
$ sudo easy_install pip
try sudo python -m easy_install pip
I ran into a similar problem with git-review.
$ git review -s
Traceback (most recent call last):
File "/usr/local/bin/git-review", line 11, in <module>
sys.exit(main())
File "/Library/Python/2.7/site-packages/git_review/cmd.py", line 1132, in main
(os.path.split(sys.argv[0])[-1], get_version()))
File "/Library/Python/2.7/site-packages/git_review/cmd.py", line 180, in get_version
provider = pkg_resources.get_provider(requirement)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 197, in get_provider
return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require
needed = self.resolve(parse_requirements(requirements))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 565, in resolve
raise DistributionNotFound(req) # XXX put more info here
pkg_resources.DistributionNotFound: git-review
The git-review team said it was a bug with pkg_resources that could be fixed with
sudo pip install --upgrade setuptools
This worked fine for me.

Categories

Resources