how to install the watchdogs pip for python [duplicate] - python

This question already has answers here:
Why does "pip install" inside Python raise a SyntaxError?
(7 answers)
Closed 2 years ago.
hey i was wondering if someone could tell me how to install the watchdogs pip for python i'm using visual studio code was wondering if that made any difference i cant figure it out and nothing on youtube
pip install watchdog
tried this and many other things in python console and VSCode
>>> pip install watchdog
File "<stdin>", line 1
pip install watchdog
^
SyntaxError: invalid syntax
>>> pip install watchdog
File "<stdin>", line 1
pip install watchdog
^
SyntaxError: invalid syntax
>>> pip3 install watchdog
File "<stdin>", line 1
pip3 install watchdog
^
SyntaxError: invalid syntax
>>> py -m pip install [watchdog]
File "<stdin>", line 1
py -m pip install [watchdog]
^
SyntaxError: invalid syntax
>>>
that was in the python console
Traceback (most recent call last):
File "c:/Users/User/Desktop/fileSortProgram/fileSort.py", line 1, in <module>
from watchdog.observer import observer
ModuleNotFoundError: No module named 'watchdog'
that was in vscode

You may want to try to install pip itself. My computer had this problem, and I had to install pip using the shell. You can use the official tutorial here: https://pip.pypa.io/en/stable/installing/

I suspect you haven't set pip in your environment variables.
try adding pip to your environment variables.
Here's a good tutorial on how to do it https://appuals.com/fix-pip-is-not-recognized-as-an-internal-or-external-command/

Related

Cannot Install Ipython [duplicate]

This question already has answers here:
Why does "pip install" inside Python raise a SyntaxError?
(7 answers)
Closed 4 months ago.
I am not able to install ipython. I am sure it is a very simple error that I am making but i can't find a solution anywhere. Below are some examples of code that i have tried to use and the respective errors:
>>> C:\Users\trist\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Python 3.10>pip install ipython
File "<stdin>", line 1
C:\Users\trist\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Python 3.10>pip install ipython
^
SyntaxError: unexpected character after line continuation character
>>> pip install ipython
File "<stdin>", line 1
pip install ipython
^^^^^^^
SyntaxError: invalid syntax
>>>
You're using pip command inside a python session. Quit the session with
quit()
And then run the pip command again

Why i cant install the numpy package using pip on Ubuntu 16.04? [duplicate]

This question already has answers here:
Installing pip is not working in python < 3.6
(6 answers)
Closed 2 years ago.
Im trying to install the numpy package with python3 (python --version returns Python 3.5.2), but it doesnt work. Somebody can help me please with this problem? When i use the command
pip install numpy
, the terminal return to me
Traceback (most recent call last):
File "/home/fabricio/.local/bin/pip", line 7, in <module>
from pip._internal.cli.main import main
File "/usr/local/lib/python3.5/dist-packages/pip/_internal/cli/main.py", line 60
sys.stderr.write(f"ERROR: {exc}")
^
SyntaxError: invalid syntax
I've tried install using Python2.7 but it was dreprecation
You have, mysteriously, a version of pip that is using f-strings, such as f"ERROR: {exc}", even though f-strings were not introduced until Python 3.6. Furthermore, recent versions of NumPy support Python 3.7 and above.
Try installing a more recent version of Python3, activating a virtual environment, and installing with python3 -m pip install numpy.
Python 3.5 is also EOL as of 2020-09-30.

get-pip.py returns SyntaxError: invalid syntax [duplicate]

This question already has answers here:
Installing pip is not working in python < 3.6
(6 answers)
Closed 2 years ago.
I installed pip from this command
curl https://bootstrap.pypa.io/get-pip.py --output get-pip.py
and when I did sudo python2 get-pip.py
Traceback (most recent call last):
File "get-pip.py", line 24226, in <module>
main()
File "get-pip.py", line 199, in main
bootstrap(tmpdir=tmpdir)
File "get-pip.py", line 82, in bootstrap
from pip._internal.cli.main import main as pip_entry_point
File "/tmp/tmpf3jeCG/pip.zip/pip/_internal/cli/main.py", line 60
sys.stderr.write(f"ERROR: {exc}")
^
SyntaxError: invalid syntax
It was working fine a few weeks back and then suddenly it has stopped working. I really need to know what I have done wrong? Is there any other way I can do it? I'm using Atlassian Bitbucket which has Java8 image. I also need pip installed since I can not have more than one image. I'm downloading it locally using the above command and making pip work. Is there anyother way I can use it to make it work?
The support for Python 2.7 is deprecated on newer versions of pip, hence the reason why you're noticing this error here.
In order for you to maintain the sanity with Python 2.7 and pip, either maintain yourself to lower version of pip using the pip installer itself
pip install --upgrade pip==20.3
or make use of the Python 2.7 specific version of get-pip.py
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py

Installing NumPy with pip3 Fails, but installing with pip is ok

I need to install TensorFlow with pip3, when it gets to the installing NumPy step it stops and gives me the error:
(When I tried to install NumPy with pip it was fine, but I need it to work with python 3.)
Thanks in advance for any help.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-v32qiaml/numpy/setup.py", line 68
f"NumPy {VERSION} may not yet support Python "
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-v32qiaml/numpy/```
F-strings were added to Python at version 3.6. It seems your pip3 runs under earlier Python, perhaps 3.5.
Check your pip and pip3 (and their interpreters) versions with pip --version and pip3 --version. Install more recent Python version if needed.

ModuleNotFoundError: No module named 'requests' after pip install [duplicate]

This question already has answers here:
ModuleNotFoundError: No module named 'requests' but it's installed?
(2 answers)
Closed 1 year ago.
I know similar questions have been asked before but I couldn't find the solution to my problem.
I am getting the following error message after trying to import requests:
C:\Users\Jm\PycharmProjects\Test\venv\Scripts\python.exe C:/Users/Jm/PycharmProjects/Test/Test_001
Traceback (most recent call last):
File "C:/Users/Jm/PycharmProjects/Test/Test_001", line 1, in <module>
import requests
ModuleNotFoundError: No module named 'requests'
I only have one version of python installed and python -m pip install requests is saying all the requirements are already satisfied.
Run this code:
C:\Users\Jm\PycharmProjects\Test\venv\Scripts\python.exe -m pip install requests
This forces the installation directory to your python install.
This gives a much different effect than simply python -m pip install requests
As #Daniel Scott mentioned before use the command mentioned above or below
$: path-to-your-python-command -m pip install name-of-module
If you are using linux/mac then you can find path-to-your-python command using:
$: which python3
/usr/bin/python3
Lets say your python is installed here /usr/bin/python3 and the module you are installing is requests. Then you can use:
$: /usr/bin/python3 -m pip install requests

Categories