0

As explained in title.

Things I've already tried out that didn't work:

  • pip install --upgrade pip
  • brew postinstall [email protected]
  • wget https://bootstrap.pypa.io/get-pip.py, followed by sudo python3.7 get-pip.py (the second command doesn't work)

Consulted articles: How to install PIP on Python 3.6?, more

so far, I've been running whatever I've pip installed in a file that contains python packages by running python [filename.py], rather than python3. So it works fine right now but I want to use python3, since python 2.7 is deprecated anyway

7
  • 1
    Sometimes pip gets locked to a version of python. On my system, for example, pip installs for 2.7 and pip3 for 3.7. If you've installed python3.x.x then you have pip3 and you can use that to install packages. Similarly you can use python3 to run your scripts. Better not to override the system's pip because it can break things like apt on linux Commented Aug 24, 2020 at 3:20
  • Try python3 -m ensurepip and then use pip3 install .... Commented Aug 24, 2020 at 3:26
  • 2
    Does this answer your question? How to override the pip command to Python3.x instead of Python2.7? Commented Aug 24, 2020 at 3:32
  • 1
    stackoverflow.com/questions/38938205/… Commented Aug 24, 2020 at 3:32
  • 1
    sudo pip uninstall pip, followed by sudo python3 -m pip install --upgrade --force pip, followed by sudo pip -V for checking Commented Aug 27, 2020 at 8:39

4 Answers 4

2

You could try using pip3 as that works for python3

Sign up to request clarification or add additional context in comments.

Comments

1

I think you are on macOS. In macOS, the commands python and pip refers to Python 2 and pip 2, because Apple uses Python 2. To use Python 3 and pip 3, use the commands python3 and pip3.

pip3 install <yourModule>

Comments

-1

try installing by python3 -m pip install <package>

Edited this was a workaround though.

for installing the correct pip, you have to remove prev installations.

for that try ``which pip```

try sudo apt purge pip or sudo apt purge python-pip

also run double-check sudo apt purge pip3 or sudo apt purge python3-pip

Now try which pip and which pip3 make sure none of them are installed

now sudo apt install python3-pip

Comments

-3

try:

sudo apt install python3-pip

and use

pip3

to call pip

1 Comment

They posted that they tried using brew postinstall [email protected] so they are on a Mac. apt install won't help.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.