简体   繁体   中英

'pip2' is not recognized as an internal or external command

I am trying to run a python script on my windows 10 computer using Python 2.7.

I run the ff command:

python boxtool.py

Then I got the ff errors:

'pip2' is not recognized as an internal or external command,
operable program or batch file.
'pip2' is not recognized as an internal or external command,
operable program or batch file.
Traceback (most recent call last):
  File boxtool.py", line 14, in <module>
    from requests.exceptions import ConnectionError
ImportError: No module named requests.exceptions

Looking at the code, here are the codes in line 14:

except ImportError:
    os.system("pip2 install requests")
from requests.exceptions import ConnectionError
from mechanize import Browser

I am new in Python. Can anyone tell me how to fix this?

Download the get-pip.py file: get-pip.py on pypa.io

Then install it using python

python get-pip.py

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