I need to debug cython code. Official documentation says, I need to install "gdb 7.2 or higher, built with Python support". Unfortunately I didn't find any step-by-step guide how to install it on Windows 7. Do I have to build it myself (how?) or there already exists an installer for Windows 7, 64 bit? Any help would be greatly appreciated.
I use Windows 7, Python 2.7 64bit and Visual Studio 2008.
Also suggestions about alternative ways to debug cython (especially concerning non-console visual debuggers) are welcome. Thanks in advance for your help!
As with all GNU projects, GDB is provided as source code. The good news is that this means it can be built to run on practically any platform. The bad news is that, unless someone has already figured the process out for you, you have to do it yourself. GDB will be provided built-in on virtually any Linux distribution, but with Windows you're on your own.
You basically have three options:
Move development (or at least debugging) over to Linux. This isn't as hard as it sounds. You can easily run Linux within a virtual machine inside Windows using VirtualBox, which is free software under GPL.
Do debugging using a Cygwin shell inside windows. Cygwin is free under the GPL and allows you to run a Linux-like environment in Windows. It includes most of the GNU software, including the latest release of GDB.
If you're feeling particularily adventurous, you could try to compile GDB yourself to work on your Windows system. This is by far the hardest route, and only for someone familiar with programming on Windows platforms.
In the end, I would strongly recommend using Linux for any serious Python development, especially when using Python extensions that do not have large developer communities.
Hi
I just want to install mercurial but for all versions it needs python 2.6, I tried to use .rpm file but the only thing I got is lots of lines full of error which tells: need old versions before 2.6 and after 2.5 which is installed on my linux. any help would be appreciated.
Bests
Go to ActiveState and download their versions: https://www.activestate.com/activepython/downloads
It's much easier than using the .rpms.
Which distribution are you using? I would recommend you to upgrade your system to a newer version of your linux distro, whatever it is. Modern Linux distros are using at least python2.6 now.
If you do not want to upgrade your system with various reasons, ActiveState's python version as stated in Jasie's answer is good for your cause. It installs python in your system without breaking anything, just you have to add some lines in your .bashrc to force system find your ActiveState python installation before the system's python.
Another alternative would be installing earlier version of mercurial which supports the python version installed on your system. But I would not recommend you to do so..
Among these, my suggestion is upgrading your system to a merely "up-to-date" version, so that python2.6 or higher is installed on your system.
I'm wondering how I can create a 32-bit binary with my 64bit cx_freeze. I've looked at the homepage and I can't find a setting to tell it what architecture to build for.
I'm running 32bit(otherwise PyQt won't work) Python 2.6, so the dependencies should already be 32bit, on 64bit Kubuntu 10.10.
If you were using Windows or a Mac, then you could use py2exe or py2app, respectively. I think that freeze may be a more general solution that may work for you.
Maybe this link will help you: http://linux.die.net/man/8/linux32
Otherwise you can create a x32 virtual machine by using QEmu or VirtualBox...
I have a pyqt project for which I used to distribute frozen apps before just releasing it open source, for win/linux/osx.
I used the following:
Pyinstaller for linux
Py2app for osx
Py2exe for windows
http://www.pyinstaller.org/
I've been using MacPorts Python 2.6 on OS X 10.6.
I am considering also installing the Enthought Python Distribution (EPD) on the same machine because it comes preconfigured with matplotlib and other nice data analysis and visualization packages.
Can the two Python distributions co-exist peacefully on the same machine?
What potential problems will I have to look out for (e.g., environment variables)?
I know that building matplotlib through MacPorts is an option, but the process is lengthy (on the order of a full day) and there are open questions about compiling some dependencies on 64bit Intel.
I would like to know about the tradeoffs before committing to one of the two approaches.
I'm not an OSX user, so I can't say for certain, but you should be fine.
EPD bundles its own python interpreter and all required libraries. The installer basically just extracts a tarball into a stand-alone folder.
The linux installer doesn't modify any environment variables (not even $PATH), so I assume the mac installer is similar.
(Because of this, you'll probably want to manually set up aliases to the EPD python/ipython/etc binaries so you can more easily call them without changing your $PATH.)
EPD really should be completely stand-alone, as far as I know. It should be safe to install along-side anything else.
I've used EPD on Windows 7. It works great. Only stalled on me a couple of times with rather large data set.
I also use OSX, and was about to install EPD but hesitating a bit.
I think python 2.7.3 that comes with EPD (early 2013) will become the default python. Normally, upgrading to 2.7 from 2.6 should not be much of problem based on my personal experience. But I am a bit concerned to have 2 versions of 2.7 and what kind of impact it will have on using GAE SDK on my OSX. (Upgrading created a bit of hassle with GAE SKD.)
Here is what EPD readme says:
A full installation will install the following:
* Python framework -- installed into:
/Library/Frameworks/Python.framework/Versions/7.3
Python applications -- installed into
/Applications/Enthought
System fixes -- makes the EPD Python your default one by adding lines to
your .bash_profile to your path.
I think I will sleep on this.
Which linux distro is better suited for Python web development?
Background:
I currently develop on Windows and it's fine, but I am looking to move my core Python development to Linux. I'm sure most any distro will work fine, but does anyone have any reasons to believe one distro is better than another?
Largely distribution won't matter, as Python is present and largely self sufficient on virtually all Linux distributions.
If you're wanting to focus on development, I'd recommend Ubuntu. Ubuntu is arguably one of the most fully featured "ready for the user" distributions that makes system administration a snap, so you can focus on the development tasks you want to tackle.
If you have a Linux environment that's a target for your code (like say, RedHat or something), then go with the desktop distribution that matches your target environment (like, say, Fedora for RedHat, Gentoo for Gentoo, Ubuntu for Ubuntu Server, etc.)
Otherwise, all of them are suitable.
You distribution should have Python 2.6. Otherwise it's a matter of choice.
One advice: Never ever install anything as root (eg. python setup.py install). Only install things with your distribution's package manager and use virtualenv as a user to install other packages.
Ubuntu has a virtualenv package and it can even be used without being installed.
Using a distribution with the latest stable versions of Python only lets you test your code with those versions. Today it's very easy for developers to test their code with multiple Python versions.
Gentoo probably gives you the most flexibility with multiple Python versions installed at once:
(2.5) 2.5.4-r4
(2.6) 2.6.6-r2 or 2.6.7-r2
(2.7) 2.7.2-r3
(3.1) 3.1.4-r3
(3.2) 3.2.2
That doesn't let you test on some older versions that are very popular on Debian based systems, for example.
pythonbrew lets you compile and install multiple Python versions in your home directory, no root access needed.
It's a snap testing your code with multiple versions of Python thanks to 'tox'. By default, tox will find your system python(s), but you can set custom interpreters you build with pythonbrew, for example.
Here's a tox.ini you can use with Jenkins, for continuous integration. With this setup you can install jenkins then 'su - jenkins' and use pythonbrew to install all the Python versions you want to test.
[tox]
envlist = py267,py271,py272
[testenv]
#You may need to change this. Are your tests here?
changedir=tests
#You can also use nose, etc., see documentation
deps=pytest
commands=py.test --junitxml=junit-{envname}.xml
[testenv:py272]
basepython=/var/lib/jenkins/.pythonbrew/pythons/Python-2.7.2/bin/python2.7
[testenv:py271]
basepython=/var/lib/jenkins/.pythonbrew/pythons/Python-2.7.1/bin/python2.7
[testenv:py267]
basepython=/var/lib/jenkins/.pythonbrew/pythons/Python-2.6.7/bin/python2.6
It's that easy, and it doesn't matter which Linux distribution you use.
See the Tox website for details on configuring Jenkins.
I use RHEL and have been very happy, so from that I would say Fedora would be fine. I use Debian at home, and it's great (headless though, so no web there).
That said, I think you should probably just pick one based on what your company uses, or any number of non-Python reasons. I don't think you are going to find Python tool availability an issue with any Linux distribution.
Most major distributions will include Python and Apache, so it's really just a matter of choice. If you're new to Linux, I'd suggest either Ubuntu or Fedora. Both are great for new users and have excellent community support.
As the other answers have mentioned so far, the Python 2.6 interpreter will be available on all recent Linux distribution releases. That shouldn't influence your choice.
However, your choice of IDE may eliminate some possibilities. You should make sure the distribution you select has a package for the latest version of your IDE, and that it is updated often enough.
As an example, I like to use Eclipse with PyDev for developing Python apps in either OS, but Ubuntu's official repositories had only Eclipse 3.2 (from 2006) until October of last year, when they finally updated to 3.5 in the latest distribution.
I am working with Python on Cento 5.4 and Fedora 12 and I am very happy.
I also use Eclipse IDE for python and other languages without having any major issues.
Any desktop distribution like Ubuntu, OpenSUSE, Fedora, ... is OK, But if you want to always have the latest versions, I recommend ArchLinux.
i think i remember a podcast with Guido Van Rossum and his core team python developers back in the days, and one of that core python developer is now employed by Canonical to take care of python integration for the ubuntu distro. So that explains why ubuntu is a much more pythonic distro compared to other distro.
On the other hand, the gentoo linux distro also has python integrated in its Portage package management system. So gentoo and ubuntu I would say are good for python development system and each represent both ends of the spectrum.