git clone https://github.com/pyenv/pyenv.git ~/.pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
exec $SHELL -l
pyenv install miniconda3-latest
pyenv rehash
pyenv global miniconda3-latest
conda install -y numpy matplotlib sympy pandas
- We assume that we use a folder called
tensorflow-gpu
mkdir tensorflow-gpu
virtualenv --system-site-packages tensorflow-gpu
source tensorflow-gpu/bin/activate
(tensorflow-gpu)$ pip install --upgrade tensorflow-gpu
(tensorflow-gpu)$ python
>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()
>>> print(sess.run(hello))
If you see the following message, your installation went well.
Hello, TensorFlow!
(tensorflow-gpu)$ deactivate
- Activate the virtual environment (
tensorflow-gpu
) - Do your stuff
- Deactivate the environment