Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Problem installing Python on Debian 10.8

Programming languages, Coding, Executables, Package Creation, and Scripting.
Post Reply
Message
Author
User avatar
serviteccompleto
Posts: 14
Joined: 2021-03-05 07:01
Has thanked: 2 times

Problem installing Python on Debian 10.8

#1 Post by serviteccompleto »

Hi, I am a newbie one on GNU/Linux world, and at the same time in the programming world also, I fallowed the instructions for installing the version 3.9.1 of Python, I committed an error when accessing the commands as fallows:
after
/configure --enable-optimizations
I entered
make -j 2 (but I have 4 cores)

And when I tried
make -j 4
It showed:

Rebuilding with profile guided optimizations:
rm -f profile-clean-stamp
make build_all CFLAGS_NODIST=" -fprofile-use -fprofile-correction" LDFLAGS_NODIST=""
make[1]: Entering directory '/home/hannier/Python-3.9.1'
CC='gcc -pthread' LDSHARED='gcc -pthread -shared ' OPT='-DNDEBUG -g -fwrapv -O3 -Wall' _TCLTK_INCLUDES='' _TCLTK_LIBS='' ./python -E ./setup.py build
running build
running build_ext
INFO: Can't locate Tcl/Tk libs and/or headers
building 'zlib' extension
gcc -pthread -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden -fprofile-use -fprofile-correction -I./Include/internal -I./Include -I. -I/usr/include/x86_64-linux-gnu -I/usr/local/include -I/home/hannier/Python-3.9.1/Include -I/home/hannier/Python-3.9.1 -c /home/hannier/Python-3.9.1/Modules/zlibmodule.c -o build/temp.linux-x86_64-3.9/home/hannier/Python-3.9.1/Modules/zlibmodule.o
building '_ctypes' extension
gcc -pthread -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden -fprofile-use -fprofile-correction -I./Include/internal -I./Include -I. -I/usr/include/x86_64-linux-gnu -I/usr/local/include -I/home/hannier/Python-3.9.1/Include -I/home/hannier/Python-3.9.1 -c /home/hannier/Python-3.9.1/Modules/_ctypes/_ctypes.c -o build/temp.linux-x86_64-3.9/home/hannier/Python-3.9.1/Modules/_ctypes/_ctypes.o -DPy_BUILD_CORE_MODULE
/home/hannier/Python-3.9.1/Modules/_ctypes/_ctypes.c:107:10: fatal error: ffi.h: No such file or directory
#include <ffi.h>
^~~~~~~
compilation terminated.
gcc -pthread -shared build/temp.linux-x86_64-3.9/home/hannier/Python-3.9.1/Modules/zlibmodule.o -L/usr/lib/x86_64-linux-gnu -L/usr/local/lib -lz -o build/lib.linux-x86_64-3.9/zlib.cpython-39-x86_64-linux-gnu.so

Python build finished successfully!
The necessary bits to build these optional modules were not found:
_bz2 _dbm _gdbm
_hashlib _lzma _sqlite3
_ssl _tkinter _uuid
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:
_abc atexit pwd
time


Failed to build these modules:
_ctypes


Could not build the ssl module!
Python requires an OpenSSL 1.0.2 or 1.1 compatible libssl with X509_VERIFY_PARAM_set1_host().
LibreSSL 2.6.4 and earlier do not provide the necessary APIs, https://github.com/libressl-portable/po ... issues/381

running build_scripts
copying and adjusting /home/hannier/Python-3.9.1/Tools/scripts/pydoc3 -> build/scripts-3.9
copying and adjusting /home/hannier/Python-3.9.1/Tools/scripts/idle3 -> build/scripts-3.9
copying and adjusting /home/hannier/Python-3.9.1/Tools/scripts/2to3 -> build/scripts-3.9
changing mode of build/scripts-3.9/pydoc3 from 644 to 755
changing mode of build/scripts-3.9/idle3 from 644 to 755
changing mode of build/scripts-3.9/2to3 from 644 to 755
renaming build/scripts-3.9/pydoc3 to build/scripts-3.9/pydoc3.9
renaming build/scripts-3.9/idle3 to build/scripts-3.9/idle3.9
renaming build/scripts-3.9/2to3 to build/scripts-3.9/2to3-3.9
make[1]: Leaving directory '/home/hannier/Python-3.9.1'[/color]


