Python Forum
Installing pip on linux
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Installing pip on linux
#1
Hi all ! I don't even know if pip is only for windows. Here I am on linux. I just installed ubuntu 18.04. Is pip good for linux ? If so, how to install pip on linux ? Thanks
Reply
#2
As I now, in 18.04 Python 3.6.5 is installed as default. Python include pip since 3.4 so just try: pip install requests.

If it is not installed run sudo apt install python3-pip or however is the packet is called.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#3
I looked for python. 2.7 is installed. I just learned that pip is only for python, so I give up for pip on linux. As I have a double boot computer, I decide now to handle all my programming python on windows. There, every thing about python is updated.
Reply
#4
Hm! I don't understand. You had to install Python on Windows. Did you try to run python3 instead of just python on your linux terminal. I think the default Python version on Ubuntu 18.04 is python 2.x so if you want to run Python 3 you have to run python3 command. Also installing modules on Windows could tricky sometimes. Try Linux first if you don't plan to write programs for Windows.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#5
Yes. python 3.6.5 is present on linux. As I am tired by installing, I keep all my pythons on windows. Python on windows and on linux seems to me not reasonable.
Reply
#6
I have a video on how to install Python on YouTube[1]. I also have a blog post[2] on my website. The basic steps are

sudo apt-get update

Now that the package lists have been updated we can upgrade to the latest versions with the apt-get upgrade command:

sudo apt-get -y upgrade

Once the packages have been upgraded, we can install Python 3.7. This is done with the apt-get install command:

sudo apt-get install -y python3.7

Once the installation is complete, we confirm that it was successful by calling Python 3.7 and printing out the version number:

python3.7 -V

# expected output
Python 3.7.3

Now we have successfully completed the installation of Python. Since we want to work with other Python packages in the future, we can now install the package management program PIP. For this we execute the following command:

sudo apt-get install -y python3-pip

In the following, we make sure that Python 3.7 is the latest python3 version. To achieve that we set a symbolic link to python3.

sudo ln -sf /usr/bin/python3.7 /usr/bin/python3

Once PIP has been installed we have to update PIP. Unfortunately we have to do this manually although we have just installed PIP, cause the installed version is pretty old, so yes, this step is necessary:

python3 -m pip install --upgrade pip

Once the installation is complete we also confirm this by calling the version number of PIP:

python3 -m pip -V

# expected output
pip 19.2.1 from /home/vagrant/.local/lib/python3.7/site-packages/pip (python 3.7)

Now we are still testing if we can actually install libraries with PIP. For this we use a very popular Python math library named numpy

python3 -m pip install numpy

[1]: https://youtu.be/PKUrhVqEpxE
[2]: https://techdiffuse.com/en/2019/08/06/py...o-install/
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  installing uPyCraft IDE on Mx-Linux apollo 4 5,000 Oct-14-2019, 04:36 PM
Last Post: Larz60+
  Installing the Visual Studio Code on Linux - how to do that!? apollo 4 3,217 Oct-05-2019, 09:48 PM
Last Post: apollo
  installing Linux on Flash Drive Larz60+ 9 6,839 Sep-18-2017, 02:03 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020