Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I configure Aptana IDE (Eclipse) to work with pipenv?

I have a python project working fine in Aptana.

I then started to use pipenv for the project's environment management and now I can't get Aptana to use that environment.

I also set up a new project then added it to Aptana and Aptana uses a 3.7 version of python instead of the pipenv python 2.7.

Any suggestions on where to start looking?

like image 584
Mike Avatar asked Dec 15 '17 06:12

Mike


1 Answers

Pipenv and python folders

Get the location where pipenv is storing the virtual environment with:

pipenv --venv

It will return a folder: [environment_folder]

Also, get at hand the location of the original python executable, the one used by pipenv: [python_folder]

Eclipse configuration

Go to the existing project where you want to use pipenv or create a new python project.

Go to Eclipse menu: Project > Properties

Choose: PyDev - Interpreter

Click: "Click here to configure an interpreter not listed"

Choose "New" from python interpreter

Use the environment_folder output of pipenv --venv

Set Interpreter Executable to: [environment_folder]\Scripts\python.exe

When propmted, select folders to add to system PYTHONPATH:

  • [python_folder]\Lib
  • [python_folder]\DLLs
  • [environment_folder]\
  • [environment_folder]\lib [environment_folder]\Scripts
  • [environment_folder]\lib\site-packages

Add those folders. Accept and apply.

And everything should be ready.

like image 137
Marcos Avatar answered Oct 31 '22 18:10

Marcos