Getting error 'SyntaxError: invalid syntax' when trying to install Jupyter Notebook using pip on Windows 10

9,180

Those are not the same commands I found on their website: This is what I found: If Python 3 is installed:

python3 -m pip install --upgrade pip
python3 -m pip install jupyter

For Python 2:

python -m pip install --upgrade pip
python -m pip install jupyter

Hope this helps.

Share:
9,180

Related videos on Youtube

jack.py
Author by

jack.py

17

Updated on September 18, 2022

Comments

  • jack.py
    jack.py almost 2 years

    I am using the command on the Jupyter website,

    pip3 install jupyter
    

    but I get the error:

     File "<stdin>", line 1
    pip3 install jupyter
               ^                                                     
    SyntaxError: invalid syntax
    

    I've tried many different commands, and they all produce the same error. I'm reluctant to install Anaconda, as I already have python installed on my computer.

  • jack.py
    jack.py almost 5 years
    I did use these commands at first (still returns an error), but then on their help page and official documentation it tells you to use the commands I stated,
  • rtyocum
    rtyocum almost 5 years
    Are you able to run Python at all from CMD. If not you may have to change your system’s PATH variable to the python install directory
  • jack.py
    jack.py almost 5 years
    yeah, I can run python. I figured out that I didn't have pip in my PATH environment variable. I fixed it now.
  • Ting Yi Shih
    Ting Yi Shih over 3 years
    You saved me! It turns out that I'm installing the python3 version of jupyter with python2. Installing it with python3 makes it work!