Python not working, and there are several.

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
thomasreed
Level 1
Level 1
Posts: 22
Joined: Wed Jul 12, 2023 8:35 pm

Python not working, and there are several.

Post by thomasreed »

My Dell Optiplex 9020 is running Linux Mint 21.2 after the upgrade I did two weeks ago. My problem involves trying to run yt-dlp. The first picture shows that I am not running Python 3.9.13. Which is not surprising, because I never installed an upgrade to it. I searched my primary drive and it doesn't show anywhere.
Image

When I did look for Python again, it is found on my home drive, not in any other directory. See the picture.
Image

I could not find any posts about "update Python", "delete Python" or anything like that on the forum.

So...how do I uninstall or delete these Python installations, so it is possible to install the current version of Python? Is there some kind of utility that can wipe out however many installations of Python might be on my system? And why is yt-dlp calling on Python 3.9.13 which I never installed? Or is it telling me that I need to install it?

If it helps, here is the system profiler (first page only) for my Optiplex. thanks!

--------------------------------------------

Code: Select all

-Computer-
Processor		: Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
Memory		: 32768MB (7025MB used)
Machine Type		: Mini Tower
Operating System		: Linux Mint 21.2
User Name		: tom (Thomas Reed)
Date/Time		: Tue 17 Oct 2023 08:23:13 PM EDT
-Display-
Resolution		: 3520x1080 pixels
OpenGL Renderer		: NVIDIA GeForce GTX 1050 Ti/PCIe/SSE2
X11 Vendor		: The X.Org Foundation
-Audio Devices-
Audio Adapter		: HDA-Intel - HDA Intel HDMI
Audio Adapter		: HDA-Intel - HDA Intel PCH
Audio Adapter		: HDA-Intel - HDA NVidia
-Input Devices-
 Power Button
 Power Button
 Video Bus
 Dell Dell USB Keyboard
 Logitech M570
 Dell WMI hotkeys
 HDA NVidia HDMI/DP,pcm:3
 HDA NVidia HDMI/DP,pcm:7
 HDA NVidia HDMI/DP,pcm:8
 HDA NVidia HDMI/DP,pcm:9
 HDA Intel HDMI HDMI/DP,pcm:3
 HDA Intel HDMI HDMI/DP,pcm:7
 HDA NVidia HDMI/DP,pcm:10
 HDA NVidia HDMI/DP,pcm:11
 HDA Intel HDMI HDMI/DP,pcm:8
 HDA Intel HDMI HDMI/DP,pcm:9
 HDA Intel HDMI HDMI/DP,pcm:10
 HDA Intel PCH Front Mic
 HDA Intel PCH Rear Mic
 HDA Intel PCH Line Out
 HDA Intel PCH Front Headphone
 Xbox 360 Wireless Receiver
 Xbox 360 Wireless Receiver
 Xbox 360 Wireless Receiver
 Xbox 360 Wireless Receiver
-Printers (CUPS)-
EPSON_ET_3760_Series		: <i>Default</i>
EPSON_ET_3760_Series@EPSON4DFF5A.local
PDF
-SCSI Disks-
ATA WDC  WDBNCE0010P
HL-DT-ST DVDRW GHD3N
ATA MD2000GSA3272DVR
Last edited by LockBot on Wed Apr 17, 2024 10:00 pm, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
spamegg
Level 15
Level 15
Posts: 5555
Joined: Mon Oct 28, 2019 2:34 am
Contact:

Re: Python not working, and there are several.

Post by spamegg »

This may be an issue with your yt-dlp installation. How did you install it? Was it from Software Manager? Don't use the yt-dlp from Software Manager because it's usually broken. You have to install the latest from Github, and update it manually with yt-dlp -U on the Terminal.

Mint 21.2 should have Python 3.10 (currently 3.10.12) as the default system version.

What does

Code: Select all

python3 --version
say?

The ActiveState and Python 3.11 folders do not look good. They shouldn't be there normally. I don't have them on my system. ActiveState is a provider of "alternate programming language installations" that comes bundled with some custom packages. So somebody (you or someone else) installed these. Without knowing HOW they were installed, we can't say much about how to uninstall them.

Probably the ActiveState installation was for 3.9, and it overwrote itself on top of the system Python. This is just a guess. It was probably installed in that "missing folder" in your Home directory, and then someone (you or someone else) deleted it later.
Is there some kind of utility that can wipe out however many installations of Python might be on my system?
No, that depends on how they were installed. I use PyEnv https://github.com/pyenv/pyenv/ which can install / uninstall any number of Python installations, but that does not seem to be the case here.
User avatar
all41
Level 19
Level 19
Posts: 9729
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: Python not working, and there are several.

