How to get started with a bare-bones Eclipse + PyDev - python

I am planning to move from SPE to Eclipse + PyDev for better code completion. I think SPE's code completion is rather weird.
Anyway, how should I get started with Eclipse + PyDev? I browsed http://www.eclipse.org and I found that Eclipse is made up of some base/core system and plugins are added for more functionality. I also stumbled upon http://www.easyeclipse.org which offers a ready-to-use Eclipse + PyDev distribution.
I have two options: the easy way and the hard way.
EASY WAY
Just download from http://www.easyeclipse.org. Problem is, I can't decide which version to use, v1.2.2.2 or v1.3.1?
HARD WAY
I want to keep a lean Eclipse installation, so I want to start out with a bare-bones download, then add plug-ins as I advance in skill. As of the moment, all I want in an IDE is the following:
Proper code completion, and
An easy shortcut key to run the current program. It should be something like F5 or F9.
Eventually, I will want to use more advanced tools, but I want to add plug-ins when I need or want to learn them:
Debugging
Unit testing
Version control
What plug-ins should I install to get the specific features I just mentioned?

The leanest Eclipse installation is the Platform Runtime Binary at around 50MB (look for it in the middle of the page). Install it and then once in eclipse go to Help->Install New Software... and use http://pydev.org/updates as link to install PyDev and you are done. Not very hard at all.

I've never really used the PyDev with Eclipse, but Eclipse comes with shortcut keys - you can change them to whatever suits you. If you install the standard version of Eclipse (which isn't exactly "lean", you know) with PyDev, you should have debugging built in. You can get Eclipse plugins for virtually any VCS you like, whether that's git or bazaar, subversion or CVS. Just check out the list.
edit: and it doesn't look like there's any reason not to use the newest stable version of Easyclipse, if that's what you decide.

I have used EasyEclipse for a while, but though less errors and incompatibilities occurred than in the standard version at that time, I didn't like that some modules were either too old or not supported at all. Meanwhile the standard distribution is stable enough.
Debugging and unit testing are integrated in PyDev. You must configure the Python interpreter in the preferences, "Auto config" should do, then choose "Run as..." "Python unit-test" on a Python module, and for debugging see the "Run" menu. Version control depends on what you use, I think CVS is already integrated, but I use Subversion, and for that you need to install the Subversive plugin (meanwhile available from the Eclipse repositories, but you must still install it).

Related

how to use pydev in sublime using sublimeREPL

I was wondering if it is possible to use PyDev in Sublime. Because it has all this great debugging features that are missing in Sublime.
I know that it hasn't been implemented but I think with a few tricks we can use PyDev in Sublime.
There is also SublimeREPL plugin which allows you to run an interpreter inside Sublime.
https://github.com/wuub/SublimeREPL
Moreover, there is this remote debugging ability from PyDev documented here which I think we can take advantage of.
http://pydev.org/manual_adv_remote_debugger.html
Any brainstorming on how to do this would be appreciated because I think it is at least theoretically possible with some hacks!
P.S. I am using Sublime Text 3 and Ubuntu 13.10 64-bit. Also, I have Eclipse and Pydev installed.
You would have to make an entire package containing a build system, syntax support etc... where to start is difficult for me to say as I have never used pydev but the goal would surely be to mimic the IDE of pydev in sublime.
I am not aware of anything that enables remote debugging in sublime text so again this would have to be coded as part of your package.
You could perhaps start this package by specifically writing a list of all the features you would like to see in sublime, see if they exist on package control site https://packagecontrol.io/ if they do great install them no point repeating what someone else has done if it works towards your goals if not then add it to your list to begin creating your package.
These would be some good starting points on learning how to configure sublime text as well for me I tend to do it as I go along looking up what I need and building it whether it be a theme or a build system:
packagecontrol.io/docs/submitting_a_package
and
sublimetext.com/docs/3/packages.html
and
sublimetext.com/docs/3/
I use this personally on a unix system and it works well in respect of REPL:
github.com/spywhere/Terminality/ and is more configurable I think...
Sorry if it is not a specific answer as I have never used pydev its difficult for me to make the comparison and I am not sure from your question if you wanted full blown pydev in sublime text or only the features you mentioned?

Python3/MacOSX integration into pycharm

