1

What

I already have Python 3.4.3 installed but I want to leave that undisturbed and instead use the instructions to install another copy of Python 3 (being Python 3.6).

I'm following the second part of the instructions here : https://askubuntu.com/a/680828/257420 . Specifically I am downloading a version of Python and building it in the /opt directory.

When I execute the 'make' everything seems to work fine but having run the make in /opt/Python-3.6.4 I'm expecting to find a /opt/Python-3.6.4/bin/ and there is no such directory.

So?

Given that I don't have a bin I presume the make has failed ? Or should I be looking somewhere else for the bin because times have changed since the answer I'm following was written ?

Environment

I am attempting to build Python 3.6.4 (https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tar.xz).

This is my env

glaucon@polo ~ $ inxi -S
System:    Host: polo Kernel: 3.13.0-37-generic x86_64 (64 bit) Console: tty 4 Distro: Linux Mint 17.1 Rebecca

EDIT: I have just completed a

find / -name "python3"

while on as root and there was no sign of (for instance) python3.6 .


EDIT2 Here's the output from 'make' on subsequent invocations

polo Python-3.6.4 # make
running build
running build_ext
INFO: Can't locate Tcl/Tk libs and/or headers

Python build finished successfully!
The necessary bits to build these optional modules were not found:
_bz2                  _lzma                 _tkinter
To find the necessary bits, look in setup.py in detect_modules() for the module's name.

The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
atexit                pwd                   time
running build_scripts
copying and adjusting /opt/Python-3.6.4/Tools/scripts/pydoc3 -> build/scripts-3.6
copying and adjusting /opt/Python-3.6.4/Tools/scripts/idle3 -> build/scripts-3.6
copying and adjusting /opt/Python-3.6.4/Tools/scripts/2to3 -> build/scripts-3.6
copying and adjusting /opt/Python-3.6.4/Tools/scripts/pyvenv -> build/scripts-3.6
changing mode of build/scripts-3.6/pydoc3 from 644 to 755
changing mode of build/scripts-3.6/idle3 from 644 to 755
changing mode of build/scripts-3.6/2to3 from 644 to 755
changing mode of build/scripts-3.6/pyvenv from 644 to 755
renaming build/scripts-3.6/pydoc3 to build/scripts-3.6/pydoc3.6
renaming build/scripts-3.6/idle3 to build/scripts-3.6/idle3.6
renaming build/scripts-3.6/2to3 to build/scripts-3.6/2to3-3.6
renaming build/scripts-3.6/pyvenv to build/scripts-3.6/pyvenv-3.6

Unfortunately the output from the first invocation of 'make' is lost and it was significantly different . Once I'm happy that my first attempt at 'make' was completely useless I will delete the /opt/Python3.6.4 directory and repeat the 'make' while capturing the output.

EDIT3 Following information from @unixpower I did a 'make clean' followed by a 'make' and the output from that command is visbile at : https://pastebin.com/Bq04MXA0 .

Unfortunately there still isn't an /opt/Python-3.6.4/bin . Just to confuse matters however I'm almost certain that the 'make' output finished somewhere differently the first time I used it than this last time !

Any comments would be welcome.

glaucon
  • 203
  • 2
  • 11
  • Can you show the output of the make command? – nixpower Jan 08 '18 at 00:38
  • @nixpower : Thanks for your response. I can, and will, add the 'make' output but unfortunately when I run 'make' now the output is significantly different to that when I first ran. When I first ran it there was a lot of output now there's very little as you can see in my 'EDIT2' above. – glaucon Jan 08 '18 at 00:45
  • Yes, since you've already compiled it once, make won't compile again until you make clean and then run make again. – nixpower Jan 08 '18 at 00:49
  • @nixpower : Thanks again. OK I have now done a 'make clean' followed by a 'make' and I have the output. I've put it into https://pastebin.com/Bq04MXA0 as I'm not sure I should add all that stuff to the question. I'll add an EDIT3 to the questions to the question with some comments about this process. Thanks again. – glaucon Jan 08 '18 at 01:03
  • 1
    Did you run the make install command? No files will be copied to /opt/ until your run that command. – Kesara Jan 08 '18 at 02:02
  • 2
    BTW you don't have to run make on /opt/Python-3.6.4, you just have untar all tarball any directory and use ./configure --prefix=<your directory> to tell what directory you need to install files to. – Kesara Jan 08 '18 at 02:05
  • @Kesara OK, that's very embarrassing I hadn't done the 'make install' and once I did that I did have /opt/Python3.6/bin/ . Thanks for your help and sorry to unixpower for wasting your time. – glaucon Jan 08 '18 at 02:18
  • @unixpower - just pinging you to say thanks for your help and I'm sorry it was my stuff up which caused the problem. – glaucon Jan 08 '18 at 02:24
  • 1
    @glaucon Since you've found the solution -- that you must run make install (or sudo make install, depending on where you're installing) to actually install software that you have compiled by running ./configure and make -- I recommend posting it as an answer. – Eliah Kagan Jan 08 '18 at 02:47
  • @EliahKagan - thanks for the suggestion. I would prefer if Kesara got the credit for the answer as it was him that provided the answer to me. I'll ping him and suggest he turns his comment into an answer. If he doesn't reply in 24 hours than I will answer it myself. Thanks for your response. – glaucon Jan 08 '18 at 21:30
  • @Kesara : Would you able to convert your comment about using 'make install' into an answer which I can then mark as the correct answer ? – glaucon Jan 08 '18 at 21:31
  • @glaucon done :) – Kesara Jan 09 '18 at 00:59

1 Answers1

2

Run make install to install files to /opt/Python-3.6.4/.

Files don't have to be compiled on /opt/Python-3.6.4/ to install it there. When running ./configure step, you can provide the target directory as the prefix. Example: ./configure --prefix=<target_directory>

More information: https://askubuntu.com/a/191391/116563

Kesara
  • 196