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

前端 未结 30 2539
迷失自我
迷失自我 2020-11-21 05:41

I\'m running into a weird error when trying to install Django on my computer.

This is the sequence that I typed into my command line:



        
相关标签:
30条回答
  • 2020-11-21 06:00

    Try going to Windows PowerShell or cmd prompt and typing:

    python -m pip install openpyxl
    
    0 讨论(0)
  • 2020-11-21 06:03

    You need to add the path of your pip installation to your PATH system variable. By default, pip is installed to C:\Python34\Scripts\pip (pip now comes bundled with new versions of python), so the path "C:\Python34\Scripts" needs to be added to your PATH variable.

    To check if it is already in your PATH variable, type echo %PATH% at the CMD prompt

    To add the path of your pip installation to your PATH variable, you can use the Control Panel or the setx command. For example:

    setx PATH "%PATH%;C:\Python34\Scripts"
    

    Note: According to the official documentation, "[v]ariables set with setx variables are available in future command windows only, not in the current command window". In particular, you will need to start a new cmd.exe instance after entering the above command in order to utilize the new environment variable.

    Thanks to Scott Bartell for pointing this out.

    0 讨论(0)
  • 2020-11-21 06:03

    I have just installed Python 3.6.2.

    I got the path as

    C:\Users\USERNAME\AppData\Local\Programs\Python\Python36-32\Scripts

    0 讨论(0)
  • 2020-11-21 06:04

    For Mac, run the below command in a terminal window:

    echo  export "PATH=$HOME/Library/Python/2.7/bin:$PATH"
    
    0 讨论(0)
  • 2020-11-21 06:05

    For me the command:

    set PATH=%PATH%;C:\Python34\Scripts
    

    worked immediately (try after echo %PATH% and you will see that your path has the value C:\Python34\Scripts).

    Thanks to: Adding a directory to the PATH environment variable in Windows

    0 讨论(0)
  • 2020-11-21 06:07

    Control Panel -> add/remove programs -> Python -> Modify -> optional Features (you can click everything) then press next -> Check "Add python to environment variables" -> Install

    And that should solve your path issues, so jump to command prompt and you can use pip now.

    0 讨论(0)
提交回复
热议问题