Terminal didn't install the Python version I wanted

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
cessnat37
Level 2
Level 2
Posts: 80
Joined: Tue Jan 03, 2017 4:31 pm

Terminal didn't install the Python version I wanted

Post by cessnat37 »

Hello,

I have Linux Mint 18. I wanted to install Python 3.9.13 tonight, which I downloaded from the Python website.Then I extracted it.
When the install finished on terminal, I noticed it installed Python version 3.5.1 instead. What happened?

Code: Select all

dave@dave-Z170XP-SLI ~ $ sudo apt install python3.9

Code: Select all

dave@dave-Z170XP-SLI ~ $ python3.9 --version
No command 'python3.9' found, did you mean:
 Command 'python3.5' from package 'python3.5-minimal' (main)
python3.9: command not found

Code: Select all

dave@dave-Z170XP-SLI ~ $ python3.9.13 --version
python3.9.13: command not found[/code9
[code]dave@dave-Z170XP-SLI ~ $ python3.5 --version
Python 3.5.1+
Last edited by LockBot on Sun Jan 01, 2023 11:00 pm, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
xenopeek
Level 25
Level 25
Posts: 29597
Joined: Wed Jul 06, 2011 3:58 am

Re: Terminal didn't install the Python version I wanted

Post by xenopeek »

Linux Mint 18 has reached end of life April last year. It is no longer supported and should be considered unsafe to use online, for one because you're not getting security updates for the web browser. Before you spend a lot of time trying to untangle this Python question I suggest you consider if it is not time to upgrade to a supported Linux Mint version. apt install python3.9 works on Linux Mint 20.3 and upcoming Linux Mint 21 (a beta likely this month) has Python 3.10 as default.

You won't be able to apt install python3.9 on Linux Mint 18 and AFAIK the Python website only has source code downloads for Linux, not an installable package. If you want to go that route you'll have to compile it from source yourself.
Image
User avatar
spamegg
Level 14
Level 14
Posts: 5049
Joined: Mon Oct 28, 2019 2:34 am
Contact:

Re: Terminal didn't install the Python version I wanted

Post by spamegg »

Hello cessnat37
1. You should not be using Mint 18, it stopped receiving updates more than a year ago! It's not safe anymore.
2. Can you share your system info? We need the output of the Terminal command inxi -Fxxmprz
3. How did you install Python 3.9? What file did you download (links please), what command did you run in the Terminal to install it?
4. Generally it's not a good idea to manually install different Python versions because the system depends on Python, so you can break your system.
O-rion
Level 3
Level 3
Posts: 137
Joined: Sun Feb 15, 2015 3:05 pm

Re: Terminal didn't install the Python version I wanted

Post by O-rion »

If you really need a specific python version - think about installing anaconda
Linux Mint 20.1 MATE
Cosmo.
Level 24
Level 24
Posts: 22968
Joined: Sat Dec 06, 2014 7:34 am

Re: Terminal didn't install the Python version I wanted

Post by Cosmo. »

I wonder, why a user with a system, that got no updates for 15 months, needs a new python version?.
cessnat37
Level 2
Level 2
Posts: 80
Joined: Tue Jan 03, 2017 4:31 pm

Re: Terminal didn't install the Python version I wanted

Post by cessnat37 »

That's what I thought. Yes I agree. I need to install a current version. I downloaded this off the Python.org website
https://www.python.org/downloads/release/python-3913/

I used this command: sudo apt install python3.9. The install completed.

I'll run inxi -Fxxmprz command when I get home from work.
User avatar
xenopeek
Level 25
Level 25
Posts: 29597
Joined: Wed Jul 06, 2011 3:58 am

Re: Terminal didn't install the Python version I wanted

Post by xenopeek »

cessnat37 wrote: Fri Jul 01, 2022 11:39 am I downloaded this off the Python.org website
https://www.python.org/downloads/release/python-3913/

I used this command: sudo apt install python3.9. The install completed.
But those two things have nothing to do with each other. The apt install command download and installs from the software repositories. It can't compile source code for you, that you downloaded from the website.

If the command completed what does apt version python3.9 say? If blank what does dpkg -l | grep python3 answer.

Are you maybe not on Linux Mint 18 but since on a newer version? Share output of inxi -Sr command.
Image
cessnat37
Level 2
Level 2
Posts: 80
Joined: Tue Jan 03, 2017 4:31 pm

Re: Terminal didn't install the Python version I wanted

Post by cessnat37 »

Ok. I see what you're saying. apt install downloads it from software repositories that are already present in the operating system.

I'll run these commands you all suggested, when I get home from work tonight. And I'll report back. I'll also plan on updating to Linux 20 if needed.

(I'm learning Python for my job)
cessnat37
Level 2
Level 2
Posts: 80
Joined: Tue Jan 03, 2017 4:31 pm

Re: Terminal didn't install the Python version I wanted

Post by cessnat37 »

I ran all the commands (emboldened) you asked for with the results


Code: Select all

dave@dave-Z170XP-SLI ~ $ apt version python3.9

Code: Select all

dave@dave-Z170XP-SLI ~ $ dpkg -l | grep python3
Minimal subset of the Python language (version 3.5)

Code: Select all

dave@dave-Z170XP-SLI ~ $ inxi -Sr
System:    Host: dave-Z170XP-SLI Kernel: 4.4.0-21-generic x86_64 (64 bit)
           Desktop: Cinnamon 3.0.6  Distro: Linux Mint 18 Sarah
Repos:     Active apt sources in file: /etc/apt/sources.list.d/deadsnakes-ppa-xenial.list
           deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu xenial main
           deb-src http://ppa.launchpad.net/deadsnakes/ppa/ubuntu xenial main
           Active apt sources in file: /etc/apt/sources.list.d/google-chrome.list
           deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
           Active apt sources in file: /etc/apt/sources.list.d/official-package-repositories.list
           deb http://packages.linuxmint.com sarah main upstream import backport #id:linuxmint_main
           deb http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse
           deb http://archive.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse
           deb http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse
           deb http://security.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
           deb http://archive.canonical.com/ubuntu/ xenial partner

Code: Select all

inxi -Fxxmprz
System:    Host: dave-Z170XP-SLI Kernel: 4.4.0-21-generic x86_64 (64 bit gcc: 5.3.1)
           Desktop: Cinnamon 3.0.6 (Gtk 3.18.9-1ubuntu3) dm: mdm Distro: Linux Mint 18 Sarah
Machine:   System: Gigabyte product: Z170XP-SLI
           Mobo: Gigabyte model: Z170XP-SLI-CF v: x.x Bios: American Megatrends v: F6 date: 03/07/2016
CPU:       Dual core Intel Core i3-6100 (-HT-MCP-) cache: 3072 KB
           flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 14785
           clock speeds: min/max: 800/3700 MHz 1: 799 MHz 2: 984 MHz 3: 799 MHz 4: 799 MHz
Memory:    No dmidecode memory data: try newer kernel.
Graphics:  Card: Intel HD Graphics 530 bus-ID: 00:02.0 chip-ID: 8086:1912
           Display Server: X.Org 1.18.3 drivers: intel (unloaded: fbdev,vesa) Resolution: 1920x1080@60.00hz
           GLX Renderer: Mesa DRI Intel HD Graphics 530 (Skylake GT2)
           GLX Version: 3.0 Mesa 11.2.0 Direct Rendering: Yes
Audio:     Card Intel 100 Series/C230 Series Family HD Audio Controller
           driver: snd_hda_intel bus-ID: 00:1f.3 chip-ID: 8086:a170
           Sound: Advanced Linux Sound Architecture v: k4.4.0-21-generic
Network:   Card: Intel Ethernet Connection (2) I219-V
           driver: e1000e v: 3.2.6-k bus-ID: 00:1f.6 chip-ID: 8086:15b8
           IF: enp0s31f6 state: down mac: <filter>
Drives:    HDD Total Size: 500.1GB (5.3% used)
           ID-1: /dev/nvme0n1 model: N/A size: 500.1GB serial: S3EUNX0J813105K
           ID-2: /dev/sda model: WDC_WD5003AZEX size: 500.1GB serial: WD-WCC3F3TS3AAD
Partition: ID-1: / size: 443G used: 9.8G (3%) fs: ext4 dev: /dev/sda1
           ID-2: swap-1 size: 17.05GB used: 0.00GB (0%) fs: swap dev: /dev/sda5
RAID:      System: supported: N/A
           No RAID devices: /proc/mdstat, md_mod kernel module present
           Unused Devices: none
Sensors:   System Temperatures: cpu: 29.8C mobo: 27.8C
           Fan Speeds (in rpm): cpu: N/A
Repos:     Active apt sources in file: /etc/apt/sources.list.d/deadsnakes-ppa-xenial.list
           deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu xenial main
           deb-src http://ppa.launchpad.net/deadsnakes/ppa/ubuntu xenial main
           Active apt sources in file: /etc/apt/sources.list.d/google-chrome.list
           deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
           Active apt sources in file: /etc/apt/sources.list.d/official-package-repositories.list
           deb http://packages.linuxmint.com sarah main upstream import backport #id:linuxmint_main
           deb http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse
           deb http://archive.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse
           deb http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse
           deb http://security.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
           deb http://archive.canonical.com/ubuntu/ xenial partner
Info:      Processes: 207 Uptime: 38 min Memory: 908.5/15925.3MB
           Init: systemd v: 229 runlevel: 5 default: 2 Gcc sys: 5.4.0
           Client: Shell (bash 4.3.421 running in gnome-terminal-) inxi: 2.2.35
Last edited by karlchen on Sun Jul 03, 2022 6:52 am, edited 1 time in total.
Reason: applied [code] [/code] tags around terminal commands and their output, preserves proper terminal screen formatting
User avatar
xenopeek
Level 25
Level 25
Posts: 29597
Joined: Wed Jul 06, 2011 3:58 am

Re: Terminal didn't install the Python version I wanted

Post by xenopeek »

There's no python3.9 installed. That's clear. The deadsnakes PPA you have also no longer supports your Linux Mint version.

Does apt policy python3.9 even offer a version of that package?

You didn't share what apt install python3.9 command output. Just that it worked. It doesn't look like it did. If you run it again what is the exact and complete output of the command, after you enter your password.
Image
cessnat37
Level 2
Level 2
Posts: 80
Joined: Tue Jan 03, 2017 4:31 pm

Re: Terminal didn't install the Python version I wanted

Post by cessnat37 »

Ok. Here are the results of the other two commands you wanted. So do I have Python 3.5 then?
At any rate, I should install a current Linux version

Code: Select all

dave@dave-Z170XP-SLI ~ $ apt install python3.9
[sudo] password for dave: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'postgresql-plpython3-9.5' for regex 'python3.9'
postgresql-plpython3-9.5 is already the newest version (9.5.25-0ubuntu0.16.04.1).
The following packages were automatically installed and are no longer required:
  gir1.2-rsvg-2.0 libcairo-script-interpreter2 libcairo2-dev libcdt5
  libcgraph6 libdjvulibre-dev libfontconfig1-dev libgdk-pixbuf2.0-dev
  libglib2.0-dev libgraphviz-dev libgvc6 libgvc6-plugins-gtk libgvpr2
  libilmbase-dev liblqr-1-0-dev libmagick++-6-headers libmagick++-6.q16-dev
  libmagickcore-6-arch-config libmagickcore-6-headers libmagickcore-6.q16-dev
  libmagickwand-6-headers libmagickwand-6.q16-dev libopenexr-dev libpathplan4
  libpcre3-dev libpcre32-3 libpcrecpp0v5 libpixman-1-dev librsvg2-dev
  libxcb-render0-dev libxcb-shm0-dev libxdot4 libxrender-dev libxt-dev
  x11proto-render-dev xsane-common
Use 'sudo apt autoremove' to remove them.

Code: Select all

dave@dave-Z170XP-SLI ~ $ apt policy python3.9
postgresql-plpython3-9.5:
  Installed: 9.5.25-0ubuntu0.16.04.1
  Candidate: 9.5.25-0ubuntu0.16.04.1
  Version table:
 *** 9.5.25-0ubuntu0.16.04.1 500
        500 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages
        100 /var/lib/dpkg/status
     9.5.24-0ubuntu0.16.04.1 500
        500 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages
     9.5.2-1 500
        500 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
dave@dave-Z170XP-SLI ~ $ 

0 upgraded, 0 newly installed, 0 to remove and 932 not upgraded.
dave@dave-Z170XP-SLI ~ $
Last edited by karlchen on Sun Jul 03, 2022 6:53 am, edited 1 time in total.
Reason: applied [code] [/code] tags around terminal commands and their output, preserves proper terminal screen formatting
User avatar
xenopeek
Level 25
Level 25
Posts: 29597
Joined: Wed Jul 06, 2011 3:58 am

Re: Terminal didn't install the Python version I wanted

Post by xenopeek »

There you go. You're been installing postgresql-plpython3-9.5. That is "PL/Python 3 procedural language for PostgreSQL 9.5" and not a new Python version.

If you want a newer Python version you need to first migrate to a Linux Mint version that is not yet end of life.
Image
cessnat37
Level 2
Level 2
Posts: 80
Joined: Tue Jan 03, 2017 4:31 pm

Re: Terminal didn't install the Python version I wanted

Post by cessnat37 »

Ok. Thanks. I'll have 20.3 installed soon. I got the bootable USB drive ready and ISO verification is done. I need to make sure all my files are saved.
cessnat37
Level 2
Level 2
Posts: 80
Joined: Tue Jan 03, 2017 4:31 pm

Re: Terminal didn't install the Python version I wanted

Post by cessnat37 »

Linux Mint 20.3 up and running....................Nice.
Locked

Return to “Software & Applications”