Post by all41 »

Download latest:

Code: Select all

sudo wget https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -O /usr/local/bin/yt-dlp
then run:

Code: Select all

sudo chmod a+rx /usr/local/bin/yt-dlp
to set permissions.
Then to update occasionally run:

Code: Select all

sudo yt-dlp -U
Everything in life was difficult before it became easy.
thomasreed
Level 1
Level 1
Posts: 22
Joined: Wed Jul 12, 2023 8:35 pm

Re: Python not working, and there are several.

Post by thomasreed »

Spamegg, here is the output I got:


tom@Thomas-OptiPlex-9020:~$ python3 --version
x Could not find project file at /home/tom/Python-3.9.13-Linux-CentOS
x Could not find project at /home/tom/Python-3.9.13-Linux-CentOS
x Could not find file=activestate.yaml in path=/home/tom/Python-3.9.13-Linux-CentOS

█ Need More Help?

• Run → `state exec --help` for general help
• Ask For Help → https://community.activestate.com/c/state-tool/
tom@Thomas-OptiPlex-9020:~$
thomasreed
Level 1
Level 1
Posts: 22
Joined: Wed Jul 12, 2023 8:35 pm

Re: Python not working, and there are several.

Post by thomasreed »

All41, I did what you said. Here is the result.

om@Thomas-OptiPlex-9020:~$ sudo wget https://github.com/yt-dlp/yt-dlp/releas ... oad/yt-dlp -O /usr/local/bin/yt-dlp
[sudo] password for tom:
--2023-10-18 22:10:24-- https://github.com/yt-dlp/yt-dlp/releas ... oad/yt-dlp
Resolving github.com (github.com)... 140.82.112.3
Connecting to github.com (github.com)|140.82.112.3|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://github.com/yt-dlp/yt-dlp/releas ... .13/yt-dlp [following]
--2023-10-18 22:10:24-- https://github.com/yt-dlp/yt-dlp/releas ... .13/yt-dlp
Reusing existing connection to github.com:443.
HTTP request sent, awaiting response... 302 Found
Location: https://objects.githubusercontent.com/g ... tet-stream [following]
--2023-10-18 22:10:24-- https://objects.githubusercontent.com/g ... tet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.110.133, 185.199.111.133, 185.199.108.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.110.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2934716 (2.8M) [application/octet-stream]
Saving to: ‘/usr/local/bin/yt-dlp’

/usr/local/bin/yt-dlp 100%[===================================>] 2.80M --.-KB/s in 0.1s

2023-10-18 22:10:25 (21.1 MB/s) - ‘/usr/local/bin/yt-dlp’ saved [2934716/2934716]

tom@Thomas-OptiPlex-9020:~$ sudo chmod a+rx /usr/local/bin/yt-dlp
tom@Thomas-OptiPlex-9020:~$ sudo yt-dlp -U
Available version: stable@2023.10.13, Current version: stable@2023.10.13
Current Build Hash: be5cfb6be8930e1a5f427533ec32f2a481276b3da7b249d0150ce2b740ccf1ce
yt-dlp is up to date (stable@2023.10.13)

And the attempt to use yt-dlp...

tom@Thomas-OptiPlex-9020:~$ yt-dlp https://www.youtube.com/watch?v=DNUk7NyL9k8
x Could not find project file at /home/tom/Python-3.9.13-Linux-CentOS
x Could not find project at /home/tom/Python-3.9.13-Linux-CentOS
x Could not find file=activestate.yaml in path=/home/tom/Python-3.9.13-Linux-CentOS

█ Need More Help?

• Run → `state exec --help` for general help
• Ask For Help → https://community.activestate.com/c/state-tool/
tom@Thomas-OptiPlex-9020:~$

Sorry, but I think it's necessary to nuke all the installations of Python and try to reinstall. I think one of the other posters gave me something that would supposedly do that. Will post that right after this post.
thomasreed
Level 1
Level 1
Posts: 22
Joined: Wed Jul 12, 2023 8:35 pm

Re: Python not working, and there are several.

Post by thomasreed »

As Spamegg said...

No, that depends on how they were installed. I use PyEnv https://github.com/pyenv/pyenv/ which can install / uninstall any number of Python installations, but that does not seem to be the case here.

I'm tempted to do this to get rid of the installations, and then use the installation path that was mentioned in the above post.
User avatar
all41
Level 19
Level 19
Posts: 9729
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: Python not working, and there are several.

