[Answered ]-How to setup Django PyDev project with virtualenv created with pyenv

2👍

First find your virtualenv directory with

pyenv prefix <venv-name>

The python executable of the virtualenv should be <path>/<to>/<venv>/bin/python.

Now set up a new interpreter in Eclipse Preferences>PyDev>Interpreters>Python Interpreter using the location of the executable and a adequate name.
After that you can start a new Django Project via File>New>Project>Pydev>PyDev Django Project. Choose your predefined interpreter.

The Django Project should now work inside the virtualenv. For installing new packages it is probably easiest to just activate the virtualenv in the terminal with
pyenv activate <venv-name> and pip install the package.

👤Jarno

Leave a comment