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
try this.
python -m pip ...
-m module-name Searches sys.path for the named module and runs the corresponding .py file as a script.
Sometimes the OS can't find pip so python
or py
-m
may solve the problem because it is python itself searching for pip
.
You need to be in the specific folder where pip.exe exists, then do the following steps:
cd "The path to the python folder"
or in my case, i wrote
cd C:\Users\username\AppData\Local\Programs\Python\Python37-32\Scripts
pip install *anypackage*
I use Enthought Canopy for my python, at first I used "pip install --upgrade pip", it showed a syntax error like yours, then I added a "!" in front of the pip, then it finally worked.
Try:
pip3 install bs4
If you have python2 installed you typically have to make sure you are using the correct version of pip.
Chances are you are in the Python interpreter. Happens sometimes if you give this (Python) command in cmd.exe just to check the version of Python and you so happen to forget to come out.
Try this command
exit()
pip install xyz
Try running cmd as administrator (in the menu that pops up after right-clicking) and/or entering "pip" alone and then