I have had trouble setting up the pycharm ide on my macosx10.7 with python3..
I have scoured every resource available and tried hundreds of approaches, at this point I must accept my incompetence and seek help via this channel.
In my research, I notice a lack of ground-up explanations on python integration into macosx and how to configure pycharm to import modules, run code within the editor, etc. If i ever solve this I will make a very detailed tutorial.
I have imported python3 successfully, it looks like it is linked appropriately from /sys/lib/frameworks to /usr/lib ...etc -- version control is working just fine.
I think my issue is either in setting environmental variables (tried the program to fix this and tried macports) and in the script needed to execute. it will catch errors throughout but final product does not run in python and returns printout of :
/Library/Frameworks/Python.framework/Versions/3.2/bin/python3.2 /Users/anon/Desktop/pythonpractice/Py_Ex/classes.py
Process finished with exit code 0
i really need to get this configuration sound for my python programming class. please help (I've been through every line of pycharm website) .. preferably is there a way to map it via terminal? thanks for anyone who took the time to read this.
Summary of the discussion above:
Python 3.2.2 installation was broken on this Mac, installing ActiveState Python 3.2.2 from scratch and configuring it in PyCharm has fixed the problem.
Python path to be used in PyCharm settings: /Library/Frameworks/Python.framework/Versions/3.2/bin/python3
Incompatible third-party plug-ins may break PyCharm, uninstall/disable them in Preferences | Plugins.
Ensure the latest PyCharm version is installed.
User's code depends on the graphics.py module which was not in the project or in the PYTHONPATH. Putting it into the project has solved the problem.
Most likely the wrong Run/Debug configuration was used in PyCharm, the easiest way to run or debug such scripts is by using the editor context menu Run and Debug actions. PyCharm creates the configuration automatically and debugging works fine as shown of the screenshot:
If one wants to configure and debug it, he can use the code.zip file to get started.
Sorry for the comments mess above, but it was not possible to move it into chat as user had only 1 reputation point, hence not able to use the chat feature of StackOverflow.

Installing a Python program on Linux

I wrote a Python program. I would like to add to it an installation script that will set up everything necessary - like desktop icon, entry in the menu, home directory file, etc.
I'm working on Linux (ubuntu). When a Python program is installed, what needs to happen in general? I know that it probably depends on the nature of the program.
Can you give me some general ideas? Or, point me in the right direction? I have no idea how to look for this on Google.
Thanks
If it's a Python program you're trying to package, you should consider using its 'standard' distribution framework distutils. I can't replicate the entire document here but I'd recommend that you read it. Once you're done with that, check out the Hitchhikers guide to packaging which contains details on distribute - the extensions to distutils that allow you to package and distribute more effectively.
You could create an rpm easily using checkinstall. Search for checkinstall in google and download it. It will allow you to create an rpm and set the options.
For Ubuntu if you want it to be easily distributable to other Ubuntu users it'll have to be packaged properly, which is no simple task. You might want to consult their Packaging Guide for more information.
Otherwise, generally speaking there are a few standard packaging options for Python. Setuptools is popular, but becoming reviled lately. Read James Bennett's blog post "On Packaging" for a decent in-depth look into the ups and downs of the Python packaging world.
How a program is launched and placed in the menu is determined by a .desktop file (you can read the specification or just look at some examples from /usr/share/applications). Properly installing a program (placing all files in the right directories and so on) requires either making a package like a deb or rpm, or you could use something like distutils or setuptools.
It may also help to just look at some (open source) examples of Python programs for Linux.

Eclipse + local CVS + PyDev

I tried several Python IDEs (on Windows platform) but finally I found only Eclipse + PyDev meeting my needs. This set of tools is really comfortable and easy to use. I'm currently working on a quite bigger project. I'd like to have a possibility to use CVS or any other version control system which would be installed on my local harddrive (I recently moved my house and don't have yet an access to internet.)
It doesn't matter for me if it'd be CVS - can also be any other version control system. It'd be great if it will be not too hard to configure with Eclipse. Can anyone give me some possible solution? Any hints?
Regards and thanks in advance for any clues. Please forgive my English ;)
Last time I tried this, Eclipse did not support direct access to local repositories in the same way that command line cvs does because command line cvs has both client and server functionality whereas Eclipse only has client functionality and needs to go through (e.g.) pserver, so you would probably need to have a cvs server running.
Turns out that I didn't really need it anyway as Eclipse keeps its own history of all changes so I only needed to do an occasional manual update to cvs at major milestones.
[Eventually I decided not to use cvs at all with Eclipse under Linux as it got confused by symlinks and started deleting my include files when it "synchronised" with the repository.]
If you don't mind a switch to Subversion, Eclipse has its SubClipse plugin.
As others have indicated, there are plugins available for Eclipse for SVN, Bazar, Mercurial and Git.
Even so, despite their presence, I find using the command line the most comfortable.
svn commit -m 'now committing'
Assuming you are not committing for more than several times a day, this should work well enough. Is there anything specific that is preventing you from using the command line?
I tried Eclipse+Subclipse and Eclipse+Bazaar plugin. Both work very well, but I have found that Tortoise versions of those version source control tools are so good that I resigned from Eclipse plugins. On Windows Tortoise XXX are my choice. They integrate with shell (Explorer or TotalCommander), changes icon overlay if file is changed, shows log, compare revisions etc. etc.
I would definitely recommend switching over to a different VCS—I prefer Mercurial, along with a lot of the Python community. That way, you'll be able to work locally, but still have the ability to publish your changes to the world later.
You can install TortoiseHg for Windows Explorer, and the MercurialEclipse plugin for Eclipse.
There's even a Mercurial for CVS users document to help you change over, and a list of mostly-equivalent commands.
I believe Eclipse does have CVS support built in - or at least it did have when I last used it a couple of years ago.
For further information on how to use CVS with Eclipse see the Eclipse CVS FAQ
I recently moved my house and don't have yet an access to internet.
CVS and SVN are the Centralized Version control systems. Rather than having to install them on your local system just for single version control, you could use DVCS like Mercurial or Git.
When you clone a Mercurial Repository, you have literally all versions of all the repo files available locally.
I use Eclipse with a local CVS repository without issue. The only catch is that you cannot use the ":local:" CVS protocol. Since you're on Windows, I recommend installing TortoiseCVS and then configuring the included CVSNT server as follows:
Control Panel: CVSNT
Repository configuration: create a repository and publish it
Note the Server Name and make sure it matches your hostname
Eclipse: Create a new repository location using the :pserver: connection type and point it to your local hostname
This (or any actual source control system) has the advantage over the Eclipse Local History of being able to associate checkin comments with changes, group changes into change sets, etc. You can use the Eclipse Local History to recover from minor mistakes, but it's no replacement for source control (and expires as well: see Window->Preferences General->Workspace->Local History).

Has anyone tried NetBeans 6.5 Python IDE?

Has anyone tried the NetBeans 6.5 Python IDE?
What are your opinions? Is it better/worse than PyDev? Do you like it? How does it integrate with source control tools (especially Mercurial)?
I will share some of the feelings from using it for quite a while now. Things that are roughly the same quality as in Eclipse+Pydev+mercurial:
editor, code-completion
debugger features
Things that are better:
autoimport
color schemes (Norway today rocks)
Mercurial support (though it is getting better and better in Eclipse)
Things that are worse:
zipped egg packages are not recognized for either code completion or the autoimport
libdyn packages (e.g. datetime) are not recognized
debugger is having trouble with multiprocessing package
you cannot choose file from outside of the project (/usr/bin/paster) to be the main file (this is what I use to debug Pylons applications)
Does anyone have something to add to the list?
BraveSirFoobar, it would be nice to know more about what problems you found -- the very, very slow part, as well as the crash. The first time you run the IDE it will index information about your Python platform and project and libraries - such that it can do quick code completion, go to declaration etc. later - but once that's done it's not supposed to be slow - but there might be bugs.
Mercurial should definitely be supported well, since the NetBeans project itself (and Solaris and Java) are all hosted in Mercurial repositories.
We plan to have really deep support for Python, much in the style of our Ruby support. One of the things which really helped in our Ruby work was the feedback from our early adopters, so if you try Python and have issues with it, please let us know so we can fix it. (Feedback links here: http://wiki.netbeans.org/Python )
-- Tor
Compared to pydev, I found it very, very slow, and it crashed (once) when I created a project from existing sources. It's still beta, though.
Integration with SCMs will be as good as netbeans is already (I only tried subversion, which worked fine).
Feature-wise it was about the same : refactor, debugging, code assist... I'll stick with pydev for the moment, which is IMHO a great tool.
Sun use Mercurial internally now, so expect that their IDE support for it will be top notch.
Having worked with PyDev and PyDev extension for Eclipse for the past few months, the move to NetBeans has been a very pleasurable one.
Without having to hunt all the different plug-ins for PyDev and Eclipse, NetBeans had everything I needed out of the box:
auto completion, super fast index search, style control import control, you name it.
And it seemed LESS bug prone than Eclipse (which is pretty stable).
Also, the built-in Vim like auto code snippets it uses are just fantastic.
IMO, it beats Eclipse hands down.
I'm hooked.
I started using it a little while back and I like it. I usually develop in a simple editor (SciTE), NetBeans is nice to organize larger projects.
wrote about it briefly here
How does it compare with PyDev Extensions? I've recently installed it and, to be honest, couldn't imagine myself going back to PyDev.
NetBeans seems interesting though, if only I wasn't already hooked onto a couple of other Eclipse plug-ins as well.
After looking at this, I decided to go ahead with PyDev than NetBeans.
However best wishes to NetBeans team for a faster and better Python support. Cant wait for that :)

Categories