简体   繁体   中英

pip cannot install module due to html5lib error

I am trying to set up a tensorflow environment in win7. I followed the instructions here and I guess I have installed tensorflow. I managed to run the small script in the previous link but only inside the console of Anaconda tensorflow environment. Since the windows' console is a bit primitive (to be polite) I would like to install Ipython. The problem is I am getting an error when trying to use pip . For example:

pip install pyreadline

gives this

Traceback (most recent call last): File "D:\\Software\\Anaconda3\\Scripts\\pip-script.py", line 6, in from pip import main File "D:\\Software\\Anaconda3\\lib\\site-packages\\pip__init__.py", line 28, in from pip.vcs import git, mercurial, subversion, bazaar # noqa File "D:\\Software\\Anaconda3\\lib\\site-packages\\pip\\vcs\\subversion.py", line 9, in from pip.index import Link File "D:\\Software\\Anaconda3\\lib\\site-packages\\pip\\index.py", line 33, in from pip._vendor import html5lib, requests, six ImportError: cannot import name 'html5lib'

Using some instructions I also tried this one:

python -m pip install pyreadline

with the same output. pyreadline is considered prerequirement for Ipython I think. If my console is elevated or not does no difference.

Generally speaking it seems all modules' installation attempts produce the same message. Even: pip install --ignore-installed --upgrade html5lib does so.

My system is win7, python 3.6.2 and I installed tensorflow using the instruction for Anaconda. From Anaconda Navigator I see html5lib as installed. So, how can bypass this problem to be able to install new modules?

Edit: I followed the instructions here which had a similar to mine problem but although accepted as an answer there it didn't solve the problem. html5lib seems to be reinstalled but other modules are not.

The solution to my problem came as an answer to this (very similar) but also 4 years old question .

The problem is that the solution for me that actually worked is not the accepted one, so I am providing the second answer as the solution to my problem.

Using:

conda install -c anaconda html5lib

seems to unravel the dependencies and make pip work again. ref: https://anaconda.org/anaconda/html5lib

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM