0

I'm having some trouble running the ./make command in my debian command line to install python 2.7.2.

I untarred my download from Python.org and ran ./configure which appeared to have worked fine. Unfortunately when I type in ./make I get the following error:

./make: No such file or directory

Not sure why this occurs, but I'd like to get an updated version of python to continue learning the language.

Thanks for your help,

Andy

Andy
  • 1,159
  • 5
  • 15
  • 19

2 Answers2

2

its not ./make

try

"make"

as it is

krisdigitx
  • 7,068
  • 20
  • 61
  • 97
2

When you type ./configure, it runs a executable script in the current directory (labeled with a .) called configure.

Make is an executable file, usually located somewhere like /usr/bin, which uses a file in the directory to run a bunch of commands depending on whether files are up to date.

When you just type make, your shell (the program that handles all your commands and sends their output to the terminal) will go looking through all the directories in the PATH environment variable to find an executable file called make, and run the first one it finds. But, when you type ./make, you're actually telling it to try and run an executable file in the current directory, called make. (It uses this approach, not searching the PATH variable, whenever you put a / in the command.)

You can use the . anywhere you could use a normal directory to specify the same directory, so for example: /usr/bin/././././ is the same as: /usr/bin. Similarly, you can use .. to specify the directory above, so /usr/bin/../bin/../bin/../lib is the same as /usr/lib.

So, after running the configure script located in ./, which generates a so-called makefile, you run the system wide version of make, located where ever, by just typing make, which uses the makefile to build the package.

Also, you can use the which command to find out where the command that'll run when you enter a command by itself - for example, which make.

(Apologies if any of this is condescending, I was going for completism. Also, I may have overused the code tags...)

Aesin
  • 341
  • 2
  • 7
  • I appreciate the response unfortunately just typing make gives me: -bash: make: command not found. Although the information was new to me so thanks for that. – Andy Sep 15 '11 at 20:02
  • I also get an item called Makefile in the python folder. When I type 'Makefile' nothing happens, but when I type ./Makefile I get a 'permission denied' response. I am in the root account. – Andy Sep 15 '11 at 20:07
  • 1
    Unsettling! (That you don't have make, not the other thing. Makefiles aren't supposed to be executed directly.) In that case, the basic build tools may not be installed. Try `sudo apt-get install build-essential`. (You can leave out the 'sudo' if you've temporarily changed to use the root account - but it's generally considered a bad idea to use the root account for day to day stuff, and not just because you can accidentally delete the filesystem.) – Aesin Sep 15 '11 at 20:18
  • Ha! it says can't find package build-essentials. I may just use a different linux distribution. Any suggestions? – Andy Sep 15 '11 at 20:23
  • Before you run off and install a new distro, you may have just added an extra 's'. – Aesin Sep 15 '11 at 20:26
  • Ok so I've run make and it looks like everything installed properly. How do I use 2.7.2 instead of 2.5.x ? – Andy Sep 15 '11 at 20:32
  • Now, generally, you use `sudo make install` - which tells the make command to use a common option in Makefiles that puts all the newly compiled files in the right places. This may overwrite old files, so hopefully nothing depends too hard on it being Python 2.5.x. – Aesin Sep 15 '11 at 20:43
  • Hmm I ran that and it seems to have worked, but when I type in python im still using 2.5.2? appreciate the help by the way. Nevermind were good. just needed to login and logout – Andy Sep 15 '11 at 21:08