Skip to content

Instantly share code, notes, and snippets.

@lukin0110
Last active August 29, 2016 07:31
Show Gist options
  • Save lukin0110/496985d4e9a1c1764b19eb856c0e4540 to your computer and use it in GitHub Desktop.
Save lukin0110/496985d4e9a1c1764b19eb856c0e4540 to your computer and use it in GitHub Desktop.

When you use Docker for development you're not relying on virtualenv anymore. PyCharm relies on virtualenv for code completion. Therefore we still need to create a virtualenv for each Python project.

The virtualenv is only used for PyCharm, handy for code completion. Installation guide. The actual development happens in a Docker container.

$ brew install postgresql
$ brew install pyenv
$ pyenv install 3.4.1
$ cd ~/.virtualenvs
$ virtualenv -p /Users/<username>/.pyenv/versions/3.4.1/bin/python3.4 <foo_project>
$ source ./<foo_project>/bin/activate && python -V

If you have issues with zipimport.ZipImportError: can't decompress data; zlib not available:

CFLAGS="-I$(brew --prefix openssl)/include -I$(xcrun --show-sdk-path)/usr/include" \
LDFLAGS="-L$(brew --prefix openssl)/lib" \
pyenv install -v 3.4.1

More details on Github

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment