Why am I getting ImportError: No module named pip

2020-01-30 06:57发布

I have installed pip and ez setup. I also checked the system path and I can see the module in the folder structure. Still when i try to run pip command, I get an Import error saying no module named pip. I am running 32bit python on a windows7 machine

10条回答
三岁会撩人
2楼-- · 2020-01-30 07:17

What solved the issue on my case was go to:

cd C:\Program Files\Python37\Scripts

And run below command:

easy_install.exe pip
查看更多
我命由我不由天
3楼-- · 2020-01-30 07:21

The ensurepip module was added in version 3.4 and then backported to 2.7.9.

So make sure your Python version is at least 2.7.9 if using Python 2, and at least 3.4 if using Python 3.

查看更多
Viruses.
4楼-- · 2020-01-30 07:21

If you want to run pip on windows you must go from command line to the next folder:

cd C:\Python34\Scripts

and run command there or use next source to install pip: https://pip.pypa.io/en/latest/installing/

查看更多
一纸荒年 Trace。
5楼-- · 2020-01-30 07:23

I was facing same issue and resolved using following steps

1) Go to your paython package and rename "python37._pth" to python37._pth.save

2) curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py

3) then run python get-pip.py

4) pip install django

Hope this help

查看更多
小情绪 Triste *
6楼-- · 2020-01-30 07:25

Just be sure that you have include python to windows PATH variable, then run python -m ensurepip

查看更多
爷、活的狠高调
7楼-- · 2020-01-30 07:29

turned out i had 2 versions of python on my laptop

both commands worked for me

python -m ensurepip
py -m ensurepip

both with another installation path

c:\tools\python\lib\site-packages
c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages 

only the first path was in my %PATH% variable

查看更多
登录 后发表回答