Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Install python and pip

happy10319May 29 2018 — edited May 30 2018

Hi,

I want to install last version of python and pip on my Oracle Linux (6) VM.

Currently it is the situation:

which pip

/usr/bin/which: no pip in (/usr/lib64/qt-3.3/bin

python -V

Python 2.6.6

I have done:

[root@rac1 python]# yum upgrade python-setuptools

Loaded plugins: refresh-packagekit, security, ulninfo

Setting up Upgrade Process

But

No Packages marked for Update

How to install last version of python and pip on my Oracle Linux (6) VM?

Thanks.

This post has been answered by Sergio-Oracle on May 30 2018
Jump to Answer

Comments

Andris Perkons-Oracle

You have to install EPEL (Extra Packages for Enterprise Linux) first.

Use google how to do it or check this blog entry: https://blogs.oracle.com/wim/using-epel-repos-with-oracle-linux. Since you are on OL6, you will have to scroll down to the "Original Content"

Then you should be able to run "yum install python-pip" to install pip.

Andris

Sergio-Oracle

As another option that uses Oracle Linux yum server, see this document about Python for Oracle Linux:

Python for Oracle Linux | Oracle, Software. Hardware. Complete.

If you are OK with using a newer version of Python than the system version: on Oracle Linux 7 you have the option to use newer releases of Python from EPEL (as Andris points out). On OL6 you can use the Software Collection Library. For example:

$ sudo yum -y install yum-utils

$ sudo yum-config-manager --enable ol6_software_collections

$ sudo yum install -y rh-python36 scl-utils

$ # become root

$ sudo su -

# scl enable rh-python36 bash

# python -m pip install Flask

# # first exit out of SCL environment, then out of root

# exit

# exit

$ # should be able to use the flask module now

$ scl enable rh-python36 bash

$ python

Python 3.6.3 (default, Feb 12 2018, 20:00:49)

[GCC 4.4.7 20120313 (Red Hat 4.4.7-18)] on linux

Type "help", "copyright", "credits" or "license" for more information.

>>> import flask

>>> quit()

happy10319

Thank you.

But:

[root@rac1 python]# sudo yum -y install yum-utils

Loaded plugins: refresh-packagekit, security, ulninfo

Setting up Install Process

Package yum-utils-1.1.30-40.0.1.el6.noarch already installed and latest version

Nothing to do

[root@rac1 python]# sudo yum-config-manager --enable ol6_software_collections

Loaded plugins: refresh-packagekit

[root@rac1 python]# sudo yum install -y rh-python36 scl-utils

Loaded plugins: refresh-packagekit, security, ulninfo

Setting up Install Process

No package rh-python36 available.

Package scl-utils-20120927-29.el6_9.x86_64 already installed and latest version

Nothing to do

[root@rac1 python]# scl enable rh-python36 bash

Unable to open /etc/scl/prefixes/rh-python36!

[root@rac1 python]#

Thank you.

Sergio-Oracle

Do you have an up to date repo file? See:

http://yum.oracle.com/oracle-linux-python.html#EnablingRepos

happy10319

Thank you.

I do not know. How to verify?

That document does not show how to see that. Does it?

Regards.

Sergio-Oracle
Answer

You can tell by looking in the yum repo file, e.g.

$ grep ol6_software_collection /etc/yum.repos.d/*

[ol6_software_collections]

If you don't see that result, you'll need to obtain a more recent yum repo file as explained here:

Python for Oracle Linux | Oracle, Software. Hardware. Complete.

Marked as Answer by happy10319 · Sep 27 2020
1 - 6
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jun 27 2018
Added on May 29 2018
6 comments
26,413 views