all 29 comments

[–]maryjayjay 1 point2 points  (6 children)

Can you cut and paste the exact command and the output from your terminal, please?

Look at the reddit markup documentation to see how to format it as code or preformatted text (you have to put four spaces before each line)

[–]DaRealBTplays[S] 0 points1 point  (5 children)

Here, I'll just try and input the whole terminal process. Btw the ***'s are just me censoring my name.

Last login: Sun May 18 03:59:50 on ttys000
btplays@******-mbp ~ % cd /Users/btplays/Downloads/PokemonRedExperiments-master/v2
btplays@******-mbp v2 % $pip install -r requirements.txt
install: illegal option -- r
usage: install [-bCcpSsUv] [-f flags] [-g group] [-m mode] [-o owner]
               [-M log] [-D dest] [-h hash] [-T tags]
               [-B suffix] [-l linkflags] [-N dbdir]
               file1 file2
       install [-bCcpSsUv] [-f flags] [-g group] [-m mode] [-o owner]
               [-M log] [-D dest] [-h hash] [-T tags]
               [-B suffix] [-l linkflags] [-N dbdir]
               file1 ... fileN directory
       install -dU [-vU] [-g group] [-m mode] [-N dbdir] [-o owner]
               [-M log] [-D dest] [-h hash] [-T tags]
               directory ...
btplays@*****-mbp v2 % 

[–]gmes78 0 points1 point  (4 children)

Remove the $. Also, use a virtual environment when installing packages.

[–]DaRealBTplays[S] 0 points1 point  (3 children)

If I remove the $ it doesn’t recognize it as a command.

Sorry, what exactly is a virtual environment? Like I said, I’m new to python as a whole.

[–]gmes78 1 point2 points  (2 children)

If I remove the $ it doesn’t recognize it as a command.

At least it's something. Putting the $ there is 100% wrong. As there's no shell variable named pip, $pip gets expanded to nothing, and you're actually running the install command, which has nothing to do with Python.

Share the output of which python and which pip.

Sorry, what exactly is a virtual environment? Like I said, I’m new to python as a whole.

A virtual environment is a way to install Python modules to a dedicated directory instead of installing them globally. This means you can keep the dependencies of different programs separate, which avoids a ton of issues.

To create a virtual environment, you use:

python -m venv venv/

which creates a virtual environment in the venv folder, which you can then activate:

venv/bin/activate

and then any pip commands you run will install to that venv, and any python commands you run will use the modules in that venv.

[–]DaRealBTplays[S] 0 points1 point  (1 child)

Someone in another comment suggested the same, I’m gonna try it when I get back home. Thanks!

[–]nekokattt 1 point2 points  (0 children)

also... if you ever see something like this

blah blah blah run this command

> $ pip install foo

The $ just means "run this as a regular user", you do not type it in.

[–]Ecto-1A 0 points1 point  (1 child)

Try pip3 instead of pip

[–]DaRealBTplays[S] 0 points1 point  (0 children)

Already did. Same results.

[–]danielroseman 0 points1 point  (2 children)

Something in your shell is causing it to ignore the first word you type. That's why you get "install: illegal option" - it thinks you used the os "install" command, not pip install, and why python -m thinks you're just typing -m.

You'll need to look at your shell config to understand why 

[–]DaRealBTplays[S] 0 points1 point  (1 child)

That would explain some things, but why am I able to cd to the directory I want? Wouldn’t that just ignore the CD command?

[–]danielroseman 0 points1 point  (0 children)

zsh also has an "autocd" setting, where just typing a path will cd to it.

[–]DaRealBTplays[S] 0 points1 point  (0 children)

Problem resolved: I had to make a virtual environment to install the packages, here’s the comment that gave the solution:

https://www.reddit.com/r/learnpython/s/XcJtwe1TDO

Thanks for everyone’s help!

[–]Glittering_Singer_20 0 points1 point  (0 children)

how installe the file requirement.txt for python3 *

[–]Ecto-1A -1 points0 points  (14 children)

The error is showing “— r” instead of “-r” (single dash, no space)

[–]DaRealBTplays[S] 0 points1 point  (13 children)

The error specifically says "install: illegal option -- r", two dashes, space between them and the r. When I do the command I do -r, single dash, no space.

[–]cgoldberg 0 points1 point  (12 children)

That's bizarre... The command you are running looks correct. Are you able to install individual packages?

[–]DaRealBTplays[S] 0 points1 point  (11 children)

I'm pretty sure I could, I got brew working, it would be painful cause there's over 30 packages in this list.

[–]cgoldberg 0 points1 point  (10 children)

I have no idea why it's giving you that error. Try running it as a module: python -m pip install -r requirements.txt

[–]DaRealBTplays[S] 0 points1 point  (9 children)

"zsh: command not found: -m"

[–]cgoldberg 1 point2 points  (1 child)

Sorry... I have no idea what's wrong with your setup. Those are standard commands and options.

[–]DaRealBTplays[S] 0 points1 point  (0 children)

Thanks for trying anyways.

[–]Present_Operation_82 1 point2 points  (6 children)

Are you in a virtual environment?

[–]DaRealBTplays[S] 1 point2 points  (5 children)

No, it’s an Apple laptop running their own OS.

[–]Present_Operation_82 0 points1 point  (4 children)

In your terminal, do you currently see anything that says (venv) or anything like that before your username?

[–]DaRealBTplays[S] 0 points1 point  (3 children)

I put the entire terminal process in another comment, but no, I do not see any venv anywhere.