Configuring Pydev Interpreter in Eclipse to use Enthought Python Distribution
Asked Answered
N

7

16

I downloaded Pydev plugin for Eclipse (3.5.2) today on Mac OSX 10.5.8. To be able to use Pydev, I need to configure the interpreter in Eclipse. I am not clear what exactly I need to do here, or what this step does. I want to make sure that when I run programs from Eclipse using Pydev, it uses the Enthought Python Distribution (EPD) I have installed, and can use all the packages that come with EPD. Can someone please tell me simple steps that I need to follow.

If I click on autoconfig, it shows a bunch of folders with the path

/System/Library/Frameworks/Python.Framework/Versions/2.5/...

But I know that the Python that came with EPD is version 2.6.4, so autoconfig is not choosing EPD.

Thanks for any help.


UPDATE - solution

If anyone else is interested in learning how to do this, see the first link in the answer by mlvljr below. Use the solution there EXCEPT that as suggested in the solution, Shift+Cmd+G, did not help me see inside the Python.app package. To look inside it, use the "gear" drop down menu in the Finder and choose "Show Package Contents"

Narcotism answered 18/3, 2010 at 12:45 Comment(1)
you may also look at a close SO question being discussed right now: #2470621Softwood
S
10

At least on Windows, this seems to doable via:

  1. [Navigate Eclipse menus] "Window"->"Preferences"->"PyDev"->"Interpreter - Python"-> "New" (which is next to "Auto Config" you tried to use, if I get it right)

  2. [Type or paste into textboxes] "Interpreter Name", "Interpreter Executable"

  3. Click "OK" :))

[UPDATE]

From the Enthought Python Distribution Readme.txt (EPD.mkpg/Contents/Resources/Readme.txt in epd-6.1-1-macosx-i386.dmg EPD disk 32-bit MacOS disk image):

Applications are installed into /Applications/EPD32-6.1
and the underlying Python framework into /Library/Frameworks/Python.framework/Versions/6.1

So, Interpreter Executable must be:

/Library/Frameworks/Python.framework/Versions/6.1/python

You can supply (almost) any Interpreter Name you like. :)

Hope this helps.

[EDIT]

If this does not help, google search for “Error getting info on interpreter” gives the following (the problem may have to do with Eclipse version (older have bugs) and the symlink vs actual path problem):

  1. Installing PyDev on OS X 10.5.2

  2. [Pydev-users] [pydev - Users] mayapy on PyDev Maya Python is running on OSX

  3. Cannot set python interperter in preferences - ID: 1523582 (unfold "comments" there)

Softwood answered 18/3, 2010 at 15:24 Comment(5)
The problem is that I do not know what the "Interpreter Name" is and what the "Interpreter Executable" is and where to find it. Thanks anyway.Narcotism
@Curious2learn: The interpreter executable seems to be around /Library/Frameworks/Python.framework/Versions/6.1 (see cse.ucdavis.edu/~chaos/courses/nlp/Software/… for details, What went where part), you can supply any Interpreter Name you like ("EPD 2.6.4", for example), if I get it right.Softwood
Thanks so much for the update. I tried doing that, but I got an error saying: "Error getting info on the interpreter". When I looked in the error log, there was the following line there: "No output was in the standard output when trying to create the interpreter info" Hope we can fix this. Because, as of now I cannot run programs that import matplotlib.Narcotism
Thanks so much, mlvljr. I had searched for the term “Error getting info on interpreter” on google and did come across the first link in your list. The problem was that it did not give the path the EPD interpreter. I was not sure that inside Python.app they would have the same path. And, I did not know how to look inside Python.app (Cmd+Shift+G did not help). So I looked up on the web and learnt that I could use the "gear" icon in the finder to look inside the python.app and figure out the path. I did that and it works great now. Thanks for your help.Narcotism
@Narcotism Happy, your problem is over. Thanks for accepting too :))Softwood
B
12

Mac OS 10.6.4:

Selecting the interpreter as /Library/Frameworks/Python.framework/Versions/2.7/Python did not work.

I had to select /Library/Frameworks/Python.framework/Versions/2.7/bin/python

Boigie answered 30/10, 2010 at 20:43 Comment(1)
This did it for me, not the selected answer above. ThanksOverfly
S
10

At least on Windows, this seems to doable via:

  1. [Navigate Eclipse menus] "Window"->"Preferences"->"PyDev"->"Interpreter - Python"-> "New" (which is next to "Auto Config" you tried to use, if I get it right)

  2. [Type or paste into textboxes] "Interpreter Name", "Interpreter Executable"

  3. Click "OK" :))

[UPDATE]

From the Enthought Python Distribution Readme.txt (EPD.mkpg/Contents/Resources/Readme.txt in epd-6.1-1-macosx-i386.dmg EPD disk 32-bit MacOS disk image):

Applications are installed into /Applications/EPD32-6.1
and the underlying Python framework into /Library/Frameworks/Python.framework/Versions/6.1

So, Interpreter Executable must be:

/Library/Frameworks/Python.framework/Versions/6.1/python

You can supply (almost) any Interpreter Name you like. :)

Hope this helps.

[EDIT]

If this does not help, google search for “Error getting info on interpreter” gives the following (the problem may have to do with Eclipse version (older have bugs) and the symlink vs actual path problem):

  1. Installing PyDev on OS X 10.5.2

  2. [Pydev-users] [pydev - Users] mayapy on PyDev Maya Python is running on OSX

  3. Cannot set python interperter in preferences - ID: 1523582 (unfold "comments" there)

