How to Setup PyDev/Eclipse in Lion? - python

I'm a little bit confused about how to approach this. I had never used OS X before and I don't know how to configure it. After downloading PyDev with Eclipse I go to "Preferences > PyDev > Interpeter - Python > Auto Config" as I would normally do. I select the packages:
image
But then I keep getting this message:
image
I've read somewhere that I should download Xcode to get GCC (which is over a GB), then download and build python with it,... and then start working. But doesn't sound like it makes a lot of sense since Lion already comes with python 2.7.x which is what I'll be using.
Any idea on how could I properly set this up? Thank you all in advance

Well, it may have Python installed, but PyDev wants to be able to view the source of the python files to enable autocompletion.
Install Xcode, yeah. Xcode ships with the developer version of Python, which includes all those .py files. I'm fairly sure that you don't actually need to build Python from scratch (I never had to) - just installing Xcode itself should be enough.

Ideally, install python from http://python.org (there's a mac version download there) and use that version (and don't fiddle much with the version that's installed in mac itself as it's not suitable for development as it doesn't come up with sources and other programs may rely on it, so, if something bad happens and you break it, it won't affect your system).

Related

in python is there a way to show CLI app to someone who doesn’t have python installed

well I made something and want to show it to some of my friends but since they are not into coding they don’t have python installed in their computers is it necessary to download it?
Create your program into an executable so it eliminates the Python installation dependency.
Ref - https://datatofish.com/executable-pyinstaller/

How to uninstall and/or manage multiple versions of python in OS X 10.10.3

I have installed the Python IDE Spyder. For me it's a great development environment.
Some how in this process I have managed to install three versions of Python on my system.These can be located as following:
Version 2.7.6 from the OS X Terminal;
Version 2.7.8 from the Spyder Console; and
Version 2.7.9rc1 from an IDL window.
The problem I have is (I think) that the multiple versions are preventing Spyder from working correctly.
So how do I confirm that 2.7.6 is the latest version supported by Apple and is there a simple way ('silver bullet') to remove other versions from my system.
I hope this is the correct forum for this question. If not I would appreciate suggestions where I could go for help.
I want to keep my life simple and to develop python software in the Spyder IDE. I am not an OS X guru and I really don't want to get into a heavy duty command line action. To that end I just want to delete/uninstall the 'unofficial versions' of Python. Surely there must be an easy way to do this - perhaps 'pip uninstall Python-2.7.9rc1' or some such. The problem is that I am hesitant to try this due to the fear that it will crash my system.
Help on this would be greatly appreciated.
(Spyder dev here) There is no simple way to do what you ask for, at least for the Python version that comes with Spyder.
I imagine you downloaded and installed our DMG package. That package comes with its own Python version as part of the application (along with several important scientific packages), so it can't be removed because that would imply to remove Spyder itself :-)
I don't know how you installed IDL(E?), so I can't advise you on how to remove it.

Python installing PyQt4 module to custom software

This is something I've been researching for past few hours but so far nothing come out of it.
Basically I have software that use Python 2.5.5. It does not have QT module in it.
So in my attempt to install it I did this.
Downloaded executable QT PyQt4-4.10.2-gpl-Py2.7-Qt4.8.4-x64. Run Exe. It installed in python 2.7 site-packages.
Then I moved that folder to my software Python 2.5.5. Now there was no site-packages folder so I created it.
Next step was to go over this instruction http://docs.python.org/2/install/ and use Alternate installation: Windows (the prefix scheme) with my file location from inside program. But I cant run python setup.py install --prefix="\Temp\Python" (with my location of python) because python is not defined and so on. I'm pretty sure thats the wrong way to do it. So how or where do I look for information as to how to do it? The software itself dont have any documentation.
Thanks, bye.
That binary version of PyQt4 only supports python2.7, so no matter what you do, you won't get it to run with python2.5.
The last PyQt4 version with a binary for python2.5 is PyQt4.9.4, so if you want to have any chance of making this work you should try with this version.
Note however that the software you distribute like this will also only run on python2.5.

Opencv 2.2 not recognized on Python 2.7 (Ubuntu/Windows XP)

