|
|
### Recommended development tools/aliases
|
|
|
|
|
|
_(Note: these instructions assume an Ubuntu variant - they may need to be modified for other systems.)_
|
|
|
|
|
|
- __[Virtualenv][virtualenv] and [Virtualenvwrapper][virtualenvwrapper]__
|
|
|
|
|
|
These two packages are _essential_ tools for local Python environment isolation (especially if you aren't using docker yet); check out their doc pages for more details.
|
|
|
|
|
|
__Installation__:
|
|
|
|
|
|
```bash
|
|
|
sudo pip install virtualenvwrapper
|
|
|
echo 'WORKON_HOME="$HOME/.virtualenvs"' >> ~/.bash_aliases
|
|
|
echo 'PROJECT_HOME="$HOME/projects"' >> ~/.bash_aliases # replace 'projects' with your preferred development path
|
|
|
echo 'source /usr/local/bin/virtualenvwrapper.sh' >> ~/.bash_aliases
|
|
|
source ~/.bashrc
|
|
|
```
|
|
|
|
|
|
__Aliases__:
|
|
|
|
|
|
The virtualenvwrapper project comes with two commands, `mkvirtualenv` and `mkproject`, which will use your python2 interpreter by default. Here are some handy aliases to use the python3 interpreter when desired:
|
|
|
|
|
|
```bash
|
|
|
echo 'alias mkvirtualenv3="mkvirtualenv --python=`which python3`"' >> ~/.bash_aliases
|
|
|
echo 'alias mkproject3="mkproject --python=`which python3`"' >> ~/.bash_aliases
|
|
|
source ~/.bashrc
|
|
|
```
|
|
|
|
|
|
Now you can simply type `mkproject3 foo` to create a new project that uses your python3 interpreter by default.
|
|
|
|
|
|
|
|
|
[virtualenv]: https://virtualenv.readthedocs.org/en/latest/
|
|
|
[virtualenvwrapper]: https://virtualenvwrapper.readthedocs.org/en/latest/ |