Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (47.6k points)

I have a Macbook with OS X El Captain. I think that Python 2.7 comes preinstalled on it. However, I installed Python 3.5 too. When I started using Python 3, I read that if I want to install a package, I should type:

pip3 install some_package

Anyway, now when I use

pip install some_package

I get some_package installed for Python 3. I mean I can import it and use it without problems. Moreover, when I type just pip3 in Terminal, I got this message about the usage:

Usage: pip <command> [options]

which is the same message I get when I type just pip.

Does it mean that in previous versions, things were different, and now pip and pip3 can be used interchangeably? If so, and for the sake of argument, how can I install packages for Python 2 instead of Python 3?

1 Answer

0 votes
by (106k points)

In, Python the pip is a soft link to the same executable file path with pip3. you can use below commands to check where your pip and pip3 real paths are:

$ ls -l `which pip` 

$ ls -l `which pip3`

Another option you have where you can use the below commands to know more details:

$ pip show pip 

$ pip3 show pip

To know more about this you can have a look at the following video tutorial:-

Related questions

0 votes
1 answer
asked Oct 10, 2019 in Python by Sammy (47.6k points)
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...