Cannot install and upgrade python packages on Ubuntu 14.04 - python

I am trying to install some python packages but I am getting this kind of error every time.
The directory '/home/username/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/username/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 209, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 317, in run
requirement_set.prepare_files(finder)
File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 360, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 512, in _prepare_file
finder, self.upgrade, require_hashes)
File "/usr/lib/python2.7/dist-packages/pip/req/req_install.py", line 273, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 442, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 400, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 545, in _get_pages
page = self._get_page(location)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 648, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 757, in get_page
"Cache-Control": "max-age=600",
File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 480, in get
return self.request('GET', url, **kwargs)
File "/usr/lib/python2.7/dist-packages/pip/download.py", line 378, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 468, in request
resp = self.send(prep, **send_kwargs)
File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 576, in send
r = adapter.send(request, **kwargs)
File "/usr/share/python-wheels/CacheControl-0.11.5-py2.py3-none-any.whl/cachecontrol/adapter.py", line 46, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/adapters.py", line 376, in send
timeout=timeout
File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 610, in urlopen
_stacktrace=sys.exc_info()[2])
File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/util/retry.py", line 228, in increment
total -= 1
TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'
I looked it up on this site and Stack Overflow and all the solutions suggest installing
wheel
or
setuptools
But I am getting
Requirement already satisfied
The same problem occurs for trying to upgrade python packages.
Some of the commands that give me this error are:
sudo pip install -U textblob
My pip version is pip 8.1.1
What should I do?

Try, as suggested by the error message, running:
sudo -H pip install -U textblob
It is also well worth making sure that your version of pip is up to date with:
sudo python -m pip install -U pip
or
sudo -H python -m pip install -U pip

This happens to me frequently. Try this:
pip install textblob --user
This will work fine with other packages as well.
Thanks !

Related

ImportError: No module named dash

I am unable to install dash in production server. In local, I have imported by
pip install dash==0.29.0
But in prod it is not working. When i am using
sudo apt-get install python dash
its showing
> "dash is already the newest version (0.5.8-2.4)"
, however while using import dash am getting
> "ImportError: No module named dash"
have also tried
sudo pip install python dash==0.29.0
but it gives below error:
Requirement already satisfied: python in /usr/lib/python2.7/lib-dynload
Collecting dash==0.29.0
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 353, in run
wb.build(autobuilding=True)
File "/usr/lib/python2.7/dist-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 554, in _prepare_file
require_hashes
File "/usr/lib/python2.7/dist-packages/pip/req/req_install.py", line 278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 568, in _get_pages
page = self._get_page(location)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 792, in get_page
"Cache-Control": "max-age=600",
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 501, in get
return self.request('GET', url, **kwargs)
File "/usr/lib/python2.7/dist-packages/pip/download.py", line 386, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 488, in request
resp = self.send(prep, **send_kwargs)
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 609, in send
r = adapter.send(request, **kwargs)
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py", line 47, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/adapters.py", line 423, in send
timeout=timeout
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 643, in urlopen
_stacktrace=sys.exc_info()[2])
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/util/retry.py", line 315, in increment
total -= 1
TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'
The command sudo apt-get install python dash installs the system package python (correct) and the system package dash (incorrect), which is a linux shell.
After installing Python with sudo apt-get install python, to install the python package dash, you need to do sudo pip install dash==0.29.0 or sudo python -m pip install dash==0.29.0.
From what I can tell - and I am extremely green - it appears that python / environments scan for modules by filename in the appropriate "site packages" directory. I had installed Dash via command prompt for my system python and then also via the anaconda command prompt.
When I would try to import dash in Spyder through anaconda, I got this same error. I was able to fix the issue by renaming the folder that contained the init file from dash_rendered to just dash.
It would appear that then when Spyder scanned it's packages, it could identify the correct directory.
I had no trouble installing dash to python generally with the command provided from Plotly in the command line.
pip install dash==1.7.0
I can see this was a year ago and that Dash has changed a bit since then - but hopefully this helps future users whose environments aren't recognizing the module as "dash" without renaming, as in Spyder.
I had the same problem, I solved it running pip install dash on conda terminal (if you are using Anaconda).
Create a virtual environment:
virtualenv venv # creates a virtualenv called "venv"
source venv/bin/activate # uses the virtualenv
and then pip install dash
If you are using Jupyter notebook or Jupyter Lab, try to install jupyter-dash by:
pip install jupyter-dash
in the code:
from jupyter_dash import JupyterDash
pd.options.plotting.backend = "plotly"
file>NewProjectsSetup>Preferencesfornewprojects>PythonInterpreter> click on + symbol to search for packages, search for dash, install the package and you should be fine.

