A short summary on how to setup a good python environment for beginners.

vim support

See Excellent blog post.

PEP8 Checking

PEP8 is the style guide for python. You can enable style checking in vim:

First install flake8

pip install flake8

Then install vim-flake8

To check syntax on file save, add this to your vimrc:

autocmd BufWritePost *.py call Flake8()


Virtualenv keeps your python package path clean only including project requirements.

# Install virtualenv, use pip -V to determine python2 or python3
pip install virtualenv

cd project

# Create virtualenv
virtualenv -p /usr/bin/python2.7 venv

# Activate
source venv/bin/activate

# Install dependencies
pip install nltk

# Add venv to your gitignore
echo "venv/" >> .gitignore

# Freeze your dependencies
pip freeze > ./requirements.txt

# Install dependencies (e.g. after git pull)
pip install -r ./requirements.txt

# Deactivate venv

Also have a look at the docs.