Post by all41 »

Yes--python has to be correct. Fixing this is going to be like moving frogs
in a wheelbarrow. I think most finally do a reinstall if they have no recovery
or Timeshift snapshots. see this thread:
viewtopic.php?p=2386485#p2386485
That entire topic is pertinent.
But the yt-dlp link is correct
Everything in life was difficult before it became easy.
thomasreed
Level 1
Level 1
Posts: 22
Joined: Wed Jul 12, 2023 8:35 pm

Re: Python not working, and there are several.

Post by thomasreed »

Okay, I'm trying to take this rationally. The only concern I have about Python is that I can't run yt-dlp on it, because it can't find the proper version of Python. Everything existing on my computer seems to run okay. And if it's impossible to delete all the old versions of Python, because it would break other programs on my computer, I'll just try to set up another computer with a new install of Linux Mint on it, and use that one solely for yt-dlp.

I just think it's irresponsible for a program like Python to not be up-gradeable or delete-able when the operating system is upgraded.
User avatar
all41
Level 19
Level 19
Posts: 9729
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: Python not working, and there are several.

Post by all41 »

perhaps look at the repository package
python-is-python3
but if you get yt-dlp per above links it will work fine with Mint default python packages
Everything in life was difficult before it became easy.
thomasreed
Level 1
Level 1
Posts: 22
Joined: Wed Jul 12, 2023 8:35 pm

Re: Python not working, and there are several.

Post by thomasreed »

Here's what happened.

tom@Thomas-OptiPlex-9020:~$ python-is-python3
python-is-python3: command not found
tom@Thomas-OptiPlex-9020:~$

So I presume that, whatever version of Python works on my system, it's not Python 3.

I may see if I can find another YouTube download program that doesn't involve Python. Or, get one of my stupid little computers installed with Linux Mint latest version and see if that works.
User avatar
all41
Level 19
Level 19
Posts: 9729
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: Python not working, and there are several.

Post by all41 »

thomasreed wrote: Sun Oct 22, 2023 10:25 pm Here's what happened.

tom@Thomas-OptiPlex-9020:~$ python-is-python3
python-is-python3: command not found
tom@Thomas-OptiPlex-9020:~$

So I presume that, whatever version of Python works on my system, it's not Python 3.

I may see if I can find another YouTube download program that doesn't involve Python. Or, get one of my stupid little computers installed with Linux Mint latest version and see if that works.
Don't run it as a terminal command.
Look in Synaptic or Software manager. Search for package python-is-python3
You just need to install
we still haven't seen a proper inxi -Fxxxrz report
Everything in life was difficult before it became easy.
ajgreeny
Level 7
Level 7
Posts: 1687
Joined: Mon Nov 19, 2007 3:27 pm

Re: Python not working, and there are several.

Post by ajgreeny »

Have you knowingly removed any python versions from your system? If so, that is unfortunately going to leave you in the sort of situation in which you find yourself.
DON'T DO IT!

You can have multiple versions of python installed at the same time but never ever remove a version!
thomasreed
Level 1
Level 1
Posts: 22
Joined: Wed Jul 12, 2023 8:35 pm

Re: Python not working, and there are several.

Post by thomasreed »

Yes, I understand this, and I don't want to nuke my installation and lose all the work I have done. I just find it hard to believe that the company or group or hermit hiding in a cave that writes and supervises Python does not have a way to update Python that would automatically and safely remove the earlier editions. If you have read the previous threads, you understand my central point. This is what happens when I try this simple request:

tom@Thomas-OptiPlex-9020:~$ yt-dlp https://www.youtube.com/watch?v=mMv6OSuitWw
x Could not find project file at /home/tom/Python-3.9.13-Linux-CentOS
x Could not find project at /home/tom/Python-3.9.13-Linux-CentOS
x Could not find file=activestate.yaml in path=/home/tom/Python-3.9.13-Linux-CentOS


In other words, while my system apparently has Python 3.9.13 on it, it is impossible to access because there IS no such location on my system named Python-3.9.13-Linux-CentOS . I have done both a Catfish search for that location and looked directly in the /home/tom/ directory. So I have a ghost installation of the new Python, invisible to all except error messages. I would expect this kind of stupidity in Windows and Mac OS, but not in Linux.

Do you have any suggestions, aside from getting a little PC set up with a new Linux installation and only using that to run yl-dlp on? Is it possible to reinstall Python-3.9.13 on the system and HOPE that it's accessible? Or would that be suicide for my system?

