Using conda environments with Eclipse+pydev

4 views
Skip to first unread message

Jason S

unread,
Mar 4, 2014, 6:14:48 PM3/4/14
to anac...@continuum.io
I'm starting to use conda environments. They work fine at the command prompt (I'm using Windows 7). How can I use them with Eclipse + pydev?


Ilan Schnell

unread,
Mar 4, 2014, 6:48:06 PM3/4/14
to Anaconda
I'm not familiar with Eclipse, but I would image that you have to point Eclipse to the location of the environment.  Or are you looking for some tighter integration?


On Tue, Mar 4, 2014 at 5:14 PM, Jason S <jms...@gmail.com> wrote:
I'm starting to use conda environments. They work fine at the command prompt (I'm using Windows 7). How can I use them with Eclipse + pydev?


--
Anaconda Community Support Group Brought to you by Continuum Analytics
---
You received this message because you are subscribed to the Google Groups "Anaconda - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to anaconda+u...@continuum.io.
To post to this group, send email to anac...@continuum.io.
Visit this group at http://groups.google.com/a/continuum.io/group/anaconda/.

Gary Pajer

unread,
Mar 4, 2014, 10:24:11 PM3/4/14
to anac...@continuum.io
I'm using Eclipse + pydev.  Only one small issue so far (see below).  

In Preferences >> PyDev >> Python Interpreter add a new interpreter and point it to the Anaconda python executable.   PYTHONPATH is automatically set after that (I had to add one local directory for my personal packages).   

To use IPython as the interactive console:  Preferences >> PyDev >> Interactive Console: paste the following into " Initial interpreter commands":
import IPython
IPython.Shell.IPShell().mainloop()

Output is going to a non-interactive shell instead of the IPython shell, but the IPython shell is available.  Haven't cracked that nut yet.  That might be expected (but not desired) behavior.  Don't know.

~-~-~

Jason S

unread,
Mar 5, 2014, 10:53:08 AM3/5/14
to anac...@continuum.io

On Tuesday, March 4, 2014 8:24:11 PM UTC-7, GaryP wrote:
In Preferences >> PyDev >> Python Interpreter add a new interpreter and point it to the Anaconda python executable.   PYTHONPATH is automatically set after that (I had to add one local directory for my personal packages).   


No, I know that, that's the easy part. I've been using PyDev for a year or two and it's nice that you can pick which interpreter it uses.

Like I said, I'm now using conda environments. In a command prompt, I use "activate foo" to switch to a particular conda environment e.g. "foo", so that it is using particular package versions. But I don't understand how to configure PyDev to do this.

Jason S

unread,
Mar 5, 2014, 11:23:35 AM3/5/14
to anac...@continuum.io
On Tuesday, March 4, 2014 4:48:06 PM UTC-7, Ilan Schnell wrote:
I'm not familiar with Eclipse, but I would image that you have to point Eclipse to the location of the environment.  Or are you looking for some tighter integration?


Not tighter integration, just trying to get the environment set up properly. Could you describe what the "activate" program actually does? Because somehow I need to get the same setup to happen in PyDev.

P.S. there are several major Python IDEs out there: Eclipse+PyDev, NetBeans Python, and Microsoft Python Tools for Visual Studio. It would be great if Anaconda had documentation for how to use conda environments with each of these.

Gary Pajer

unread,
Mar 5, 2014, 3:18:08 PM3/5/14
to anac...@continuum.io
Hmm.  Just a guess, here, but Eclipse/PyDev allows you to set up multiple python interpreters.   Just change interpreters when you change environments?

Another SWAG:  put your Eclipse workspace in the Anaconda environment?  You would have completely different workspaces for each environment, which may not be what you want.  

~-~-~


--

Aaron Meurer

unread,
Mar 7, 2014, 5:32:33 PM3/7/14
to anaconda
All activate does is change your PATH, so that when you type "python"
it points to the python in the environment. You don't have to activate
an environment to use it. It's entirely a convenience for command line
usage. So to fix pydev, you just need to change the path to Python to
point to the one in the conda environment you want to use.

Aaron Meurer
Reply all
Reply to author
Forward
0 new messages