>reboot
Log back in, switch to root:
>yum update kernel
(may be done already by previous step) >reboot
Log back in, switch to root:
>yum install kernel-devel
Next, you'll want to install VirtualBox guest additions to make the guest OS easier to use. In order to do that, you first have to add yourself to the sudoers
file (if you aren't already there as part of the OS install).
This section may not be needed if you set up your user account to be Administrator. I leave it here in case you didn't
Likely you will need to login as root to do this.
su -
vim /etc/sudoers
:wq!
exit
to exit the su -
shell.>sudo usermod -aG vboxsf bsoher
xz zlib zlib-devel openssl-devel pcre-devel sqlite-devel
.Do this using:
>rpm -qa | grep <pkg-name>
I found only ‘xz' and ‘zlib' installed. So, I did the following:
>yum install xz zlib zlib-devel openssl-devel pcre-devel sqlite-devel
CentOS 7 comes with Python 2.7, but this is the system version and you should not use/change it.
conda create --name python37 python=3.7
Change the name or python version as needed for your compilewheel
package in your conda environment. One of the below steps should work:conda install wheel
conda install -c conda-forge wheel
pip install wheel
Pip comes with Miniconda and Python 3.7 environment as does setuptools and wheel, both of which we need.
sudo ./configure && sudo make && sudo make install
Deprecated Deprecated Deprecated Deprecated Deprecated Deprecated
The following instructions are included here for historical jocularity. Steps to set up CentOS 7 as a VM are given above and should be used to create Python 3 wheels.
This document describes how I set up CentOS 5.11 to build Linux PyGamma wheels. I used CentOS as a VirtualBox guest.
This document makes no distinction between 32- and 64-bit Linux. The instructions are the same for each. If you want to build 32-bit PyGamma wheels, you need 32-bit CentOS. If you want to build 64-bit PyGamma wheels, you need 64-bit CentOS. It's probably possible to build 32-bit binaries on the 64-bit platform, but I haven't worked out how.
CentOS 5.x will be supported (albeit only with critical security updates) until 31 March, 2017 according to the CentOS FAQ: https://wiki.centos.org/FAQ/General.
I downloaded the ISO and installed as one normally does under VirtualBox. During the installation, I opted to disable SELinux.
On the first reboot after installation was complete, CentOS will update itself with the latest patches.
Next, you'll want to install VirtualBox guest additions to make the guest OS easier to use. In order to do that, you first have to add yourself to the sudoers
file.
su -
vim /etc/sudoers
:wq!
exit
to exit the su -
shell.First, install GCC –
sudo yum install gcc gcc-c++
Next –
cd /media/VBOXADDITIONS_xxxx
. Note that the exact name of the VBOXADDITIONS
directory changes with each each version of VirtualBox.Install the things you'll need to build Python and swig, and to use pip –
sudo yum install xz zlib zlib-devel openssl-devel pcre-devel sqlite-devel
CentOS 5.11 comes with Python 2.4. To use a newer Python, download and untar the source code for the Python you want to use and then build it. For the Python 2.7.11 source that I used, I built with these steps –
sudo ./configure --enable-unicode=ucs4
sudo make altinstall
Using UCS4 (as opposed to the default UCS2) during the configure step is important. See here for details: https://www.python.org/dev/peps/pep-0513/#ucs-2-vs-ucs-4-builds
make altinstall
tells Python to install itself in such a way that it doesn't interfere with the default (system) Python.
Once my Python was built, I added a symlink to make it the default Python in my shell –
sudo ln -s /usr/local/bin/python2.7 /usr/local/bin/python
At this point, if you start a new terminal and type python
, you should get Python 2.7.11.
wget --no-check-certificate https://bootstrap.pypa.io/get-pip.py
This also installs setuptools and wheel, both of which we need.
pip
gets a little confused when installed in this context. Its 3 scripts contain an incorrect shebang line. (See pip issue 1918 for more details.) Use sudo vim
to edit these 3 scripts –
/usr/local/bin/pip
/usr/local/bin/pip2
/usr/local/bin/pip2.7
In each, change the first line from this –
#!/usr/bin/python
to this –
#!/usr/local/bin/python
sudo ./configure && sudo make && sudo make install