Using pydev with Eclipse on OSX - python

I setup PyDev with this path for the python interpreter
/System/Library/Frameworks/Python.framework/Versions/2.5/Python
since the one under /usr/bin were alias and Eclipse won't select it. I can run my python script now but cannot run the shell as an external tool. The message I get is
variable references empty selection ${resource_loc}
Same if I use {container_loc}
Any thoughts ?
Sunit

I installed the Python.org version as well, this is a must.
I finally got PyDev working in Eclipse by pointing the interpreter to:
/Library/Frameworks/Python.framework/Versions/2.6/bin/python
manually. If you don't do it manually (by using the Autoconfig) it seems to not find the right version.

Common practice seems to be to install an up-to-date Python 2.5 from python.org and use that instead of the system installation. I saw that recommended here and there when I got started on Mac OS X.
It installs under /Library (as opposed to /System/Library) so the system Python is intact. Pydev has /Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/Contents/MacOS/Python as its configured Python interpreter and all is well.
Can't state for sure that your trouble is due only to using the system's Python installation; in any case this way I have no trouble. Also, this way when you fiddle with your development environment (install things in site-packages, upgrade Python), anything that uses the system Python is sure to be unaffected.

I know this is a ancient post... but, in case of some newbee like me to get the better answer.
I just using "Eclipse Marketplace" from the "Help" menu and search for keyword "python" or "PyDev" to get PyDev, and get it successfully installed.
AND, you should add PyDev to the top-right dock.
For the instance, my eclipse on my laptop's OSX is (Version: Indigo Service Release 2 Build id: 20120216-1857).
Have fun, folks! :)

I believe ${resource_loc} or ${container_loc} (without any argument) are based on the current selection in your workbench when you are launching your script.
So are you selecting the right resource when selecting that script through the "external tool" runner ?
At least, click on the project name before you run one of the external programs.
Note: it works with a selection in the Navigator or Package Explorers views (the latest might not be available in PyDev environment though)

Related

Create python project in eclipse with Pydev fails, why?

Error: The selected wizard could not be started.
Plug-in org.python.pydev was unable to load class org.python.pydev.ui.wizards.project.PythonProjectWizard.
An error occurred while automatically activating bundle org.python.pydev (547).
This error occurs as a result of installing the wrong version of PyDev for the version of Eclipse that you're using (found a hint on SO here).
For example, I (Edit: used to) use Eclipse Luna (Service Release 2, v4.4.2). I tend to lose my plugins / settings every time I update Eclipse on a Mac, and I'm too lazy to look into why, so I've avoided updating. Which is how I ran into the problem you describe here.
The version of PyDev available in the Eclipse Marketplace is, as of this writing, 6.5.something. You'd think Eclipse would be smart enough not to allow incompatible plugins to be installed with the Marketplace installer, but nope.
Look here for an idea of which version of PyDev you need to work with your version of Eclipse (check the "About" box within Eclipse), then follow the instructions here to download the appropriate .zip from SourceForge, extract it, and move the extracted files into the dropins directory, preserving the hierarchy that existing inside the archive.
For Eclipse Luna (4.4), I found that PyDev 5.2.0 seems to work fine (so far).
Note that the location of the dropins folder may vary by operating system. Once upon a time, I bookmarked this reference (for Luna) from the Eclipse help, and it may be useful somehow.

System Python conflict between Anaconda and existing Python installation

I've been going with a basic Python3.4 install that I've been installing many modules into for over the past month but have reached a point where pip is coming up short and I'm going to just install the full Anaconda on my system to go deeper into bokeh-server stuff.
I get a popup during the Windows 64bit installer (Anaconda3-2.3.0-Windows-x86_64.exe) saying
A version of Python 3.4 (64-bit) is already at C:\Python34\ We
recommend that if you want Anaconda registered as your system Python,
you unregister this Python first. If you really know this is what you
want, click OK, otherwise click cancel to continue.
Didn't find much documentation on this subject, and I'm not really sure how to "unregister" that installation of Python apart from uninstalling it entirely from Windows which I imagine would accomplish such a thing. Is this basically telling me to check how my Python Launcher for Windows is setup after the Anaconda installation? I'm completely unfamiliar with this notion of python system registration? Is that just a round about warning about which python version takes precedence on the system path, or which installation holds the file associations?
The solution is simply to uninstall python (for example, run the original python installer and select the uninstall option). The python key in the windows registry will be removed (which is what unregister means in this context).
Here is a link to a script that will unregister a Python installation (if you haven't come across it already). I personally have not dealt with anything like this. It seems like it should work, but you may have to tinker around with some of the paths in the script to get things to work. The links in #nightuser 's post will also probably fix the issue.
Why not just remove your version of Python? You could do a pip freeze > requirements.txt with your current Python and add them to Anaconda, or create an environment with Anaconda using those packages. Anaconda has greatly decreased the amount of time I spend setting things up.
You are getting that prompt because you have another version already installed the safe way to do this is going to the directory of the existing version and running the uninstaller. Once the previous version is completely uninstalled. You can run the installation as normal it should works!
enter image description hereYou have already installed python in your environment, so your system can handle your python code. Anaconda can handle your python code as well. If you install Anaconda and expect use python provided by Anaconda, then your system will confuse about assigning the code job. To avoid this confusion, there is always a path to point out which python you want.
You can ask your OS to find specific python by changing your environment path in windows OS:
By deleting the python path your Python will be invisible. Changing path is more convenient compared with the uninstall.
If you got a python compiling software like Pycharm, things are different. Pycharm may have python3.6 while your system got python 3.5. You need to delete path in those software or uninstall python specified by those software.
Pycharm
Actually, instead of registering the Anaconda as the system python, you can install it first, then specify your Pycharm and system path to the Anaconda python path. Thus, your Pycharm will use python provided by Anaconda and package & virtual environment you need.
I edit this for lots of times because I got Great wall, so I can't close something pop up in my screen(cause it is Blank). And everything is missing if I refresh. This is annoying.
My system path Anaconda3's python36
Add path in Pycharm
Or you can't use these packages and Anacon's virtual Environment

Eclipse - Installed PyDev and nothing changed

This isn't my first time using Eclipse or installing PyDev but this is the first time it both succeeded and failed.
It succeeded because it installed, it shows up as being installed and installation went on fine without a problem.
It failed because nothing has shown up, there is no Python perspective, no PyDev views in the view list, no new projects under PyDev, no PyDev preferences. It is as if it is not actually installed at all.
The only thing I did differently is extract the latest eclipse to a folder called ~/eclipse and create a short cut to run it there (the latest Eclipse), usually I use apt-get to install eclipse, realise it's an old version (C++11 stuff missing) then upgrade and do this. Somehow PyDev is usually carried forward.
I'm not sure how it can list it as being installed but have this error, I'd appreciate any help you guys can offer.
I bet it's the problem of 3.x version of PyDev. It demands java 7.
2 solutions are possible:
Install java 7. re-run the Eclipse, Pydev should function well now. OR
Install last 2.x version of PyDev.
To do it
1) Remove PyDev : In Eclipse About window click Installation Details
button below. You will see controls for removing plug-ins.
2) Install 2.x version of PyDev:
Eclipse Help->Install New Software.
REMOVE CHECKBOX "Show only the latest version" located at the bottom of the dialog.
Choose Pydev update site from the list and in the appeared list of PyDev versions choose latest in 2.x branch.
The problem is really that sometimes even installing java 7, Eclipse does not get it.
In http://pydev.org/download.html, there's a section called: PyDev does not appear after install!
Try to follow it to see if it fixes your problem (i.e.: making Eclipse find java 7).
Another option would be using PyDev standalone (i.e.: LiClipse). Although it's commercial, it should come with all the requisites builtin (so, no hassles to install) and is updated whenever PyDev itself is updated.

