As the title says, I'm trying to install pylint with the below command:
pip install pylint
But I get the below exception:
Exception:
Traceback (most recent call last):
File "C:\Python34\lib\site-packages\pip\_vendor\pkg_resources.py", line 2482, in _dep_map
return self.__dep_map
File "C:\Python34\lib\site-packages\pip\_vendor\pkg_resources.py", line 2344, 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:\Python34\lib\site-packages\pip\basecommand.py", line 122, in main
status = self.run(options, args)
File "C:\Python34\lib\site-packages\pip\commands\install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "C:\Python34\lib\site-packages\pip\req.py", line 1265, in prepare_files
req_to_install.extras):
File "C:\Python34\lib\site-packages\pip\_vendor\pkg_resources.py", line 2291, in requires
dm = self._dep_map
File "C:\Python34\lib\site-packages\pip\_vendor\pkg_resources.py", line 2484, in _dep_map
self.__dep_map = self._compute_dependencies()
File "C:\Python34\lib\site-packages\pip\_vendor\pkg_resources.py", line 2508, in _compute_dependencies
parsed = next(parse_requirements(distvers))
File "C:\Python34\lib\site-packages\pip\_vendor\pkg_resources.py", line 2605, in parse_requirements
line, p, specs = scan_list(VERSION,LINE_END,line,p,(1,2),"version spec")
File "C:\Python34\lib\site-packages\pip\_vendor\pkg_resources.py", line 2583, in scan_list
"Expected ',' or end-of-list in",line,"at",line[p:]
ValueError: ("Expected ',' or end-of-list in", 'lazy-object-proxy ==1.4.*', 'at', '*')
Storing debug log for failure in C:\Users\Haiss\pip\pip.log
Anybody have any ideas what's causing it to fail? I have Python 3 installed using Anaconda. I checked the debug log but it doesn't provide any additional details.
try this:
easy_install --upgrade pip
Related
please excuse the repeated question but the answers from similar threads haven't resolved this issue
I have been using pip with no issues for 2-3 months now but after trying to pip install pyzmail I recieved an importlib._bootstrap error message which I cannot recreate anymore but his error message has now turned into
I am recieving this error message when simply typing the pip command
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 584, in _build_master
ws.require(__requires__)
File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 901, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python3.7/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 (/Users/conorladrigan/Library/Python/3.7/lib/python/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/libexec/bin/pip", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3261, in <module>
#_call_aside
File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3245, in _call_aside
f(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3274, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 586, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 599, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/local/lib/python3.7/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```
Thanks for any help
you can upgrade your pip version to the latest with
python -m pip install --upgrade pip
Here's the full error log -
C:\Dev\libpython\src>pipenv install
Creating a virtualenv for this project…
Pipfile: C:\Dev\libpython\src\Pipfile
Using C:/Python/Python36-64/python.exe (3.6.6) to create virtualenv…
Running virtualenv with interpreter C:/Python/Python36-64/python.exe
Using base prefix 'C:\\Python\\Python36-64'
New python executable in C:\Users\Pulkit\.virtualenvs\src-PtwTDfFP\Scripts\python.exe
Cannot find a wheel for pip
Installing setuptools, pip, wheel...
Complete output from command C:\Users\Pulkit\.vir...P\Scripts\python.exe - setuptools pip wheel:
Traceback (most recent call last):
File "<stdin>", line 8, in <module>
ModuleNotFoundError: No module named 'pip'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 11, in <module>
ModuleNotFoundError: No module named 'pip'
----------------------------------------
...Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
File "c:\python\python36-64\lib\site-packages\virtualenv.py", line 2343, in <module>
main()
File "c:\python\python36-64\lib\site-packages\virtualenv.py", line 712, in main
symlink=options.symlink)
File "c:\python\python36-64\lib\site-packages\virtualenv.py", line 947, in create_environment
download=download,
File "c:\python\python36-64\lib\site-packages\virtualenv.py", line 904, in install_wheel
call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
File "c:\python\python36-64\lib\site-packages\virtualenv.py", line 796, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command C:\Users\Pulkit\.vir...P\Scripts\python.exe - setuptools pip wheel failed with error code 1
Traceback (most recent call last):
File "c:\python\python36-64\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\python\python36-64\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Python\Python36-64\Scripts\pipenv.exe\__main__.py", line 9, in <module>
File "c:\python\python36-64\lib\site-packages\pipenv\vendor\click\core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "c:\python\python36-64\lib\site-packages\pipenv\vendor\click\core.py", line 717, in main
rv = self.invoke(ctx)
File "c:\python\python36-64\lib\site-packages\pipenv\vendor\click\core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "c:\python\python36-64\lib\site-packages\pipenv\vendor\click\core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "c:\python\python36-64\lib\site-packages\pipenv\vendor\click\core.py", line 555, in invoke
return callback(*args, **kwargs)
File "c:\python\python36-64\lib\site-packages\pipenv\vendor\click\decorators.py", line 64, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "c:\python\python36-64\lib\site-packages\pipenv\vendor\click\core.py", line 555, in invoke
return callback(*args, **kwargs)
File "c:\python\python36-64\lib\site-packages\pipenv\vendor\click\decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "c:\python\python36-64\lib\site-packages\pipenv\cli\command.py", line 249, in install
editable_packages=state.installstate.editables,
File "c:\python\python36-64\lib\site-packages\pipenv\core.py", line 1724, in do_install
pypi_mirror=pypi_mirror,
File "c:\python\python36-64\lib\site-packages\pipenv\core.py", line 565, in ensure_project
pypi_mirror=pypi_mirror,
File "c:\python\python36-64\lib\site-packages\pipenv\core.py", line 500, in ensure_virtualenv
python=python, site_packages=site_packages, pypi_mirror=pypi_mirror
File "c:\python\python36-64\lib\site-packages\pipenv\core.py", line 901, in do_create_virtualenv
click.echo(crayons.blue("{0}".format(c.err)), err=True)
File "c:\python\python36-64\lib\site-packages\pipenv\vendor\delegator.py", line 146, in err
return self._pexpect_out
File "c:\python\python36-64\lib\site-packages\pipenv\vendor\delegator.py", line 114, in _pexpect_out
result += self.subprocess.after
TypeError: must be str, not type
I have tried downgrading pip from (18.1 to 9.0.1) and also downgrading pipenv, it did not resolve the issue.
This stupid policy keeps telling to add more details, hence everything after this is only a filler.
I was so happy to publish my first package in pypa but then this stupid issue happened. I have wasted a lot of time already.
Manged to fix the issue temporarily by downgrading virtualenv -
pip install virtualenv==15.* --upgrade
When I was trying to install any packages using pip and pip3 I got below error:
Also tried to remove and reinstall pip, but got same error.any idea how to solve this.
Thanks in advance.
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 444, in _build_master
ws.require(__requires__)
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 725, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 632, in resolve
raise VersionConflict(dist,req) # XXX put more info here
pkg_resources.VersionConflict: (pip 9.0.1 (/usr/local/lib/python3.4/dist-packages), Requirement.parse('pip==1.5.4'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/pip3", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2749, in <module>
working_set = WorkingSet._build_master()
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 446, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 459, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 628, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: pip==1.5.4
I have a Scrapy spider written in python 3 and I want to run it as a cron job on my cloud Linux server (I have root access)
first, I couldn't install using pip3 install scrapy, I faced :
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.4/tarfile.py", line 1642, in bz2open
import bz2
File "/usr/local/lib/python3.4/bz2.py", line 20, in <module>
from _bz2 import BZ2Compressor, BZ2Decompressor
ImportError: No module named '_bz2'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.4/site-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/local/lib/python3.4/site-packages/pip/commands/install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/usr/local/lib/python3.4/site-packages/pip/req.py", line 1197, in prepare_files
do_download,
File "/usr/local/lib/python3.4/site-packages/pip/req.py", line 1375, in unpack_url
self.session,
File "/usr/local/lib/python3.4/site-packages/pip/download.py", line 582, in unpack_http_url
unpack_file(temp_location, location, content_type, link)
File "/usr/local/lib/python3.4/site-packages/pip/util.py", line 625, in unpack_file
untar_file(filename, location)
File "/usr/local/lib/python3.4/site-packages/pip/util.py", line 543, in untar_file
tar = tarfile.open(filename, mode)
File "/usr/local/lib/python3.4/tarfile.py", line 1567, in open
return func(name, filemode, fileobj, **kwargs)
File "/usr/local/lib/python3.4/tarfile.py", line 1644, in bz2open
raise CompressionError("bz2 module is not available")
tarfile.CompressionError: bz2 module is not available
then how can I run it as a cron job ?
I try to install distribute with python 3.3 on Ubuntu 12.04 to install pymongo.
I downloaded distribute_setup.py with
curl -O http://python-distribute.org/distribute_setup.py
Afterwards I tried
python3 distribute_setup.py install
But I recive
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.49.tar.gz
Traceback (most recent call last):
File "distribute_setup.py", line 556, in <module>
sys.exit(main())
File "distribute_setup.py", line 552, in main
tarball = download_setuptools(download_base=options.download_base)
File "distribute_setup.py", line 211, in download_setuptools
src = urlopen(url)
File "/usr/local/lib/python3.3/urllib/request.py", line 156, in urlopen
return opener.open(url, data, timeout)
File "/usr/local/lib/python3.3/urllib/request.py", line 475, in open
response = meth(req, response)
File "/usr/local/lib/python3.3/urllib/request.py", line 587, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/local/lib/python3.3/urllib/request.py", line 507, in error
result = self._call_chain(*args)
File "/usr/local/lib/python3.3/urllib/request.py", line 447, in _call_chain
result = func(*args)
File "/usr/local/lib/python3.3/urllib/request.py", line 692, in http_error_302
return self.parent.open(new, timeout=req.timeout)
File "/usr/local/lib/python3.3/urllib/request.py", line 469, in open
response = self._open(req, data)
File "/usr/local/lib/python3.3/urllib/request.py", line 492, in _open
'unknown_open', req)
File "/usr/local/lib/python3.3/urllib/request.py", line 447, in _call_chain
result = func(*args)
File "/usr/local/lib/python3.3/urllib/request.py", line 1310, in unknown_open
raise URLError('unknown url type: %s' % type)
urllib.error.URLError: <urlopen error unknown url type: https>
Can someone please help me? It seems as if distribute uses code, that does not compile with python 3.3..
I installed Python 3.3.2 in my homefolder following these steps:
./configure
make
make test
sudo make install
If I try to install pymongo from source I recive:
Extracting in /tmp/tmpth91z4
Traceback (most recent call last):
File "setup.py", line 22, in <module>
from setuptools import setup, Feature
ImportError: No module named 'setuptools'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/dev/pymongo/ez_setup.py", line 130, in use_setuptools
import pkg_resources
ImportError: No module named 'pkg_resources'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "setup.py", line 25, in <module>
use_setuptools()
File "/home/dev/pymongo/ez_setup.py", line 132, in use_setuptools
return _do_download(version, download_base, to_dir, download_delay)
File "/home/dev/pymongo/ez_setup.py", line 111, in _do_download
_build_egg(egg, tarball, to_dir)
File "/home/dev/pymongo/ez_setup.py", line 83, in _build_egg
tar = tarfile.open(tarball)
File "/usr/local/lib/python3.3/tarfile.py", line 1571, in open
raise ReadError("file could not be opened successfully")
tarfile.ReadError: file could not be opened successfully
Thank you
Are you sure you installed openssl-devel before compiling Python? I have had the same issue, however I fixed it by previously installing openssl-devel and then compiling Python 3 + distribute.