Please understand, this makes me very angry, but I'm not angry at you, only the situation and the Python high priest in his frozen cave who caused it.
ajgreeny
Level 7
Level 7
Posts: 1687
Joined: Mon Nov 19, 2007 3:27 pm

Re: Python not working, and there are several.

Post by ajgreeny »

As far as installing yt-dlp is concerned I suggest you have a look at the PPA that I have been using successfully for some time now meaning that it is updated with the normal system updates the same as all other repository packages.
https://launchpad.net/~tomtomtom/+archive/ubuntu/yt-dlp
thomasreed
Level 1
Level 1
Posts: 22
Joined: Wed Jul 12, 2023 8:35 pm

Re: Python not working, and there are several.

Post by thomasreed »

I will try as you say, but if Python isn't working, how is it going to work?
thomasreed
Level 1
Level 1
Posts: 22
Joined: Wed Jul 12, 2023 8:35 pm

Re: Python not working, and there are several.

Post by thomasreed »

So, I typed it in. I read the repository page. I have no idea which of the four different youtube-dl versions I should install, and that page didn't explain how to install it. This is the stuff I got when putting in the new repository:

[sudo] password for tom:
You are about to add the following PPA:
A youtube-dl fork with additional features and fixes
More info: https://launchpad.net/~tomtomtom/+archive/ubuntu/yt-dlp
Press Enter to continue or Ctrl+C to cancel

gpg: keybox '/etc/apt/keyrings/CEC312CC5ED8215A6E0EFC49B90E9186F0E836FB.keyring' created
gpg: key B90E9186F0E836FB: public key "Launchpad PPA for tomtomtom" imported
gpg: Total number processed: 1
gpg: imported: 1
tom@Thomas-OptiPlex-9020:~$ sudo apt update
Hit:1 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:2 http://archive.ubuntu.com/ubuntu jammy InRelease
Hit:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Ign:4 http://packages.linuxmint.com victoria InRelease
Hit:5 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Hit:6 http://ppa.launchpad.net/audio-recorder/ppa/ubuntu jammy InRelease
Hit:7 http://packages.linuxmint.com victoria Release
Hit:8 https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu jammy InRelease
Get:9 http://download.opensuse.org/repositori ... untu_23.04 InRelease [1,565 B]
Get:10 https://packages.expandrive.com/expandrive stable InRelease [2,505 B]
Hit:11 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu jammy InRelease
Err:10 https://packages.expandrive.com/expandrive stable InRelease
The following signatures were invalid: EXPKEYSIG 0FB0547682F8C86A ExpanDrive, Inc. <support@expandrive.com>
Hit:13 http://ppa.launchpad.net/font-manager/staging/ubuntu jammy InRelease
Hit:14 https://ppa.launchpadcontent.net/savour ... eg4/ubuntu jammy InRelease
Hit:15 http://ppa.launchpad.net/libreoffice/ppa/ubuntu jammy InRelease
Hit:16 http://ppa.launchpad.net/linuxuprising/java/ubuntu jammy InRelease
Hit:17 https://ppa.launchpadcontent.net/savour ... eg5/ubuntu jammy InRelease
Hit:18 http://ppa.launchpad.net/obsproject/obs-studio/ubuntu jammy InRelease
Hit:19 http://ppa.launchpad.net/slgobinath/gcalendar/ubuntu jammy InRelease
Hit:20 https://ppa.launchpadcontent.net/libreo ... ill/ubuntu jammy InRelease
Hit:21 http://ppa.launchpad.net/ubuntuhandbook1/apps/ubuntu jammy InRelease
Hit:22 http://ppa.launchpad.net/ubuntuhandbook ... ler/ubuntu jammy InRelease
Hit:23 https://ppa.launchpadcontent.net/libreoffice/ppa/ubuntu jammy InRelease
Hit:24 https://ppa.launchpadcontent.net/rael-g ... drv/ubuntu jammy InRelease
Hit:25 https://ppa.launchpadcontent.net/slgobi ... dar/ubuntu jammy InRelease
Get:26 https://ppa.launchpadcontent.net/tomtom ... dlp/ubuntu jammy InRelease [18.0 kB]
Get:27 https://ppa.launchpadcontent.net/tomtom ... dlp/ubuntu jammy/main amd64 Packages [628 B]
Get:28 https://ppa.launchpadcontent.net/tomtom ... dlp/ubuntu jammy/main i386 Packages [628 B]
Get:29 https://ppa.launchpadcontent.net/tomtom ... dlp/ubuntu jammy/main Translation-en [6,972 B]
Reading package lists... Done
W: http://ppa.launchpad.net/audio-recorder ... /InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: GPG error: https://packages.expandrive.com/expandrive stable InRelease: The following signatures were invalid: EXPKEYSIG 0FB0547682F8C86A ExpanDrive, Inc. <support@expandrive.com>
E: The repository 'https://packages.expandrive.com/expandrive stable InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: http://ppa.launchpad.net/deadsnakes/ppa ... /InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: http://ppa.launchpad.net/font-manager/s ... /InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: http://ppa.launchpad.net/libreoffice/pp ... /InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: http://ppa.launchpad.net/linuxuprising/ ... /InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: http://ppa.launchpad.net/obsproject/obs ... /InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: http://ppa.launchpad.net/slgobinath/gca ... /InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: http://ppa.launchpad.net/ubuntuhandbook ... /InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: http://ppa.launchpad.net/ubuntuhandbook ... /InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
tom@Thomas-OptiPlex-9020:~$ lsb_release -a
LSB Version: core-11.1.0ubuntu4-noarch:printing-11.1.0ubuntu4-noarch:security-11.1.0ubuntu4-noarch
Distributor ID: Linuxmint
Description: Linux Mint 21.2
Release: 21.2
Codename: victoria


