python pip gives: "no such option: -r"

Viewed 8637

So I just freshly installed python3.7. I've used python 2 for a long time but I needed python 3 for a specific module.

So I tried to install the requirements.txt via py -m pip install -r requirements.txt but when I do, I get the following error:

Usage:
  D:\Python37-32\python.exe -m pip <command> [options]

no such option: -r

I dont think my install is broken as I get the same error with python 2 (python -m pip install -r requirements.txt)

pip is also in my path but I use it with py -m pip because I have both python versions 2 and 3 installed on my system and need to make sure I use the correct pip with the correct python version

Why can't I install the requirements.txt and am I getting this error instead?

2 Answers

Try using:

python -m pip install -r req.txt

Some times using "py" doesn't work.

I think I didnt have the environments setup correctly.

I restarted my pc what I forgot to do after installing and the command did work after that.

Related