

(Note: your prompt has changed to show the virtual environment.) Create a Python virtual environment and activate it.Under your normal user ID, run scl enable to add python 3 to your path(s).# yum -y install yum -y install rh-python36 # subscription-manager repos -enable rhel-7-server-optional-rpms \ Optional: Use yum to install python-tools, numpy, scipy, and six from RHSCL RPMs.so you can build any modules that contain compiled code. Use yum to install This makes sure you've got GCC, make, git, etc.Enable the rhscl and optional software repos using subscription-manager.See below for explanations and more details. Here are the basic steps so you can just get going. More information: Developing in Python on Red Hat Platforms.How to see which software collections are installed.How to tell which software collections are enabled.How to use Python 3 from RHSCL in the #! (shebang) line of a script.How to permanently enable a software collection.Enable the Python collection *before* the virtual environment.Tips for working with software collections.Managing application dependencies using pipenv.Should I use venv or virtualenv or something else?.Working with Python virtual environments.

How to use Python 3 through Red Hat Software Collections.Full installation steps with explanations.In this article, the following topics are discussed: However, you should be able to use these instructions for any of the versions of Python in Red Hat Software Collections including 2.7, 3.4, 3.5, and future collections such as 3.7. It was the most recent, stable release when this was written. This type of scenario is why many enterprises use Red Hat. To understand why this is important, consider what happens when your application is in production and a critical security vulnerability in a core library (for example SSL/TLS) is discovered. However, support is important to those who have to deploy and operate the applications you write.

During development, support might not seem that important to you. This article uses Red Hat Software Collections because these give you a current Python installation that is built and supported by Red Hat. There are a number of different ways to get Python 3 installed on RHEL. Other tips and FAQs for working with Python and software collections on RHEL 7 are also covered. Using Python virtual environments is a best practice to isolate project-specific dependencies and create reproducible environments. Note: For RHEL 8 installs, See Python on RHEL 8. After following the steps in this article, you should be in a good position to follow many Python guides and tutorials using RHEL. This article shows how to install Python 3, pip, venv, virtualenv, and pipenv on Red Hat Enterprise Linux 7.