How should I setup the Wing IDE for use with IronPython

Here is a screen where I should point the Wing IDE to my python files. I am using IronPython.
Am I assuming correctly that textbox one gets filled with ipy.exe ? (proper path provided)
What should be in the rest of the boxes ?
I do not know about your question in particular; however few weeks ago, Michael Foord published a guide for using WingIde with IronPython.
You can find it here: http://www.voidspace.org.uk/ironpython/wing-how-to.shtml
Wing IDE at the moment doesn't allow the debug mode with IronPython. You need to link the IDE to the CPython install. (Michael Foord words in the article http://www.voidspace.org.uk/ironpython/wing-how-to.shtml]1).
Wing IDE wouldn't run the shell while pointing at Python 3.1. I am unsure whether that is something I have done wrong or that the incompabilities aren't sorted out yet.
I have installed CPython implementation from Python download site.Python download
I have set the Python executable path to the python.exe that gets installed to your Python Install directory.
I have modified the enviroment variables and added the Python directory to the PATH variable.

Best way to have full Python install under cygwin/XP?

Pythons installed under WinXP have dirs like DLLs, DOC, include, etc. but python (2.5) installed with cygwin is a bare python.exe. My motivation for asking is that 'things' under XP don't seem to be finding 'other things' under cygwin and vice versa, I want to start developing with Qt, I like shells, and I do not like MS; I thought if I got all the components under one roof, I could finally start to have scripts find executables which could find files and such. 1. Can I simply copy the contents of an XP installation into the cygwin tree? 2. Is the XP flavor of Python different from the cygwin flavor? (Same CPU, he pointed out, naively.) 3. Someone must work with a full-fledged (if snakes had feathers...) Python from within cygwin; how is it done?
Disclaimer 1: I have never compiled anything under XP or cygwin; had hoped not to have to go there, hence, python in the first place. Disclaimer 2: sorry if this is a ServerFault question, but they seemed to be system people over there and this is (in my case) a lowly desktop.
I use Python from within cygwin, but I don't use the version that cygwin gives you the option of installing as I don't have the control over version number used that I need (we use an older version at work). I have my python version installed via the windows installer (the xp version as you put it) and add the /cygdrive/c/Python2x directory to my PATH environment variable.
Well, in my windows environment I use active python and it, so far, works for me.
Just a little off the question, but...
Have you considered running Sun's VirtualBox with Fedora or Ubuntu inside of it? I'm assuming you have to / need to use windows because you still are, but don't like it. Then you would have python running inside a native linux desktop without any of the troubles you mentioned.
And if you want something that is really easy and portable, then just use Python on Windows, not mixed in with cygwin.
$0.02
This probably has little value, but... I found myself in this exact situation -- we use ActivePython2.5 in production (pure windows environment) and I was trying to do my development within cygwin and cygwin's Python...
After ripping out half of my hair, I have now switched over to Console2, gvim, iPython and ActivePython2.5.
I'm less than thrilled dealing with Windows tools (and their concomitant warts), but at least I'm not getting in my own way when it comes to development. For a while I found I was spending more time trying to get my tools to play nice than actually getting any work done.
Good luck on this one.
I accidentally stumbled on this - If I launch Cygwin from the Cygwin.bat file (which is present directly under the main folder), I get access to the Python version installed under Cygwin (i.e 2.6.8)
If I instead launch the Cygwin from bash.exe under bin directory (C:\Cygwin\bin\bash.exe for me), running "Python -V" shows that I have access to 2.7.3 version of Python (that was installed for Windows).
So, I guess you can do the same.

Categories

Resources