Building Mercurial 1.3.1 on Ubuntu Linux

I'm attempting to build mercurial 1.3.1. I've attempted this thus far on my Mac OS X machine and on a Linux Ubuntu virtual machine that I'm running. I keep getting errors while running the make. I...

Retrieving the output of subprocess.call()

How can I get the output of a process run using subprocess.call()? Passing a StringIO.StringIO object to stdout gives this error: Traceback (most recent call last): File "<stdin>", line 1, in...

Python SQLite: database is locked

I'm trying this code: import sqlite connection = sqlite.connect('cache.db') cur = connection.cursor() cur.execute('''create table item (id integer primary key, itemno text unique, ...

Handle mysql restart in SQLAlchemy

My Pylons app uses local MySQL server via SQLAlchemy and python-MySQLdb. When the server is restarted, open pooled connections are apparently closed, but the application doesn't know about this...

Occasional ctypes error importing numpy from mod_wsgi django app

Here's the setup: Django (1.2) app on mod_wsgi that imports ctypes Python 2.6.5 Apache 2.2.3 SELinux disabled RedHat EL 5 64bit some of the file system is mounted over nfs Occasionally, when I...

JSON serialize a dictionary with tuples as key

Is there a way in Python to serialize a dictionary that is using a tuple as key: a = {(1, 2): 'a'} simply using json.dumps(a) produces: Traceback (most recent call last): File "<stdin>", line...

M2Crypto doesn't install in venv, or swig doesn't define __x86_64__ which breaks compiling against OpenSSL

I'm trying to install the Python M2Crypto package into a virtualenv on an x86_64 RHEL 6.1 machine. This process invokes swig, which fails with the following error: $ virtualenv -q...

Handle JSON Decode Error when nothing returned

I am parsing json data. I don't have an issue with parsing and I am using simplejson module. But some api requests returns empty value. Here is my example: { "all" : { "count" : 0, "questions" :...

Python image library

Hi I'm trying to install the python image library at "www.pythonware.com/products/pil" and am getting a couple errors. See terminal below. cfarm:Desktop christopherfarm$ cd...

Something wrong with Frameworks in PIL

When trying to install PIL on mac osx I do sudo python setup.py install and get everything right but the following output. Has this happened to anyone before? running build_ext --- using...

Unable to Install with easy_install or pip on mac

I'm trying to install lxml and pycrypto modules using easy_install (and pip) but getting error messages like Running lxml-2.3.4/setup.py -q bdist_egg --dist-dir...

Where is BeautifulSoup4 hiding?

I did sudo pip install BeautifulSoup4 and got an awfully optimistic response: Downloading/unpacking beautifulsoup4 Running setup.py egg_info for package beautifulsoup4 Installing collected...

Linux Yum Fatal Python error: pycurl: libcurl link-time version is older than compile-time version

So this error is driving me crazy, I've search the web multiple times, ran a few things and no results. I get the following error when using yum. [[email protected] pycurl-7.19.0]# yum update Fatal...

Update a PostgreSQL array using SQLAlchemy

I'm trying to update an integer array on a PostgreSQL table using a SQL statement in SQLAlchemy Core. I first tried using the query generator, but couldn't figure out how to do that either. I...

compile error gcc with Python.h

I am trying to embed python in c++ and I have been playing with some sample code for a while. I was working with boost python interpreter and it works okay but right now I cannot seem to compile...

Difference in details between "make install" and "make altinstall"

Here is my case: I am using Ubuntu 10.04 (Lucid Lynx). The system's default Python is v2.6.5, but I need Python v2.7. So I downloaded the source from python.org and tried to install it. The first...

No usable temporary directory found

I am trying to find a temp directory , but when i am trying to get the directory using tempfile.gettempdir() it's giving me error of File "/usr/lib/python2.6/tempfile.py", line 254, in...

AssertionError: View function mapping is overwriting an existing endpoint function: main

Does anyone know why I can't overwrite an existing endpoint function if i have two url rules like this app.add_url_rule('/', view_func=Main.as_view('main'), ...

How can I specify the version of Python that Perl's Inline::Python module is using?

I am running Debian squeeze and perl v5.10.1 and I have two versions of python installed: $ pyversions -i python2.5 python2.6 Python::Inline uses python2.5 obvoiusly: $ perl use...

Cannot find module cv2 when using OpenCV

I have installed OpenCV on the Occidentalis operating system (a variant of Raspbian) on a Raspberry Pi, using jayrambhia's script found here. It installed version 2.4.5. When I try import cv2 in a...

Getting error while building rpm - File not found by glob:

I am building rpm on RHEL-6/64 bit server. # rpmbuild -bb extras/rpm/neatx.spec RPM build errors: File not found by glob:...

Error when "import matplotlib.pyplot as plt"

I am very new to python. So, my problem might be too simple to be solved. But I cannot. Please help me! I did not have any problem to use "plt", but it suddenly shows error message and does not...

How to fix locale issue in Red Hat distro?

I'm having a strange problem today in my RHEL system. My python script is returning: >>> locale.setlocale(locale.LC_ALL, '') Traceback (most recent call last): File "<stdin>", line 1, in...

Python Pip Install "Egg" Error (Pandas and other modules)

Having issues installing some python modules (for example pandas) and also had some issues installing ipython notebook. This error seems to have come up before for other folks...

Installation of pysftp via pip failed (because of 2 python2.x versions?)

My Ubuntu 10.04 came with Python 2.6. Now, I also installed Python 2.7, which is the system default now because when I start python from the terminal, it starts python 2.7. Now, I want to install...

No module named _cffi_backend

I have python2.6 in my Linux rhel-5. I have installed pip and required CFFI packages. When i try to run a sample CFFI program it says : ffi = FFI() File...

How to let pyenv to find installed python versions

I experience a following contradictory problem with pyenv: $ pyenv global python2.7.10 pyenv: version `python2.7.10' not installed $ pyenv install 2.7.10 pyenv: /Users/xeli/.pyenv/versions/2.7.10...

Matplotlib Polar Plot with Lines

Trying to create a wind rose in Matplotlib using lines instead of bars. In other words, I would like something like this (which was created with Gnuplot) where the lines have a consistent...

Cannot make vim support python

I installed vim in CentOS 6.3. It has python 2.6 by default, and it is under /usr/lib. When I try to install vim following this...

Timeout waiting for privilege escalation prompt

Context I'm asking this question because those two questions/answerse (one and two) have little context, and I'd liket o expand on it. I'm trying to provision CentOS7 production servers with...