Skip to content

Instantly share code, notes, and snippets.

@phrawzty
Last active September 14, 2016 09:24
Show Gist options
  • Save phrawzty/5db4212b04a74137d992 to your computer and use it in GitHub Desktop.
Save phrawzty/5db4212b04a74137d992 to your computer and use it in GitHub Desktop.
python27 in CentOS via SCL on Socorro Vagrant
(socorro-virtualenv)[vagrant@localhost ~]$ cat /etc/centos-release
CentOS release 6.4 (Final)
(socorro-virtualenv)[vagrant@localhost ~]$ sudo yum install centos-release-SCL
[...]
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
centos-release-SCL x86_64 10:6-5.el6.centos extras 3.9 k
Transaction Summary
================================================================================
Install 1 Package(s)
Total download size: 3.9 k
Installed size: 453
[...]
(socorro-virtualenv)[vagrant@localhost ~]$ cat /etc/yum.repos.d/CentOS-SCL.repo | grep -v ^#
[scl]
name=CentOS-$releasever - SCL
baseurl=http://mirror.centos.org/centos/$releasever/SCL/$basearch/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
(socorro-virtualenv)[vagrant@localhost ~]$ sudo yum install python27
[...]
================================================================================
Package Arch Version Repository
Size
================================================================================
Installing:
python27 x86_64 1.1-16.el6.centos.alt scl 4.7 k
Installing for dependencies:
python27-python x86_64 2.7.5-10.el6.centos.alt scl 80 k
python27-python-babel noarch 0.9.6-7.el6.centos.alt scl 1.4 M
python27-python-devel x86_64 2.7.5-10.el6.centos.alt scl 386 k
python27-python-docutils noarch 0.11-1.el6.centos.alt scl 1.6 M
python27-python-jinja2 noarch 2.6-10.el6.centos.alt scl 550 k
python27-python-libs x86_64 2.7.5-10.el6.centos.alt scl 5.5 M
python27-python-markupsafe x86_64 0.11-11.el6.centos.alt scl 25 k
python27-python-nose noarch 1.3.0-1.el6.centos.alt scl 290 k
python27-python-pygments noarch 1.5-2.el6.centos.alt scl 802 k
python27-python-setuptools noarch 0.9.8-2.el6.centos.alt scl 423 k
python27-python-simplejson x86_64 3.2.0-1.el6.centos.alt scl 174 k
python27-python-sphinx noarch 1.1.3-7.el6.centos.alt scl 1.1 M
python27-python-sqlalchemy x86_64 0.7.9-3.el6.centos.alt scl 2.1 M
python27-python-virtualenv noarch 1.10.1-2.el6.centos.alt scl 1.4 M
python27-python-werkzeug noarch 0.8.3-5.el6.centos.alt scl 556 k
python27-runtime x86_64 1.1-16.el6.centos.alt scl 1.0 M
Transaction Summary
================================================================================
Install 17 Package(s)
Total download size: 17 M
Installed size: 67 M
(socorro-virtualenv)[vagrant@localhost ~]$ rpm -qa --info python27
Name : python27 Relocations: (not relocatable)
Version : 1.1 Vendor: CentOS
Release : 16.el6.centos.alt Build Date: Thu 10 Jul 2014 09:02:39 PM UTC
Install Date: Mon 19 Jan 2015 10:11:33 AM UTC Build Host: sclbuild
Group : Unspecified Source RPM: python27-1.1-16.el6.centos.alt.src.rpm
Size : 0 License: GPLv2+
Signature : RSA/SHA1, Mon 25 Aug 2014 03:51:16 PM UTC, Key ID 0946fca2c105b9de
Packager : CentOS BuildSystem <http://bugs.centos.org>
Summary : Package that installs python27
Description :
This is the main package for python27 Software Collection.
(socorro-virtualenv)[vagrant@localhost ~]$ scl -l
devtoolset-1.1
python27
(socorro-virtualenv)[vagrant@localhost ~]$ deactivate
[vagrant@localhost ~]$ scl enable python27 'which python'
/opt/rh/python27/root/usr/bin/python
[vagrant@localhost ~]$ scl enable python27 'python --version'
Python 2.7.5
[vagrant@localhost ~]$ scl enable python27 bash
(socorro-virtualenv)[vagrant@localhost ~]$ deactivate
[vagrant@localhost ~]$ virtualenv foo
New python executable in foo/bin/python
[...]
[vagrant@localhost ~]$ source foo/bin/activate
(foo)[vagrant@localhost ~]$ which python
~/foo/bin/python
(foo)[vagrant@localhost ~]$ which pip
~/foo/bin/pip
(foo)[vagrant@localhost ~]$ pip install osconf
[...]
(foo)[vagrant@localhost ~]$ python -c 'import osconf'; echo $?
0
[vagrant@localhost ~]$ source /opt/rh/python27/enable
[vagrant@localhost ~]$ which python
/opt/rh/python27/root/usr/bin/python
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment