views:

607

answers:

2

The question is related to the post.

I need to install python-setuptools to install python modules. I have extracted the installation package.

I get the following error when configuring

[~/wepapps/pythonModules/setuptools-0.6c9]# ./configure --prefix=/home/masi/.local
-bash: ./configure: No such file or directory

I did not find the solution at the program's homepage.

How can you solve the problem?

+1  A: 

You might want to check http://peak.telecommunity.com/DevCenter/EasyInstall#custom-installation-locations.

EasyInstall is a python module with some shell scripts (or some shell scripts with a python module?) and does not use the unix make tool that gets configured with the "./configure" command. It looks like your best bet is to try editing ~/.pydistutils.cfg to include:

[install]
install_lib = /home/masi/.local/lib/python/site-packages/
install_scripts = /home/masi/.local/bin

You'll also presumably have made the ~/.local/bin/ folder part of your PATH so you can run the easy_install script. (I'm not sure exactly where the site-packages directory will be under .local, but it shouldn't be hard to find.)

Hope this helps.

Noah
In my case, the first command needs to be install_lib = /home/masi/.local/lib/python2.6/site-packages
Masi
+2  A: 

As Noah states, setuptools isn't an automake package so doesn't use ‘./configure’. Instead it's a pure-Python-style ‘setup.py’ (distutils) script.

You shouldn't normally need to play with .pydistutils.cfg, as long as you run it with the right version of Python. So if you haven't added the .local/bin folder to PATH, you'd have to say explicitly:

/home/masi/.local/bin/python setup.py install

AIUI this should Just Work.

I did not find the solution at the program's homepage.

Yeah, they want you to install it from a shell script egg which uses the default version of Python. Which you don't want.

(Another approach if you can't get setuptools to work is to skip it and install each module and dependency manually. Personally I have a bit of an aversion to setuptools/egg, as it contains far too much “clever” magic for my tastes and makes a mess of my filesystem. But I'm an old curmudgeon like that. Most Python modules can be obtained as simple Python files or plain old distutils scripts, but unfortunately there are some that demand eggs.)

bobince
Oh, yeah, setup.py uses distutils :)
Noah
Thank you! Your command works :)
Masi