I followed the book to create an environment “gluon” using anaconda. after activating the gluon, i checked the pip installation and got the following error message:
~/anaconda3/envs/gluon$ pip --Version
Traceback (most recent call last):
File “/home/lance/anaconda3/envs/gluon/bin/pip”, line 7, in
from pip._internal.cli.main import main
ModuleNotFoundError: No module named ‘pip._internal.cli.main’
can anybody help on this ? many thanks!
Lance
my computer information:
thinkpad x1 extreme
ubuntu 18.04
Anaconda
Hi, Steven, I did the command you mentioned and got the following message:
(gluon) lance@lance-ThinkPad-X1-Extreme:~$ pip --version
Traceback (most recent call last):
File “/home/lance/anaconda3/envs/gluon/bin/pip”, line 7, in
from pip._internal.cli.main import main
ModuleNotFoundError: No module named ‘pip._internal.cli.main’
Hi, I read the instruction you mentioned, the following is what I did:
I installed anaconda (not miniconda), in a standard way. I had anaconda installed before I picked up the d2l book. I assume anaconda should work as fine as miniconda for d2l. If not, please let me know.
My anaconda installation directory was: /home/lance/anaconda3
I downloaded the book file package and unzipped it at:
/home/lance/Documents/Dive-into-Deep-Learning/d2l-zh/
I created an environment “gluon” using the the file “environment.yml” as instructed in the book.
I activated “gluon”, and run: “pip --version”, and got the following message:
(gluon) lance@lance-ThinkPad-X1-Extreme:~$ pip --version
Traceback (most recent call last):
File “/home/lance/anaconda3/envs/gluon/bin/pip”, line 7, in
from pip._internal.cli.main import main
I run the command “conda install pip -y”, and got the message:
WARNING: The conda.compat module is deprecated and will be removed in a future release.
Collecting package metadata: done
Solving environment: done
==> WARNING: A newer version of conda exists. <==
current version: 4.6.11
latest version: 4.8.5
Please update conda by running
$ conda update -n base -c defaults conda
All requested packages already installed.
after that, I repeated 4) to check pip, but still got the same message:
(gluon) lance@lance-ThinkPad-X1-Extreme:~$ pip --version
Traceback (most recent call last):
File “/home/lance/anaconda3/envs/gluon/bin/pip”, line 7, in
from pip._internal.cli.main import main
ModuleNotFoundError: No module named ‘pip._internal.cli.main’
I just updated conda using the command “conda update -n base -c defaults conda”. It has been done now.
then I tried installing pip again:
(gluon) lance@lance-ThinkPad-X1-Extreme:~/anaconda3/envs/gluon$ conda install pip -y
Collecting package metadata (repodata.json): done
Solving environment: done
All requested packages already installed.
when I checked pip version, still not working:
(gluon) lance@lance-ThinkPad-X1-Extreme:~/anaconda3/envs/gluon$ pip --version
Traceback (most recent call last):
File “/home/lance/anaconda3/envs/gluon/bin/pip”, line 7, in
from pip._internal.cli.main import main
ModuleNotFoundError: No module named ‘pip._internal.cli.main’
Hi @lance, theoretically anaconda should include all the packages of miniconda, however, sometimes there are small variations. Could you follow the instruction I mentioned earlier and try with miniconda? Please let me know if it still doesnt work.