phk
(usa Ubuntu)
Enviado em 05/11/2018 - 14:37h
Para instalar e só dar o comando sh com o nome do arquivo. Copie e cole em um arquivo e salve com a extensão .sh
Se quiser mudar a versão, tem de mudar onde aparece o número da versão no script. Invés de 3.7.1 coloque 3.7.0.
#!/bin/bash
sudo apt-get install -y build-essential
sudo apt-get install -y checkinstall
sudo apt-get install -y libreadline-gplv2-dev
sudo apt-get install -y libncursesw5-dev
sudo apt-get install -y libssl-dev
sudo apt-get install -y libsqlite3-dev
sudo apt-get install -y tk-dev
sudo apt-get install -y libgdbm-dev
sudo apt-get install -y libc6-dev
sudo apt-get install -y libbz2-dev
sudo apt-get install -y zlib1g-dev
sudo apt-get install -y openssl
sudo apt-get install -y libffi-dev
sudo apt-get install -y python3-dev
sudo apt-get install -y python3-setuptools
sudo apt-get install -y wget
# stop on error
set -e
############################################
# Dependencies
sudo apt-get install build-essential checkinstall
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
# Install Python from Source
mkdir ~/src/
mkdir ~/.python
# set the appropriate library path
echo 'export PYTHONPATH=$HOME/.python
export PATH="$PYTHONPATH/bin/":$PATH
' >> ~/.bashrc
# Install Python
cd ~/src
# Pick and choose the python version from
#
https://www.python.org/ftp/python/
wget
https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tgz
tar -xf Python-3.7.1.tgz
cd Python-3.7.1
configure --prefix=$HOME/.python/
make && make install
vim
# Virtual Environment tar ball available here
#
https://pypi.python.org/pypi/virtualenv
wget
https://pypi.python.org/packages/virtualenv-15.0.3.tar.gz
tar -xf virtualenv-15.0.3.tar.gz
cd virtualenv-15.0.3
python setup.py install
# Install Pip
cd ~/src
wget
https://bootstrap.pypa.io/get-pip.py && python get-pip.py
# Install Virtual Env Wrapper
pip install virtualenvwrapper
# Set environment variables for virtualenvwrapper
# Install CUDA
# Set environment variables for CUDA
# Install tensorflow
# Install numpy, scipy
# Test tensorflow and GPU with convolutional.py
# Prepare to build
mkdir /tmp/Python37
cd /tmp/Python37
# Pull down Python 3.7, build, and install
wget
https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tar.xz
tar xvf Python-3.7.1.tar.xz
cd /tmp/Python37/Python-3.7.1
./configure
sudo make altinstall