0

I am currently working on a project requiring me to extend Python with a C library, and I will be using SWIG on Ubuntu. Worth noting is that I'm doing this on a computer at my university, and I don't have access to su or sudo commands. In order to generate a wrapper file I enter

gcc -fpic -c output_test.c interface_wrap.c \ -I/usr/bin/Python2.7

This line works perfectly when setting up PyDev on Eclipse, but doesn't work here, which, as far as I can tell from googling the problem, can be solved by installing python-dev. So I downloaded python-dev, v. 2.7.3 for ubuntu and unpacked it. I have been unable to find any guide whatsoever that describes a manual installation of python-dev, so I'm pretty much stuck here. After the unpacking, then what? Looking at the unpacked folders, I am able to find that there are two files in the ~/python-dev/usr/bin-folder:

  • python-config
  • python2-config

Neither is executable. In fact, Ubuntu treats them as broken links. So what am I supposed to do at this point? And why is there such a lack of a comprehensible guides for installing this?

3
  • What do you mean by "unpacking"? Did you try sudo apt-get install python-dev ?
    – ergysdo
    Oct 8, 2013 at 15:23
  • @errokis: He/she isn't allowed to use sudo Oct 8, 2013 at 15:32
  • @FlorianDiesch: I supposed "here" referred to his/her computer.
    – ergysdo
    Oct 8, 2013 at 15:34

1 Answer 1

1

You need some more packages. This should get you all you need (I didn't try to compile anything with it):

apt-get download libpython2.7-dev libpython-dev python2.7-dev python-dev

(you don't need sudo for that).

Now unpack the downloaded .deb files into ~/python-dev (this assumes you don't have any other .deb files in your current working directory):

for i in *.deb; do dpkg -x "$i" ~/python-dev; done

Now everything should be in your ~/python-dev/usr/ tree.

1
  • He should also define to python where to look for the libraries and headers ;)
    – Braiam
    Oct 15, 2013 at 14:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .