Fail to install virtualenvwrapper on MacOX Sierra with (sudo pip install virtualenvwrapper) - python

How can I resolve the error caused by installing by command: sudo pip install virtualenvwrapper?
Collecting virtualenvwrapper
Downloading virtualenvwrapper-4.7.2.tar.gz (90kB)
100% |████████████████████████████████| 92kB 18kB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/tmp/pip-build-Rhop8M/virtualenvwrapper/setup.py", line 7, in <module>
pbr=True,
File "/Applications/Canopy.app/appdata/canopy-1.6.2.3262.macosx-x86_64/Canopy.app/Contents/lib/python2.7/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "/Users/Extremeways/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/setuptools/dist.py", line 268, in __init__
self.fetch_build_eggs(attrs['setup_requires'])
File "/Users/Extremeways/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/setuptools/dist.py", line 312, in fetch_build_eggs
replace_conflicting=True,
File "/Users/Extremeways/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pkg_resources/__init__.py", line 846, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "/Users/Extremeways/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1091, in best_match
return self.obtain(req, installer)
File "/Users/Extremeways/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1103, in obtain
return installer(requirement)
File "/Users/Extremeways/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/setuptools/dist.py", line 379, in fetch_build_egg
return cmd.easy_install(req)
File "/Users/Extremeways/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 627, in easy_install
not self.always_copy, self.local_index
File "/Users/Extremeways/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/setuptools/package_index.py", line 601, in fetch_distribution
self.find_packages(requirement)
File "/Users/Extremeways/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/setuptools/package_index.py", line 438, in find_packages
self.scan_url(self.index_url + requirement.unsafe_name+'/')
File "/Users/Extremeways/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/setuptools/package_index.py", line 772, in scan_url
self.process_url(url, True)
File "/Users/Extremeways/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/setuptools/package_index.py", line 305, in process_url
f = self.open_url(url, "Download error on %s: %%s -- Some packages may not be found!" % url)
File "/Users/Extremeways/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/setuptools/package_index.py", line 711, in open_url
return open_with_auth(url, self.opener)
File "/Users/Extremeways/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/setuptools/package_index.py", line 905, in _socket_timeout
return func(*args, **kwargs)
File "/Users/Extremeways/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/setuptools/package_index.py", line 1003, in open_with_auth
cred = PyPIConfig().find_credential(url)
File "/Users/Extremeways/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/setuptools/package_index.py", line 959, in __init__
self.read(rc)
File "/Applications/Canopy.app/appdata/canopy-1.6.2.3262.macosx-x86_64/Canopy.app/Contents/lib/python2.7/ConfigParser.py", line 305, in read
self._read(fp, filename)
File "/Applications/Canopy.app/appdata/canopy-1.6.2.3262.macosx-x86_64/Canopy.app/Contents/lib/python2.7/ConfigParser.py", line 512, in _read
raise MissingSectionHeaderError(fpname, lineno, line)
ConfigParser.MissingSectionHeaderError: File contains no section headers.
file: /Users/Extremeways/.pypirc, line: 1
'index-servers=\n'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-Rhop8M/virtualenvwrapper/

Related

pip3 crashing with "start() missing 1 required positional argument: 'sessionID'"