Softwood answered 18/3, 2010 at 15:24 Comment(5)
The problem is that I do not know what the "Interpreter Name" is and what the "Interpreter Executable" is and where to find it. Thanks anyway.Narcotism
@Curious2learn: The interpreter executable seems to be around /Library/Frameworks/Python.framework/Versions/6.1 (see cse.ucdavis.edu/~chaos/courses/nlp/Software/… for details, What went where part), you can supply any Interpreter Name you like ("EPD 2.6.4", for example), if I get it right.Softwood
Thanks so much for the update. I tried doing that, but I got an error saying: "Error getting info on the interpreter". When I looked in the error log, there was the following line there: "No output was in the standard output when trying to create the interpreter info" Hope we can fix this. Because, as of now I cannot run programs that import matplotlib.Narcotism
Thanks so much, mlvljr. I had searched for the term “Error getting info on interpreter” on google and did come across the first link in your list. The problem was that it did not give the path the EPD interpreter. I was not sure that inside Python.app they would have the same path. And, I did not know how to look inside Python.app (Cmd+Shift+G did not help). So I looked up on the web and learnt that I could use the "gear" icon in the finder to look inside the python.app and figure out the path. I did that and it works great now. Thanks for your help.Narcotism
@Narcotism Happy, your problem is over. Thanks for accepting too :))Softwood
P
3

For latest versions of Canopy under Mac the correct path seems to be:

/Users/<yourusername>/Library/Enthought/Canopy_32bit/System/bin/python

I tried with ~/.... first but Eclipse didn't seem to like that.

Prussia answered 13/5, 2013 at 16:45 Comment(0)
C
2

I've had the same luck!

On top of a Mac X Lion I did the following installations: * Enthought 2.7 (these preconfigures Python 2.7 and a lot of other libraries). * Aptana Studio 3.03 (not beta) with PyDev preconfigured. * Finally, and after some troubles I saw that there was some versions of Python installed on my Mac (and I don't remembre when I installed it). I had to choose the version that justus87 says. Put attention on it because its easy to confuse and is a head break!

Remember, the path of the python file is: /Library/Frameworks/Python.framework/Versions/7.1/bin/python

You need to make sure you point it to the EPD interpreter and not just the regular python 2.7 interpreter. For EPD 7.2 64-bit on mac the path is "/Library/Frameworks/EPD64.framework/Versions/7.2/bin"

Cadre answered 16/12, 2011 at 9:4 Comment(0)
O
1

I am running Python 3, so I had to make these changes to get python.exe as my interpreter.

File: C:\EasyEclipse-for-LAMP-1.2.2.2\extensions\pydev-1.3.3\eclipse\plugins\org.python.pydev_1.3.3\PySrc\interpreterInfo.py

Edit all occurrences of "print ..." to "print(...)" (the ... is whatever is being printed), so wrap it in parentheses.

Comment out line 16, since True and False are considered keywords in Python 3.

Save, and you should be able to successfully set C:\Python32\python.exe as the interpreter. I kept the default folders checked.

Orientalize answered 16/2, 2012 at 6:47 Comment(0)
P
1

I found this tutorial very helpful for this problem - http://www.cs.duke.edu/courses/compsci101/current/resources/install.php

Specifically, step 6:

  1. connect Eclipse to your version of Python (so you can run Python programs within Eclipse) connect Eclipse to your version of Python (so you can run Python programs within Eclipse)
    • open Eclipse and access the Preferences Box (under Window>Preferences on Windows or Eclipse>Preferences on Mac)
    • choose "Pydev" and "Interpreter - Python" from the sidebar
    • press the "New ..." button to tell Eclipse about Python
    • in the resulting dialog box, for the "Interpreter Name" type "Canopy" and for the "Interpreter Executable" type
      • for Windows: "C:\Users\UUU\AppData\Local\Enthought\Canopy\User\python.exe"
      • for Mac: "/Users/UUU/Library/Enthought/Canopy_VVV/User/bin/python"
    • where UUU is your user name on your machine and VVV is the remainder of the directory name (which depends on which version you installed; you should be able to find the right one by browsing to it)
    • choose "Select All" and then click "OK" at the bottom of the resulting dialog box
    • click "OK" at the bottom of the Preferences Box and wait for the changes to take effect when the dialog box to close (you do not need to restart Eclipse)
Polemics answered 9/12, 2013 at 18:48 Comment(0)
S
0

If you can get the (Enthought) Canopy distribution working, but are unsure where it's installed to/what PyDev needs, the following worked for me to use that install to identify the right solution, and install it:

start ipython (as it was installed with the Canopy distribution).

do:

import sys; 
for i in sys.path: print( i)

look for the option that ends in: "/bin" ( e.g. mine was: /Users/myUserNameHERE/Library/Enthought/Canopy_32bit/User/bin )

Now the fun part (as it worked for me), go to eclipse's preferences, and under: "Pydev"==> "Interpreter - Python", and select 'New...'

Add in that full path under 'Interpreter Executable" put that path, along with 'python' (on mac [ probably 'python.exe' on windows?] ). For 'Interpreter Name' I put 'Python2.7-Canopy');

PyDev then automatically the other libraries to include ( I checked the boxes to accept its suggestions).

Lastly, you'll need to make sure that your project is using that Interpreter. Ensure either

  • (a) If your project is bound to the default interpreter (for 'Python' and not 'Jython'), move that new 'Python2.7-Canopy' you added (in your workspace Preferences) to be your workspace's default ( using 'Up' to make it first) or
  • (b) Go to the settings for the project, and under 'PyDev - Interpreter/Grammer' select from the requisite dropdown box the name you put (eg. "Python2.7-Canopy")

On my system, all then finally worked, matplotlib, numpy, etc. Yeah!

Superdreadnought answered 6/11, 2013 at 4:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.