I’ve installed debian 10 on server.
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
ID=debian
arch: x86_64
It had python version 3.7.3 installed on it, so i tried to update it to version 3.8.5 and I want to use checkinstall..
I add backports repo in sources.list and install checkinstall:
# install checkinstall
sudo apt install checkinstall
sudo apt update
then I get python:
# download python in tar.xz
cd /opt
curl -O https://www.python.org/ftp/python/3.8.5/Python-3.8.5.tar.xz
tar -xf Python-3.8.5.tar.xz
cd Python-3.8.5
but when I try this
./configure --enable-optimizations
make
# Use the -n flag on make for your target and pipe to shell script
make -n altinstall > altinstall_script.sh
# run checkinstall with that shell script
chmod +x altinstall_script.sh
# and install
sudo checkinstall ./altinstall_script.sh --install
I get error:
Python build finished successfully!
The necessary bits to build these optional modules were not found:
_dbm
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
running build_scripts
copying and adjusting /opt/Python-3.8.5/Tools/scripts/pydoc3 -> build/scripts-3.8
copying and adjusting /opt/Python-3.8.5/Tools/scripts/idle3 -> build/scripts-3.8
copying and adjusting /opt/Python-3.8.5/Tools/scripts/2to3 -> build/scripts-3.8
changing mode of build/scripts-3.8/pydoc3 from 644 to 755
changing mode of build/scripts-3.8/idle3 from 644 to 755
changing mode of build/scripts-3.8/2to3 from 644 to 755
renaming build/scripts-3.8/pydoc3 to build/scripts-3.8/pydoc3.8
renaming build/scripts-3.8/idle3 to build/scripts-3.8/idle3.8
renaming build/scripts-3.8/2to3 to build/scripts-3.8/2to3-3.8
running install_lib
copying build/lib.linux-x86_64-3.8/_multibytecodec.cpython-38-x86_64-linux-gnu.so -> /usr/local/lib/python3.8/lib-dynload
error: [Errno 2] No such file or directory
rm: cannot remove '/usr/local/lib/python3.8/lib-dynload/_sysconfigdata__linux_x86_64-linux-gnu.py': No such file or directory
rm: cannot remove '/usr/local/lib/python3.8/lib-dynload/__pycache__': No such file or directory
Creating directory /usr/local/share/man/man1
Looking in links: /tmp/tmpaf3jv392
Processing /tmp/tmpaf3jv392/setuptools-47.1.0-py3-none-any.whl
Processing /tmp/tmpaf3jv392/pip-20.1.1-py2.py3-none-any.whl
Installing collected packages: setuptools, pip
ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory
C
2
Answers
This seemed to work for me: install pyenv and use this for install python3.8.5.
I ran the following commands:
Maybe, you need also install dependencies:
I think you made a mistake in listing the version you want to install it to look at this guide for more information –
https://linuxize.com/post/how-to-install-python-3-8-on-debian-10/
Adding this piece of code should help.