MacOS 11.6, Python 3.9
This behavior is new. I probably used pip successfully a month or two ago. Since that time I have worked with brew, but nothing that should have messed with the installation of Python or pip themselves. Happens in response to any pip3 install command. Any clues?
% python3 -m pip install --upgrade pip
Requirement already satisfied: pip in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (22.2.2)
Collecting pip
Downloading pip-22.3.1-py3-none-any.whl (2.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0.0/2.1 MB ? eta -:--:--ERROR: Exception:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 167, in exc_logging_wrapper
status = run_func(*args)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/cli/req_command.py", line 247, in wrapper
return func(self, options, args)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/commands/install.py", line 369, in run
requirement_set = resolver.resolve(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 92, in resolve
result = self._result = resolver.resolve(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_vendor/resolvelib/resolvers.py", line 481, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_vendor/resolvelib/resolvers.py", line 348, in resolve
self._add_to_criteria(self.state.criteria, r, parent=None)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_vendor/resolvelib/resolvers.py", line 172, in _add_to_criteria
if not criterion.candidates:
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_vendor/resolvelib/structs.py", line 151, in __bool__
return bool(self._sequence)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 155, in __bool__
return any(self)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 143, in <genexpr>
return (c for c in iterator if id(c) not in self._incompatible_ids)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 97, in _iter_built_with_inserted
candidate = func()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 206, in _make_candidate_from_link
self._link_candidate_cache[link] = LinkCandidate(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 297, in __init__
super().__init__(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 162, in __init__
self.dist = self._prepare()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 231, in _prepare
dist = self._prepare_distribution()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 308, in _prepare_distribution
return preparer.prepare_linked_requirement(self._ireq, parallel_builds=True)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/operations/prepare.py", line 438, in prepare_linked_requirement
return self._prepare_linked_requirement(req, parallel_builds)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/operations/prepare.py", line 483, in _prepare_linked_requirement
local_file = unpack_url(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/operations/prepare.py", line 165, in unpack_url
file = get_http_url(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/operations/prepare.py", line 106, in get_http_url
from_path, content_type = download(link, temp_dir.path)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/network/download.py", line 147, in __call__
for chunk in chunks:
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/cli/progress_bars.py", line 52, in _rich_progress_bar
with progress:
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_vendor/rich/progress.py", line 1165, in __enter__
self.start()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_vendor/rich/progress.py", line 1156, in start
self.live.start(refresh=True)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_vendor/rich/live.py", line 132, in start
self._refresh_thread.start()
TypeError: start() missing 1 required positional argument: 'sessionID'
[notice] A new release of pip available: 22.2.2 -> 22.3.1
[notice] To update, run: pip install --upgrade pip

pip 20.3.4 (python 2.7): Command "python setup.py egg_info" failed with error code 1

I'm trying to install library on app built with python 2.7 but getting the same error:
pipenv install newrelic==5.22.1.152
Installing newrelic==5.22.1.152...
Adding newrelic to Pipfile's [packages]...
✔ Installation Succeeded
Pipfile.lock (3fb6a7) out of date, updating to (527437)...
Locking [dev-packages] dependencies...
✘ Locking Failed!
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/pipenv/resolver.py", line 126, in <module>
main()
File "/usr/local/lib/python2.7/site-packages/pipenv/resolver.py", line 119, in main
parsed.requirements_dir, parsed.packages)
File "/usr/local/lib/python2.7/site-packages/pipenv/resolver.py", line 85, in _main
requirements_dir=requirements_dir,
File "/usr/local/lib/python2.7/site-packages/pipenv/resolver.py", line 69, in resolve
req_dir=requirements_dir
File "/usr/local/lib/python2.7/site-packages/pipenv/utils.py", line 726, in resolve_deps
req_dir=req_dir,
File "/usr/local/lib/python2.7/site-packages/pipenv/utils.py", line 480, in actually_resolve_deps
resolved_tree = resolver.resolve()
File "/usr/local/lib/python2.7/site-packages/pipenv/utils.py", line 385, in resolve
results = self.resolver.resolve(max_rounds=environments.PIPENV_MAX_ROUNDS)
File "/usr/local/lib/python2.7/site-packages/pipenv/patched/piptools/resolver.py", line 102, in resolve
has_changed, best_matches = self._resolve_one_round()
File "/usr/local/lib/python2.7/site-packages/pipenv/patched/piptools/resolver.py", line 206, in _resolve_one_round
for dep in self._iter_dependencies(best_match):
File "/usr/local/lib/python2.7/site-packages/pipenv/patched/piptools/resolver.py", line 301, in _iter_dependencies
dependencies = self.repository.get_dependencies(ireq)
File "/usr/local/lib/python2.7/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 234, in get_dependencies
legacy_results = self.get_legacy_dependencies(ireq)
File "/usr/local/lib/python2.7/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 426, in get_legacy_dependencies
results, ireq = self.resolve_reqs(download_dir, ireq, wheel_cache)
File "/usr/local/lib/python2.7/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 297, in resolve_reqs
results = resolver._resolve_one(reqset, ireq)
File "/usr/local/lib/python2.7/site-packages/pipenv/patched/notpip/_internal/resolve.py", line 260, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "/usr/local/lib/python2.7/site-packages/pipenv/patched/notpip/_internal/resolve.py", line 213, in _get_abstract_dist_for
self.require_hashes
File "/usr/local/lib/python2.7/site-packages/pipenv/patched/notpip/_internal/operations/prepare.py", line 294, in prepare_linked_requirement
abstract_dist.prep_for_dist(finder, self.build_isolation)
File "/usr/local/lib/python2.7/site-packages/pipenv/patched/notpip/_internal/operations/prepare.py", line 127, in prep_for_dist
self.req.run_egg_info()
File "/usr/local/lib/python2.7/site-packages/pipenv/patched/notpip/_internal/req/req_install.py", line 474, in run_egg_info
command_desc='python setup.py egg_info')
File "/usr/local/lib/python2.7/site-packages/pipenv/patched/notpip/_internal/utils/misc.py", line 705, in call_subprocess
% (command_desc, proc.returncode, cwd))
pipenv.patched.notpip._internal.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in /tmp/tmpFSJ8cabuild/lazy-object-proxy/
File "/usr/local/lib/python2.7/site-packages/pipenv/resolver.py", line 126, in <module>
main()
File "/usr/local/lib/python2.7/site-packages/pipenv/resolver.py", line 119, in main
parsed.requirements_dir, parsed.packages)
File "/usr/local/lib/python2.7/site-packages/pipenv/resolver.py", line 85, in _main
requirements_dir=requirements_dir,
File "/usr/local/lib/python2.7/site-packages/pipenv/resolver.py", line 69, in resolve
req_dir=requirements_dir
File "/usr/local/lib/python2.7/site-packages/pipenv/utils.py", line 726, in resolve_deps
req_dir=req_dir,
File "/usr/local/lib/python2.7/site-packages/pipenv/utils.py", line 480, in actually_resolve_deps
resolved_tree = resolver.resolve()
File "/usr/local/lib/python2.7/site-packages/pipenv/utils.py", line 385, in resolve
results = self.resolver.resolve(max_rounds=environments.PIPENV_MAX_ROUNDS)
File "/usr/local/lib/python2.7/site-packages/pipenv/patched/piptools/resolver.py", line 102, in resolve
has_changed, best_matches = self._resolve_one_round()
File "/usr/local/lib/python2.7/site-packages/pipenv/patched/piptools/resolver.py", line 206, in _resolve_one_round
for dep in self._iter_dependencies(best_match):
File "/usr/local/lib/python2.7/site-packages/pipenv/patched/piptools/resolver.py", line 301, in _iter_dependencies
dependencies = self.repository.get_dependencies(ireq)
File "/usr/local/lib/python2.7/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 234, in get_dependencies
legacy_results = self.get_legacy_dependencies(ireq)
File "/usr/local/lib/python2.7/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 426, in get_legacy_dependencies
results, ireq = self.resolve_reqs(download_dir, ireq, wheel_cache)
File "/usr/local/lib/python2.7/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 297, in resolve_reqs
results = resolver._resolve_one(reqset, ireq)
File "/usr/local/lib/python2.7/site-packages/pipenv/patched/notpip/_internal/resolve.py", line 260, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "/usr/local/lib/python2.7/site-packages/pipenv/patched/notpip/_internal/resolve.py", line 213, in _get_abstract_dist_for
self.require_hashes
File "/usr/local/lib/python2.7/site-packages/pipenv/patched/notpip/_internal/operations/prepare.py", line 294, in prepare_linked_requirement
abstract_dist.prep_for_dist(finder, self.build_isolation)
File "/usr/local/lib/python2.7/site-packages/pipenv/patched/notpip/_internal/operations/prepare.py", line 127, in prep_for_dist
self.req.run_egg_info()
File "/usr/local/lib/python2.7/site-packages/pipenv/patched/notpip/_internal/req/req_install.py", line 474, in run_egg_info
command_desc='python setup.py egg_info')
File "/usr/local/lib/python2.7/site-packages/pipenv/patched/notpip/_internal/utils/misc.py", line 705, in call_subprocess
% (command_desc, proc.returncode, cwd))
pipenv.patched.notpip._internal.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in /tmp/tmpFSJ8cabuild/lazy-object-proxy/
I tried to update libraries:
pip install --upgrade setuptools -> Requirement already up-to-date:(44.1.1)
python -m pip install -U pip -> Requirement already up-to-date:(20.3.4)
pip install ez_setup -> Requirement already satisfied:(0.9)
Does it have something related to the fact, that the app is still using Python 2.7. Or we are still able to install libraries on this version? The last install library was phonenumbers 9 months ago and everything was fine since that time.

How do I solve error "dotenv installation error" on pycharm

I am trying to install dotenv package on pycharm edu,but keep getting error that reads "AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader' "
I tried to solve this using the python terminal by running command "pip install --user dotenv" as root user but still got the same error
command output reads as follows
Collecting dotenv
Using cached https://files.pythonhosted.org/packages/e2/46/3754073706e31670eed18bfa8a879305b56a471db15f20523c2427b10078/dotenv-0.0.5.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 154, in save_modules
yield saved
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 194, in setup_context
__import__('setuptools')
File "/tmp/easy_install-vzgpp8in/distribute-0.7.3/setuptools/__init__.py", line 2, in <module>
File "/tmp/easy_install-vzgpp8in/distribute-0.7.3/setuptools/extension.py", line 5, in <module>
File "/tmp/easy_install-vzgpp8in/distribute-0.7.3/setuptools/dist.py", line 7, in <module>
File "/tmp/easy_install-vzgpp8in/distribute-0.7.3/setuptools/command/__init__.py", line 8, in <module>
File "/tmp/easy_install-vzgpp8in/distribute-0.7.3/setuptools/command/install_scripts.py", line 3, in <module>
File "/tmp/easy_install-vzgpp8in/distribute-0.7.3/pkg_resources.py", line 1518, in <module>
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pycharm-packaging11/dotenv/setup.py", line 23, in <module>
scripts=['scripts/dotenv']
File "/usr/lib/python3.6/distutils/core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 269, in __init__
self.fetch_build_eggs(attrs['setup_requires'])
File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 313, in fetch_build_eggs
replace_conflicting=True,
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 826, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1092, in best_match
return self.obtain(req, installer)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1104, in obtain
return installer(requirement)
File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 380, in fetch_build_egg
return cmd.easy_install(req)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 663, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 693, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 873, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1101, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1087, in run_setup
run_setup(setup_script, args)
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 233, in run_setup
with setup_context(setup_dir):
File "/usr/lib/python3.6/contextlib.py", line 81, in __enter__
return next(self.gen)
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 195, in setup_context
yield
File "/usr/lib/python3.6/contextlib.py", line 99, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 166, in save_modules
saved_exc.resume()
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 141, in resume
six.reraise(type, exc, self._tb)
File "/usr/lib/python3/dist-packages/pkg_resources/_vendor/six.py", line 685, in reraise
raise value.with_traceback(tb)
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 154, in save_modules
yield saved
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 194, in setup_context
__import__('setuptools')
File "/tmp/easy_install-vzgpp8in/distribute-0.7.3/setuptools/__init__.py", line 2, in <module>
File "/tmp/easy_install-vzgpp8in/distribute-0.7.3/setuptools/extension.py", line 5, in <module>
File "/tmp/easy_install-vzgpp8in/distribute-0.7.3/setuptools/dist.py", line 7, in <module>
File "/tmp/easy_install-vzgpp8in/distribute-0.7.3/setuptools/command/__init__.py", line 8, in <module>
File "/tmp/easy_install-vzgpp8in/distribute-0.7.3/setuptools/command/install_scripts.py", line 3, in <module>
File "/tmp/easy_install-vzgpp8in/distribute-0.7.3/pkg_resources.py", line 1518, in <module>
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pycharm-packaging11/dotenv/"
Try installing "python-dotenv" package instead of "dotenv". This should solve the problem.
sudo pip install python-dotenv
Install python-dotenv and then import dotenv package instead of python-dotenv, because the latter doesn`t work

I can't pip install python sabyenc on raspbian linux

I can't pip install sabyenc and I need it for sabNZB to work. I googled a lot with no help at all.
Python version 2.7
pip version 1.5
Reaspbian Jessie
Below are the tracebacks from the log file
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip-build-oG_yk7/sabyenc/setup.py", line 56, in <module>
"""
File "/usr/lib/python2.7/distutils/core.py", line 111, in setup
setup_distribution = dist = klass(attrs)
File "/usr/local/lib/python2.7/dist-packages/setuptools/dist.py", line 320, in __init__
Distribution.__init__(self, attrs)
File "/usr/lib/python2.7/distutils/dist.py", line 287, in __init__
self.finalize_options()
File "/usr/local/lib/python2.7/dist-packages/setuptools/dist.py", line 386, in finalize_options
ep.require(installer=self.fetch_build_egg)
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2324, in require
items = working_set.resolve(reqs, env, installer, extras=self.extras)
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 859, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (appdirs 1.3.0 (/usr/lib/python2.7/dist-packages), Requirement.parse('appdirs>=1.4.0'))
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip-build-oG_yk7/sabyenc/setup.py", line 56, in <module>
"""
File "/usr/lib/python2.7/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "/usr/local/lib/python2.7/dist-packages/setuptools/dist.py", line 320, in __init__
_Distribution.__init__(self, attrs)
File "/usr/lib/python2.7/distutils/dist.py", line 287, in __init__
self.finalize_options()
File "/usr/local/lib/python2.7/dist-packages/setuptools/dist.py", line 386, in finalize_options
ep.require(installer=self.fetch_build_egg)
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2324, in require
items = working_set.resolve(reqs, env, installer, extras=self.extras)
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 859, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (appdirs 1.3.0 (/usr/lib/python2.7/dist-packages), Requirement.parse('appdirs>=1.4.0'))
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-oG_yk7/sabyenc
Exception information:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 290, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1230, in prepare_files
req_to_install.run_egg_info()
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 326, in run_egg_info
command_desc='python setup.py egg_info')
File "/usr/lib/python2.7/dist-packages/pip/util.py", line 716, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-oG_yk7/sabyenc
I had the exact same problem in Ubuntu. python-appdirs needs to be upgraded. If you have Ubunutu:
wget http://mirrors.kernel.org/ubuntu/pool/main/a/appdirs/python-appdirs_1.4.0-2_all.deb
sudo dpkg -i python-appdirs_1.4.0-2_all.deb

pip uninstall fails for egg package

My app is distributed as an .egg file. Users successfully install egg with easy_install
$ sudo easy_install abcdef-1.0.0-py2.7.egg
Unfortunately uninstallation fails:
$ sudo pip uninstall abcdef
Uninstalling abcdef-1.0.0:
/usr/local/lib/python2.7/dist-packages/abcdef-1.0.0-py2.7.egg
Proceed (y/n)? y
Successfully uninstalled abcdef-1.0.0
Traceback (most recent call last):
File "/usr/local/bin/pip", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/pip/__init__.py", line 233, in main
return command.main(cmd_args)
File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 252, in main
pip_version_check(session)
File "/usr/local/lib/python2.7/dist-packages/pip/utils/outdated.py", line 102, in pip_version_check
installed_version = get_installed_version("pip")
File "/usr/local/lib/python2.7/dist-packages/pip/utils/__init__.py", line 838, in get_installed_version
working_set = pkg_resources.WorkingSet()
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 644, in __init__
self.add_entry(entry)
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 700, in add_entry
for dist in find_distributions(entry, True):
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 1949, in find_eggs_in_zip
if metadata.has_metadata('PKG-INFO'):
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 1463, in has_metadata
return self.egg_info and self._has(self._fn(self.egg_info, name))
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 1823, in _has
return zip_path in self.zipinfo or zip_path in self._index()
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 1703, in zipinfo
return self._zip_manifests.load(self.loader.archive)
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 1643, in load
mtime = os.stat(path).st_mtime
OSError: [Errno 2] No such file or directory: '/usr/local/lib/python2.7/dist-packages/abcdef-1.0.0-py2.7.egg'
And console script is still present in /usr/local/bin/
$ abcdef
Traceback (most recent call last):
File "/usr/local/bin/abcdef", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3019, in <module>
#_call_aside
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3003, in _call_aside
f(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3032, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 655, in _build_master
ws.require(__requires__)
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 963, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 849, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'abcdef==1.0.0' distribution was not found and is required by the application
Here my setup.py
from setuptools import setup
setup(
name='abcdef',
version='1.0.0',
packages=['abcdef'],
entry_points={
'console_scripts': [
'abcdef = abcdef.abcdef:main',
],
},
)
How to fix it? Anything is missing in setup.py?
$pip --version
pip 9.0.1 from /usr/local/lib/python2.7/dist-packages (python 2.7)
$ python --version
Python 2.7.11+

Categories

Resources