And again, I don't see any instructions on how to download or install the four listed sources, which of course have no explanation applied to why they are all different...

Package Version Uploaded by
yt-dlp 2023.10.13-1~ppa~mantic tomtomtom (2023-10-14)
yt-dlp 2023.10.13-1~ppa~lunar tomtomtom (2023-10-14)
yt-dlp 2023.10.13-1~ppa~jammy tomtomtom (2023-10-14)
yt-dlp 2023.10.13-1~ppa~focal tomtomtom (2023-10-14)
thomasreed
Level 1
Level 1
Posts: 22
Joined: Wed Jul 12, 2023 8:35 pm

Re: Python not working, and there are several.

Post by thomasreed »

To ajgreeny....in a recent upgrade, Python 11.1 was included. I ran the upgrade, like all upgrades. But when I typed python –version I got...

Code: Select all

tom@Thomas-OptiPlex-9020:~$ python –version
python: can't open file '/home/tom/–version': [Errno 2] No such file or directory
tom@Thomas-OptiPlex-9020:~$ 
So there is no Python that computer can find. There are 563 files on my computer that have the word "python" or some variant on my computer. I wouldn't be a clod and paste them all in a message, but perhaps if you or someone else is interested, I could email the entire list to anyone who's interested. The old hermit in an icebound cave that created Python might make some sense out of it. If this happens to me, a common ground-level computer user who doesn't like fiddling with my system, it's got to be happening to many other people out there.
thomasreed
Level 1
Level 1
Posts: 22
Joined: Wed Jul 12, 2023 8:35 pm

Re: Python not working, and there are several.

Post by thomasreed »

One more note. I discovered that I could type python and it would give me the supposed primary Python installation on my system. I did, and this is what I got...

Code: Select all

tom@Thomas-OptiPlex-9020:~$ python
Python 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 
As the mule used to say on Hee Haw, "Doesn't that throw your desktop in the creek?"
thomasreed
Level 1
Level 1
Posts: 22
Joined: Wed Jul 12, 2023 8:35 pm

Re: Python not working, and there are several.

Post by thomasreed »

And another dead end. I attempted to use the command:

python-is-python3

and the system didn't recognize it. Then someone told me that it was not a command, but a utility or something, and I found it in my software manager. I installed it and I still got that old familiar response:

Code: Select all

tom@Thomas-OptiPlex-9020:~$ yt-dlp https://www.youtube.com/watch?v=DNUk7NyL9k8
 x Could not find project file at /home/tom/Python-3.9.13-Linux-CentOS
 x Could not find project at /home/tom/Python-3.9.13-Linux-CentOS
 x Could not find file=activestate.yaml in path=/home/tom/Python-3.9.13-Linux-CentOS

█ Need More Help?

 • Run → `state exec --help` for general help
 • Ask For Help → https://community.activestate.com/c/state-tool/
tom@Thomas-OptiPlex-9020:~$ 
So I'm still going to drag out the little machine and install Linux Mint on it, exclusively for yt-dlp purposes. I was advised to put a virtual machine on my system, but I have no idea how to do that, and I'm certain that it would screw up my existing system beyond repair. Worse than Python did.
Locked

Return to “Software & Applications”