Search code examples
pythonsetuptoolsfailed-installation

Unable to install python-setuptools: ./configure: No such file or directory


The question is related to the answer to "Unable to install Python without sudo access".

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 I resolve this error?


Solution

  • 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.)