0

I'm running a fresh installed OctoPi image (0.18.0). I added pip to my PATH in .bashrc file and sourced it but when I try to run pip I'm getting -bash: pip: command not found error.

When I run /home/pi/oprint/bin/pip, pip is working properly.

My path:

pi@octopi:~ $ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games:/home/pi/oprint/bin/pip:
Milvintsiss
  • 1,420
  • 1
  • 18
  • 34
  • Is `: No such file or directory` part of `$PATH`? If yes, then shorten your `$PATH` to `/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games:/home/pi/oprint/bin/pip` – SpaceKatt Mar 01 '21 at 23:47

2 Answers2

2

You added the full path of the executable to the path, but you're only supposed to add the directory of the executable. Every exectuable of said directory is then directly available without the directory prefix.

In other words .. instead of /home/pi/oprint/bin/pip you should add /home/pi/oprint/bin/ to the path.

DerMaddi
  • 649
  • 2
  • 12
1

I always recommend using the Python executable to locate the pip executable for you. This way, you know the right version of pip is being used to install packages that are compliant with your Python version.

$ python -m pip install <the_package_you_want>

It is really easy to end up with mismatched versions otherwise!

SpaceKatt
  • 976
  • 6
  • 12
  • I get `/usr/bin/python3: no module named pip`, any way to change the configured pip directory? – Milvintsiss Mar 02 '21 at 12:10
  • Please post the exact output of `$ echo $PATH` in your answer, using a [code block](https://www.markdownguide.org/extended-syntax/#fenced-code-blocks), and comment here when you are done. If you do that, then I can help you further – SpaceKatt Mar 02 '21 at 16:15