pip install returning invalid syntax

后端 未结 14 1439
执笔经年
执笔经年 2020-12-15 23:24

I\'ve just installed python 3.6 which comes with pip

However, in Windows command prompt, when I do: \'pip install bs4\' it returns \'SyntaxError: invalid syntax\' un

相关标签:
14条回答
  • 2020-12-16 00:00

    The problem is the OS can’t find Pip. Pip helps you install packages MODIFIED SOME GREAT ANSWERS TO BE BETTER

    Method 1 Go to path of python, then search for pip

    1. open cmd.exe
    2. write the following command:

    E.g

    cd C:\Users\Username\AppData\Local\Programs\Python\Python37-32

    In this directory, search pip with python -m pip then install package

    E.g

    python -m pip install ipywidgets

    -m module-name Searches sys.path for the named module and runs the corresponding .py file as a script.

    OR

    GO TO scripts from CMD. This is where Pip stays :)

    cd C:\Users\User name\AppData\Local\Programs\Python\Python37-32\Scripts>

    Then

    pip install anypackage

    0 讨论(0)
  • 2020-12-16 00:01

    You can also go into the directory where you have your pip.exe or pip3.exe located. For me it was on my D drive so here is what I did:

    D:\>cd python
    
    D:\python>cd Scripts
    
    D:\python\Scripts>pip3.exe install tweepy
    

    Hope it helps

    0 讨论(0)
  • 2020-12-16 00:02

    You need to run pip install in the command prompt, outside from a python interpreter ! Try to exit python and re try :)

    0 讨论(0)
  • 2020-12-16 00:03

    Don't enter in the python shall, Install in the command directory.

    Not inside the python pip cannot be installed inside the python.

    Even in the version 3.+ you don't have to write the python 3 instead just python.

    which looks like

    python -m pip install --upgrade pip
    

    and then install others

    python -m pip install jupyter
    
    0 讨论(0)
  • 2020-12-16 00:03
    1. First go to python directory where it was installed on your windows machine by using

      cmd

    2. Then go ahead as i did in the picture

    0 讨论(0)
  • 2020-12-16 00:06

    In windows, you have to run pip install command from( python path)/ scripts path in cmd prompt

    C:/python27/scripts

    pip install pandas

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