Python

Article Thumbnail
Article

How to Use MongoDB 2.4 with Python 3.3 from Red Hat Software Collections

Honza Horak

This article is focused on MongoDB 2.4 packaged as software collections . Knowledge of MongoDB basics is recommended, but not required. In case you are not familiar with MongoDB and you'd like to learn more, try MongoDB's online courses . These courses give you basic knowledge about MongoDB concepts, configuration, and deployment, as well as knowledge of how to program application for MongoDB. This article is focused on what is different with Red Hat Software Collections (RHSCL) packages. These packages...

Article Thumbnail
Article

Using Python's Virtualenv with RHSCL

Bohuslav Kabrda

I've been getting more and more questions about using Python's virtualenv with python27 and python33 collections from RHSCL, so I decided to write a very short tutorial about this topic. The "tl;dr" version is: everything works perfectly fine as long as you remember to enable the collection first. Update 2018: An updated article has been published, See How to install Python 3, pip, venv, virtualenv, and pipenv on Red Hat Enterprise Linux . What is Virtualenv Citing Virtualenv official documentation...

Article Thumbnail
Article

Migrate to Python 3 with RHSCL

Bohuslav Kabrda

Although most of Python enterprise applications still use Python 2 (e.g. Python 2.4 on RHEL 5 or Python 2.6 on RHEL 6), Python 3 has already become a mature variant and is worth considering. Why, you ask? Python 3 series is being actively developed by upstream, while Python 2 now only gets security fixes and bug fixes. Python 2.7 is the latest minor release of the 2.X series and there will be no Python 2.8 . This is very important...

Article Thumbnail
Article

Profiling Python Programs

William Cohen

For RHEL6 and newer distributions tools are available to profile Python code and to generate dynamic call graphs of a program's execution. Flat profiles can be obtained with the cProfile module and dynamic callgraphs can be obtained with pycallgraph. The cProfile Python module records information about each of the python methods run. For older versions of Python that do not include the cProfile module you can use the higher overhead profile module. Profiling is fairly simple with the cProfile module...

Article Thumbnail
Article

Using DTS Eclipse, PyDev, and Python 2.7

Langdon White

Red Hat intended for developers to integrate Developer Toolset 2.0 (DTS) and Red Hat Software Collections 1.0 (RHSCL). As you may not realize, inside the DTS is a copy of Eclipse and you can use that with any software collection. In other words, you can use PyDev, with the Python 2.7 Software Collection from RHSCL in the Eclipse from DTS. Let's find out how. First, let's make sure you have the right repos, [lwhite@lwhite-laptop ~]$ sudo yum repolist Loaded plugins...

Article Thumbnail
Article

Using RHSCL: Django on Python 3 with PostgreSQL

Bohuslav Kabrda

This article will show you how to use two software collections of RHSCL 1.0 Beta for cutting edge development. We will create a Django 1.5 application (running on Python 3.3), that will use PostgreSQL 9.2 as a database. Installing Dependencies First off, we will install the required collections. If you haven't done so already, you need to subscribe to the correct RHN channel ( rhel-x86_64- variant -6-rhscl-1-beta , where variant is one of server , client or workstation ). Now...

Article Thumbnail
Article

Red Hat Software Collections 1.0 Beta Now Available

Mike Guerette

You may have seen references to " software collections " in this blog, but this is different. "Red Hat Software Collections", now in beta for the first time, is a collection of refreshed and supported web/dynamic languages and databases for Red Hat Enterprise Linux. Now you can have two versions of software on one OS, or refresh these languages and databases more frequently. See this list below! From the announcement: "Red Hat is pleased to announce the Beta release of...

Article Thumbnail
Article

Setting up Django and Python 2.7 on Red Hat Enterprise 6 the easy way

Langdon White

Recently, I needed to get Django installed with Python 2.7 on Red Hat Enterprise Linux 6. As this is not a directly supported activity, I wanted to document how I went about it. As you might imagine, the generally expected method for install would be to grab the Python 2.7 source tree and then build it. Obviously, that can be a lot of work; is not particularly repeatable; and, potentially, exposes you to more security flaws. As a result, I...