Danny Liu
Danny Liu

Reputation: 519

Pip installation bug

So I tried to install pip using the get-pip.py file, and when I ran the file, terminal told me I already had pip installed on 2.7. However, when I try to find the version of my pip, terminal tells me pip doesn't exist and points to a version of 3.5 I have installed. Clearly my issue is that I have pip installed on v2.7 but the pip command is linked to v3.5. Any clues on how to fix?

Here's a picture of my terminal output: enter image description here

Upvotes: 0

Views: 166

Answers (1)

Ganesh Kathiresan
Ganesh Kathiresan

Reputation: 2088

To install a package in a particular version of python, use the following commands always:

For python 2.x:

sudo python -m pip install [package]

For python 3.x:

sudo python3 -m pip install [package]

This should resolve the doubt of which python version is the given package getting installed for.

Note: This is assuming you have not created aliases for the python command

Upvotes: 2

Related Questions