2018年5月18日 星期五

Setup Python3 develop environment on Ubuntu Server 1804

1. Install Ubuntu Server 1804
2. Install pip3 & python3-dev
# sudo apt install python3-pip python3-dev
3. update pip
# python3 -m pip install -U pip
4. logout and login
5. Install virtualenvwrapper
# python3 -m pip install --user virtualenvwrapper
6. add variable in .bashrc
export VIRTUALENVWRAPPER_PYTHON=$(which python3)
7. include virtualenvwrapper in .bashrc
Add following in tail of .bashrc
# set ~/.local/bin in PATH
if [ -d "$HOME/.local/bin" ] ; then
    PATH="$HOME/.local/bin:$PATH"
fi

# virtualenvwrapper
source $(which virtualenvwrapper.sh)
8. logout & login again
9. create a virtualenv
# mkvirtualenv env1

for APT proxy setting: /etc/apt/apt.conf
Acquire::http::Proxy "http://yourproxyaddress:proxyport";

for pip proxy setting per-user: ~/.config/pip/pip.conf
[global]
proxy = http://127.0.0.1:3128

https://medium.com/@gitudaniel/installing-virtualenvwrapper-for-python3-ad3dfea7c717

沒有留言:

張貼留言