python pip install failures

i am trying to install a library pynput using
sudo pip install pynput
but i am getting this error log. This has been happening with any other python package. everything used to work fine suddenly these errors are appearing i tried to copy error log from
~/.pip/pip.log
and this is what i have:
Using version 1.4 (newest of versions: 1.4, 1.3.10, 1.3.9, 1.3.8.1, 1.3.7, 1.3.6, 1.3.5, 1.3.4, 1.3.3, 1.3.2, 1.3.1, 1.3, 1.2, 1.1.7, 1.1.6, 1.1.5, 1.1.4, 1.1.3, 1.1.2, 1.1.1, 1.1, 1.0.6, 1.0.5, 1.0.4, 1.0.3, 1.0.2, 1.0.1, 1.0, 0.6, 0.5.1, 0.5, 0.4, 0.3, 0.2)
Cleaning up...
Removing temporary dir /tmp/pip_build_root...
Exception:
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 278, 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 1198, in prepare_files
do_download,
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1376, in unpack_url
self.session,
File "/usr/lib/python2.7/dist-packages/pip/download.py", line 546, in unpack_http_url
resp = session.get(target_url, stream=True)
File "/usr/share/python-wheels/requests-2.2.1-py2.py3-none-any.whl/requests/sessions.py", line 467, in get
return self.request('GET', url, **kwargs)
File "/usr/lib/python2.7/dist-packages/pip/download.py", line 237, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/usr/share/python-wheels/requests-2.2.1-py2.py3-none-any.whl/requests/sessions.py", line 455, in request
resp = self.send(prep, **send_kwargs)
File "/usr/share/python-wheels/requests-2.2.1-py2.py3-none-any.whl/requests/sessions.py", line 558, in send
r = adapter.send(request, **kwargs)
File "/usr/share/python-wheels/requests-2.2.1-py2.py3-none-any.whl/requests/adapters.py", line 330, in send
timeout=timeout
File "/usr/share/python-wheels/urllib3-1.7.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 562, in urlopen
body=body, headers=headers)
File "/usr/share/python-wheels/urllib3-1.7.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 387, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/lib/python2.7/httplib.py", line 1017, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python2.7/httplib.py", line 1051, in _send_request
self.endheaders(body)
File "/usr/lib/python2.7/httplib.py", line 1013, in endheaders
self._send_output(message_body)
File "/usr/lib/python2.7/httplib.py", line 864, in _send_output
self.send(msg)
File "/usr/lib/python2.7/httplib.py", line 826, in send
self.connect()
File "/usr/share/python-wheels/urllib3-1.7.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 145, in connect
match_hostname(self.sock.getpeercert(),
File "/usr/share/python-wheels/urllib3-1.7.1-py2.py3-none-any.whl/urllib3/contrib/pyopenssl.py", line 313, in getpeercert
for value in get_subj_alt_name(x509)
File "/usr/share/python-wheels/urllib3-1.7.1-py2.py3-none-any.whl/urllib3/contrib/pyopenssl.py", line 94, in get_subj_alt_name
asn1Spec=general_names)
File "/usr/local/lib/python2.7/dist-packages/pyasn1/codec/ber/decoder.py", line 825, in __call__
stGetValueDecoder, self, substrateFun
File "/usr/local/lib/python2.7/dist-packages/pyasn1/codec/ber/decoder.py", line 391, in valueDecoder
r.verifySizeSpec()
File "/usr/local/lib/python2.7/dist-packages/pyasn1/type/base.py", line 252, in verifySizeSpec
def verifySizeSpec(self): self._sizeSpec(self)
File "/usr/local/lib/python2.7/dist-packages/pyasn1/type/constraint.py", line 32, in __call__
'%s failed at: \"%s\"' % (self, sys.exc_info()[1])
ValueConstraintError: ConstraintsIntersection(ConstraintsIntersection(), ValueSizeConstraint(1, 64)) failed at: "ValueSizeConstraint(1, 64) failed at: "SubjectAltName().setComponents(GeneralName(componentType=NamedTypes(NamedType('otherName', AnotherName(componentType=NamedTypes(NamedType('type-id', ObjectIdentifier('<no value>')), NamedType('value', ...........
A similar issue exists here.
The problem seems to be that the PyPI certificate now has more than 64 SAN names on it, breaking the hardcoded maximum in older versions of requests.
Make sure you have recent versions of both the requests and urllib3 modules.
You need to update pip. Just enter this command
curl https://bootstrap.pypa.io/get-pip.py | sudo python
After update bash -l
That's it.
I got it working by.
removing requests, urllib manually from
/usr/local/lib/python2.7/dist-packages
and reinstalling requests with sudo easy_install requests
then sudo easy_install pip==9.0.1
Try updating pip using
sudo -H pip2 install --upgrade pip
command.
Below solution worked for me.
Uninstall pip2
Install pip2 using PyPI (Refer 'Install pip From PyPI' section in https://www.howtodojo.com/2016/03/install-use-pip-ubuntu-14-04/)
Note: Install from ubuntu repository didn't work in my case.
Then I no longer got ValueConstraintError while installing any module using pip2 (ex: pip2 install invoke)

How to completely remove and install again PIP on MacOS Sierra (10.x)?

Had PIP working normally until few days ago.
Not sure how.
Trying to run it now and now show issues.
Adding full stack bellow of the error:
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/site-packages/pip/commands/install.py", line 335, in run
wb.build(autobuilding=True)
File "/usr/local/lib/python2.7/site-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/local/lib/python2.7/site-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/local/lib/python2.7/site-packages/pip/req/req_set.py", line 487, in _prepare_file
req_to_install, finder)
File "/usr/local/lib/python2.7/site-packages/pip/req/req_set.py", line 428, in _check_skip_installed
req_to_install, upgrade_allowed)
File "/usr/local/lib/python2.7/site-packages/pip/index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/usr/local/lib/python2.7/site-packages/pip/index.py", line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/usr/local/lib/python2.7/site-packages/pip/index.py", line 568, in _get_pages
page = self._get_page(location)
File "/usr/local/lib/python2.7/site-packages/pip/index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "/usr/local/lib/python2.7/site-packages/pip/index.py", line 792, in get_page
"Cache-Control": "max-age=600",
File "/usr/local/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py", line 488, in get
return self.request('GET', url, **kwargs)
File "/usr/local/lib/python2.7/site-packages/pip/download.py", line 386, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py", line 475, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py", line 596, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python2.7/site-packages/pip/_vendor/cachecontrol/adapter.py", line 47, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "/usr/local/lib/python2.7/site-packages/pip/_vendor/requests/adapters.py", line 390, in send
conn = self.get_connection(request.url, proxies)
File "/usr/local/lib/python2.7/site-packages/pip/_vendor/requests/adapters.py", line 290, in get_connection
proxy_manager = self.proxy_manager_for(proxy)
File "/usr/local/lib/python2.7/site-packages/pip/_vendor/requests/adapters.py", line 194, in proxy_manager_for
**proxy_kwargs)
File "/usr/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/poolmanager.py", line 367, in proxy_from_url
return ProxyManager(proxy_url=url, **kw)
File "/usr/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/poolmanager.py", line 312, in __init__
proxy = parse_url(proxy_url)
File "/usr/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/url.py", line 189, in parse_url
raise LocationParseError(url)
LocationParseError: Failed to parse: user:pass
Want to try to reinstall pip completely.
What is recommended way to do it?
Your pip and Python installations are fine. What's wrong is your proxy configuration.
On OS X, both environment variables and the OS X network configuration can supply proxy information. First find out what configuration you have with:
python2.7 -c 'import urllib, pprint; pprint.pprint(urllib.getproxies())'
then look for any incorrect configuration in both your network settings (in the system configuration, check active networks for the proxies tab), and in your environment variables for *_proxy entries (http_proxy, https_proxy, etc.).
You can manually override proxies by setting one on the command line with the --proxy switch:
pip --proxy= install ...
Note the empty --proxy=; or you can set a specific proxy.
If you really did need to re-install your Python setup, you appear to have installed yours with Homebrew, so you can re-install it with brew install -f python#2.
Download Anaconda (or Miniconda), run it, and restart your terminal then start using environments.
to create an environment type
conda create -n my_project_name python=3.6
conda activate my_project_name
Now do all the pip installs and conda installs you want.
Your path is fixed. Pip is fixed. Go crazy.
Edit:
Now that you've posted your full traceback it looks like you need to feed the proxy a username and password. Here is one way to do it.
pip install --proxy=https://user#mydomain:port somepackage

Install packages using setuptools and pip.main

I'm trying to make a setup script for a python package. For an easy setup, I would like that all the dependencies be installed using setuptools. However, I found some difficulties when installing these packages this way: numpy, matplotlib, scipy, netcdf4, pandas and pymatgen. The numpy problem was already asked in this SO post, matplotlib here, pandas here and scipy here. So it seems it is a recurring problem though I have found a workaround for each of these packages which is to use pip in the setup script:
from setuptools import pip
import pip
for package in ("numpy", "matplotlib", "scipy", "netcdf4", "pandas",
"pymatgen"):
pip.main(["install", package])
setup(name="package_name",
...)
The problem is that when another package requires this package, the fact that pip is called to install the dependencies, setuptools raises a weird SandBoxViolation Error which prevent the use of the pip.main function.
Here's an example traceback:
Traceback (most recent call last):
File ".../lib/python3.6/site-packages/pip/basecommand.py", line 215,
in main
status = self.run(options, args)
File ".../lib/python3.6/site-packages/pip/commands/install.py", line 335, in run
wb.build(autobuilding=True)
File ".../lib/python3.6/site-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File ".../lib/python3.6/site-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File ".../lib/python3.6/site-packages/pip/req/req_set.py", line 554, in _prepare_file
require_hashes
File ".../lib/python3.6/site-packages/pip/req/req_install.py", line 278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File ".../lib/python3.6/site-packages/pip/index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File ".../lib/python3.6/site-packages/pip/index.py", line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File ".../lib/python3.6/site-packages/pip/index.py", line 568, in _get_pages
page = self._get_page(location)
File ".../lib/python3.6/site-packages/pip/index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File ".../lib/python3.6/site-packages/pip/index.py", line 792, in get_page
"Cache-Control": "max-age=600",
File ".../lib/python3.6/site-packages/pip/_vendor/requests/sessions.py", line 488, in get
return self.request('GET', url, **kwargs)
File ".../lib/python3.6/site-packages/pip/download.py", line 386, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File ".../lib/python3.6/site-packages/pip/_vendor/requests/sessions.py", line 475, in request
resp = self.send(prep, **send_kwargs)
File ".../lib/python3.6/site-packages/pip/_vendor/requests/sessions.py", line 596, in send
r = adapter.send(request, **kwargs)
File ".../lib/python3.6/site-packages/pip/_vendor/cachecontrol/adapter.py", line 37, in send
cached_response = self.controller.cached_request(request)
File ".../lib/python3.6/site-packages/pip/_vendor/cachecontrol/controller.py", line 202, in cached_request
self.cache.delete(cache_url)
File ".../lib/python3.6/site-packages/pip/download.py", line 302, in delete
return super(SafeFileCache, self).delete(*args, **kwargs)
File ".../lib/python3.6/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py", line 107, in delete
os.remove(name)
File ".../lib/python3.6/site-packages/setuptools/sandbox.py", line 314, in wrap
path = self._remap_input(name, path, *args, **kw)
File ".../lib/python3.6/site-packages/setuptools/sandbox.py", line 456, in _remap_input
self._violation(operation, os.path.realpath(path), *args, **kw)
File ".../lib/python3.6/site-packages/setuptools/sandbox.py", line 411, in _violation
raise SandboxViolation(operation, args, kw)
setuptools.sandbox.SandboxViolation: SandboxViolation:
remove('/.../Library/Caches/pip/http/8/f/4/a/1/8f4a19894a92f9
63886c9b755abcf90542da3c3c8283d3bebe3650b2',) {}
The package setup script has attempted to modify files on your system
that are not within the EasyInstall build area, and has been aborted.
This package cannot be safely installed by EasyInstall, and may not
support alternate installation locations even if you run its setup
script by hand. Please inform the package's author and the EasyInstall
maintainers to find out if a fix or workaround is available.
A workaround for this is to use the pip.main method for this package also...
So I conclude that the use of the pip.main function should be avoided but I don't know an easy way to install the problematic dependencies. So my question is: how should the problematic dependencies like numpy, scipy, pymatgen, etc. be handled in order to install them automatically (without pip, just with setuptools for instance)? If it is not possible to avoid the usage of pip, how should the package calling pip in it's setup should be installed (in order to avoid the SandboxViolation errors)?

Error using pip install, I can't install any package

I'm using Python 3.5 and I am trying to install some packages. I usually use conda and everything's fine when I do but some packages is not in the anaconda repository and so I then use pip (either pip or pip3).
For some reason I get this error when I try to install any package not installed:
$ pip3 install pyqt3d
Exception:
Traceback (most recent call last):
File "C:\Users\MonsterIguan\Anaconda3\lib\site- packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Users\MonsterIguan\Anaconda3\lib\site-packages\pip\commands\install.py", line 335, in run
wb.build(autobuilding=True)
File "C:\Users\MonsterIguan\Anaconda3\lib\site-packages\pip\wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "C:\Users\MonsterIguan\Anaconda3\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "C:\Users\MonsterIguan\Anaconda3\lib\site-packages\pip\req\req_set.py", line 487, in _prepare_file
req_to_install, finder)
File "C:\Users\MonsterIguan\Anaconda3\lib\site-packages\pip\req\req_set.py", line 428, in _check_skip_installed
req_to_install, upgrade_allowed)
File "C:\Users\MonsterIguan\Anaconda3\lib\site-packages\pip\index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "C:\Users\MonsterIguan\Anaconda3\lib\site-packages\pip\index.py", line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "C:\Users\MonsterIguan\Anaconda3\lib\site-packages\pip\index.py", line 568, in _get_pages
page = self._get_page(location)
File "C:\Users\MonsterIguan\Anaconda3\lib\site-packages\pip\index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "C:\Users\MonsterIguan\Anaconda3\lib\site-packages\pip\index.py", line 811, in get_page
inst = cls(resp.content, resp.url, resp.headers)
File "C:\Users\MonsterIguan\Anaconda3\lib\site-packages\pip\index.py", line 728, in __init__
self.parsed = html5lib.parse(
AttributeError: module 'pip._vendor.html5lib' has no attribute 'parse'
I've seen some post with the same question but with inconclusive solutions. I am unfamiliar with pip/pip3 and rather scared of messing it up if I try to uninstall and install again. I still would rather use command line to install packages than manually installing with a .zip folder.
(I tried both on cmd and git bash)
First update conda:
conda update conda
then update pip with conda:
conda update pip
As a rule of thumb. Always use conda first before trying pip. That usually helps.

Categories

Resources