And if I fallow the next command:

sudo make alt install (or sudo make altinstall)

it shows:
make: *** No rule to make target 'alt'. Stop.

So I don't know what I did wrong and how to fix this up, or in any case whats the best method to install the last compatible Python version on last version of Debian please any help will be welcome, thank you.

User avatar
sunrat
Administrator
Administrator
Posts: 6412
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 462 times

Re: Problem installing Python on Debian 10.8

#2 Post by sunrat »

What version of Debian do you have? And do you really need python3.9? Buster has 3.7 and Testing and Unstable have 3.9.
Usually one would install packages from the Debian repository which is really easy. You have chosen the really hard way. Search for Debian package management in the wiki.
Last edited by sunrat on 2021-03-05 20:41, edited 1 time in total.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

reinob
Posts: 1189
Joined: 2014-06-30 11:42
Has thanked: 97 times
Been thanked: 47 times

Re: Problem installing Python on Debian 10.8

#3 Post by reinob »

make should work equally regardless of "-j 2" or "-j 4" or nothing.
If you think that your problem is due to restarting make, then just "make clean" and then "make -j4".

If it fails, then hopefully you'll now how to fix the error, but it sure won't be make's fault :)

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Problem installing Python on Debian 10.8

#4 Post by Head_on_a_Stick »

Perhaps try backporting v3.9 from Debian bullseye instead: https://wiki.debian.org/SimpleBackportCreation
deadbang

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: Problem installing Python on Debian 10.8

#5 Post by stevepusser »

Since Python 3 is an essential part of the system, I wouldn't test that backport on any install you really care to keep.

Are you really leaving a space between the "j" and the number of threads desired? ("-j 2" instead of "-j2")

Anyway, you can also use "-jauto" to automatically use 100% of your cores. This is not recommended if your machine has overheating issues under load.
MX Linux packager and developer

User avatar
serviteccompleto
Posts: 14
Joined: 2021-03-05 07:01
Has thanked: 2 times

Re: Problem installing Python on Debian 10.8

#6 Post by serviteccompleto »

sunrat wrote:What version of Debian do you have? And do you really need python3.9? Buster has 3.7 and Testing and Unstable have 3.9.
Usually one would install packages from the Debian repository which is really easy. You have chosen the really hard way. Search for Debian package management in the wiki.

Thank you for replaying my question, with your information now I understand there's a easier way for installing "programs" through the repository manager, I'm not sure but in my case I suppose that function is made by Discover, exactly as you mentioned I have the 3.7 version of Python and navigating the Discovery tool I found an application called Thonny which is a Python IDE for beginners so it seems to be what I needed.

User avatar
serviteccompleto
Posts: 14
Joined: 2021-03-05 07:01
Has thanked: 2 times

Re: Problem installing Python on Debian 10.8

#7 Post by serviteccompleto »

Head_on_a_Stick wrote:Perhaps try backporting v3.9 from Debian bullseye instead: https://wiki.debian.org/SimpleBackportCreation

Now that I'm clear there's already installed the version 3.7 on Debian and that additionally Ive found the Thonny program (a Python IDE), Ill try with these, taking into account I'm just crawling about these topics (I am beginning learning how to use GNU/Linux and programming), thank you very much.

User avatar
serviteccompleto
Posts: 14
Joined: 2021-03-05 07:01
Has thanked: 2 times

Re: Problem installing Python on Debian 10.8

#8 Post by serviteccompleto »

sunrat wrote:What version of Debian do you have? And do you really need python3.9? Buster has 3.7 and Testing and Unstable have 3.9.
Usually one would install packages from the Debian repository which is really easy. You have chosen the really hard way. Search for Debian package management in the wiki.

Really appreciated, the below replies show I didn't know Python was included on the system already, and additionally Ive found a complementary program to help my starting journey about the programming world, thank you very much!

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Problem installing Python on Debian 10.8

#9 Post by Head_on_a_Stick »

stevepusser wrote:Since Python 3 is an essential part of the system, I wouldn't test that backport on any install you really care to keep.
But backporting glibc is fine, eh? :mrgreen:

In all seriousness, that is a very good point. My advice is always given with the expectation that the system is fully backed up because what sort of idiot wouldn't do that? Remember kids: always have a backup!
deadbang

Post Reply