I've been trying to connect opencv and python in both Ubuntu and Windows XP. I've failed on both.
I've read many webpages and threads about "how to install" it but none has worked (the worst part is that they all say kind of the same).
Steps (windows xp):
Installed Python 2.7 by default (works perfectly)
Installed PIL and cx_Freeze (may they
create a conflict? I don't think so
:s)
Installed Opencv 2.2 by default
(OpenCV-2.2.0-win32-vs2010.exe) and
it isn't recognized inside a py nor
as import opencv.cv nor using the
cookbook way, import cv (I skipped
the visual studio steps since I'll
use it with python)
Checked path (it's ok, it has the
Opencv2.2\bin thing)
Rechecked webpages and stuff
Steps (ubuntu):
Had python working
sudo apt-get install, cmake, make,
sudo make install, etcetc (from the
tutorials)
same thing... module not recognized
Please can you help?
Update:
I managed to install it and have it recognized by the system (I used http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv and it worked perfectly after that).
The problem now is that it crashes when I try to use CaptureFromFile. Someone else has reported it 3 days ago so now I wait.
I'll check the other wrappers, maybe one of them will work.
For windows see my web page: http://www.modernmind.org/wiki/OpenCV
For Ubuntu you should just need to apt-get install python-dev then generate the make files with Cmake, build it and then make install. In order to build the python bindings you need to have the python header files on your system and you probably don't. When you run configure in Cmake make sure that you don't see any messages at the top about PYTHON_INCLUDE not being defined.
To access a library it needs a Python library installed in the Python version you are using. From what you write above it seems to me that you install OpenCV in general, but that you don't specifically install the Python library. This is why it doesn't work.
I'm not sure how to install the Python wrappers, and the OpenCV documentation is a bit sparse on that info. But if you did build them (and that needs to be turned on explicitly, says the docs) they seem to end up in opencv/release/lib .
Look at "Testing Python wrappers" on http://opencv.willowgarage.com/wiki/InstallGuide
If there is still no luck, there is a bunch of alternative Python wrappers available: http://pypi.python.org/pypi?%3Aaction=search&term=opencv&submit=search
Maybe they are better documented.

How to install Python on mac os x and windows with Aptana Studio?

How do I get python to work with aptana studio?
I've downloaded a bunch of stuff, but none of them seem to give me a straight text editor where I can interpret code into an executable type thing. I know there's interactive mode in IDLE, but I want to actually use an editor. So I downloaded the pydev extensions for Aptana studio, but it wants me to configure a python interpreter (so I guess it actually doesn't have one). Where can I find a straight python interpreter that will work with this? or another IDE?
It's easier than you think. First, there's a version of python on your machine by default. It's kind of out of date, though.
MacPorts is a nice method to get lots of good stuff.
ActiveState has a Python Mac package downloadable for free.
Python.org will lead you to some other options as well.
To add the current Python version on Mac:
Add new interpreter via Aptana Studio 3/Preferences/PyDev/Interpreter-Python.
Give it name (check version using the Terminal and then python or /usr/bin/python.
Then add the path (2.7 in my case): /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python
If you install your own (2.6 in my case) use the following path instead:
/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python
Don't forget to hit the "Apply" button...
Idle has a complete text editor -- open a "new window" and type away. Be sure to save it before you run it.
What didn't you like about the IDLE editor?
Also, look at Komodo Edit for Mac OS X. Very nice.
For windows, I'd recommend the aforementioned ActivePython. Mainly because it comes with Python win32, which you're going to end up installing anyway.
Secondly, if you're coming from the world of Java and C#, you might be expecting too much out of your IDE. I eventually found that more powerful IDEs just made things more difficult than they helped. So my advice is to try to go with something simple. In other words, go with something that will let you jump in and start coding rather than bugging you with a lot of features you probably won't need anyway. :-)
EDIT: One other thing, find and install pip. It makes installing python packages so much easier.
A lot of the sites in the Windows list mirror the Mac list.
Python.org has Win32 and Win64 installers.
ActiveState has a free Python Win32 package downloadable for free. There is no Win64 version (yet?).
PyWin32 is a Python package with extra modules for interfacing with Windows. This is not Python itself. These haven't been updated for Python 3.0, though. Despite the name, there is a Win64 version for Python 2.6 on this site.
On Mac OS X Leopard and Tiger, Python is already installed.
On Mac, I've tried a few editor. Textmate is my current choice. If you're looking for a free one, I really liked Xcode. But you'll have to run your script from the command line.
If you want a cross-platform environment, you could try Eclipse and the pydev extension. So you don't get lost between the two platform.
For Windows Operating system,
If you want to work with python using Aptana Studio. You have to do some simple basic settings with the interpreter.
For detailed step by step guide. You can follow this website link
http://www.infoknol.com/aptana-python-setup-guide/

Categories