Skip to content

Instantly share code, notes, and snippets.

@yoavram
Last active April 26, 2016 18:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yoavram/36676bde2847f225842694f22aa4a99c to your computer and use it in GitHub Desktop.
Save yoavram/36676bde2847f225842694f22aa4a99c to your computer and use it in GitHub Desktop.
Install a CentOS virtual machine and setup Python 3.4/3.5 with TensorFlow and PySide on it.

Download the VM image from osboxes.org and follow the guide to setup the VM.

The username and passwords are:

  • Username: osboxes
  • Password: osboxes.org
  • Root Account Password: osboxes.org

Open the VM, install guest additions to allow full screen: click the devices menu, and choose the last item, "install guest additions...". You'll probably need to restart the VM afterwords.

Open a terminal and install git:

sudo yum install git

Install development tools (compilers, etc.):

sudo yum group install "Development Tools"

Verify that it worked:

whereis gcc gcc --version

Now install miniconda - see instructions by atlantic, but install Anaconda with Python 3.5 rather than 2.7:

wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh bash Miniconda-latest-Linux-x86_64.sh

Update conda and pip:

conda update -y conda pip

Create a new environment for the course and activate it:

conda create -n Py4Eng python=3.5 -y source activate TensorFlow

Install packages:

conda install -y numpy scipy matplotlib pandas scikit-learn

Install tensorflow:

conda install -c https://conda.anaconda.org/jjhelmus tensorflow

Install Scikit-flow (if it's not available from the installed tensorflow package):

pip install git+https://github.com/google/skflow.git

Register the environment as a kernel for Jupyter notebook (you might need to run this as sudo):

python -m ipykernel install --name Py4Eng

Now you can launch the notebook:

jupyter notebook

To install PySide for Qt GUI development (make sure the Py4Eng conda environment is activated), create a conda environment with Python 3.4 instead of 3.5 (PySide doesn't currently work with 3.5):

conda create -m Py4Eng34 python=3.4 ipykernel matplotlib source activate Py4Eng34 sudo ~/miniconda3/envs/Py4Eng34/bin/python -m ipykernel install --name Py4Eng

And then follow these steps (some may take a while, especially yum, build_and_install, dependencies*, and python setup.py):

cd ~ git clone https://github.com/PySide/BuildScripts.git cd BuildScripts git submodule init git submodule update sudo ./dependencies.fedora.sh sudo yum update -y sudo ./build_and_install cd .. wget https://pypi.python.org/packages/source/P/PySide/PySide-1.2.4.tar.gz tar -xvzf PySide-1.2.4.tar.gz cd PySide-1.2.4 python setup.py bdist_wheel --qmake=/usr/bin/qmake-qt4 pip install dist/PySide-1.2.4-cp34-cp34m-linux-_x86_64.whl

The test the install - the following should not produce an error message:

python -c "import pyside"

Colophon

These instructions were written by Yoav Ram. This work is licensed under a CC0 License.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment