Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

Chicken Little was right.


comp / comp.lang.python / Re: No module name mutagen

SubjectAuthor
o Re: No module name mutagenThomas Passin

1
Subject: Re: No module name mutagen
From: Thomas Passin
Newsgroups: comp.lang.python
Date: Wed, 1 Jan 2025 04:12 UTC
References: 1 2
Path: news.eternal-september.org!eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: list1@tompassin.net (Thomas Passin)
Newsgroups: comp.lang.python
Subject: Re: No module name mutagen
Date: Tue, 31 Dec 2024 23:12:42 -0500
Lines: 84
Message-ID: <mailman.47.1735704775.2912.python-list@python.org>
References: <2aab58dd-378d-4218-868d-09eda6e8d292@gmail.com>
<cb479792-7f8f-44a2-b35e-6d9bf792c7ef@tompassin.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de gnUbVyFLpnpxzYhjPezJ8QHGtoEBIKyajl6UpFspEwww==
Cancel-Lock: sha1:3h47dPfVMSsdLrIcjbl+jr4mL0U= sha256:a/CcMGkhX2VDb4JvIm9hR5/mHShOulGXM+RmY6S3YoQ=
Return-Path: <list1@tompassin.net>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=tompassin.net header.i=@tompassin.net header.b=TNz/r0vw;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.004
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'project,': 0.03; 'this:':
0.03; 'pip': 0.04; 'network.': 0.05; 'parallel': 0.05; 'guido':
0.07; 'happened': 0.07; 'matplotlib': 0.07; 'subject:module':
0.07; 'subject:name': 0.07; 'van': 0.07; 'python.': 0.08;
'dependencies': 0.09; 'modules.': 0.09; 'obviously': 0.09;
'something,': 0.09; 'import': 0.15; "(i'm": 0.16; '7:00': 0.16;
'by,': 0.16; 'directories': 0.16; 'directory,': 0.16; 'paths':
0.16; 'python3': 0.16; 'received:10.0.0': 0.16; 'received:64.90':
0.16; 'received:64.90.62': 0.16; 'received:64.90.62.162': 0.16;
'received:dreamhost.com': 0.16; 'sudo': 0.16; 'utilities': 0.16;
'wrote:': 0.16; 'python': 0.16; 'pm,': 0.19; 'to:addr:python-
list': 0.20; "i've": 0.22; 'creates': 0.22; 'maybe': 0.22;
'version': 0.23; 'install': 0.23; 'command': 0.23; 'installed':
0.23; 'weeks': 0.23; 'run': 0.23; 'code': 0.23; '(and': 0.25;
'anything': 0.25; 'python,': 0.25; 'tim': 0.26; 'local': 0.27;
'done': 0.28; 'it,': 0.29; 'error': 0.29; 'present': 0.30; 'header
:User-Agent:1': 0.30; 'packages': 0.31; 'effect': 0.31; 'module':
0.31; 'do.': 0.32; 'python-list': 0.32; 'received:10.0': 0.32;
'received:mailchannels.net': 0.32;
'received:relay.mailchannels.net': 0.32; 'unexpected': 0.32;
'but': 0.32; 'develop': 0.32; "i'm": 0.33; 'path': 0.33; 'script':
0.33; 'header:In-Reply-To:1': 0.34; 'windows': 0.34; 'able': 0.34;
"didn't": 0.34; 'package': 0.34; 'running': 0.35; 'developed':
0.35; 'usual': 0.35; 'following': 0.35; 'also,': 0.36; 'source':
0.36; 'those': 0.36; 'special': 0.37; 'using': 0.37; "it's": 0.37;
'could': 0.37; 'directory': 0.37; 'though': 0.37; 'file': 0.38;
'way': 0.38; 'put': 0.38; 'use': 0.39; 'added': 0.39; 'least':
0.39; 'prompt': 0.39; 'received:100': 0.39; 'still': 0.40;
'advantage': 0.40; 'want': 0.40; 'should': 0.40; 'including':
0.60; 'remember': 0.61; 'ten': 0.61; "there's": 0.61; 'today,':
0.62; 'once': 0.63; 'email': 0.63; 'our': 0.63; 'expert': 0.64;
'your': 0.64; 'upgrade': 0.64; 'let': 0.65; 'six': 0.65; 'yours':
0.65; 'look': 0.65; 'back': 0.66; 'now,': 0.67;
'header:Received:6': 0.67; 'received:64': 0.68; 'right': 0.68;
'before,': 0.69; 'skip:/ 30': 0.69; 'stories': 0.69; 'desktop':
0.70; 'kids': 0.70; 'virtual': 0.71; 'content': 0.72;
'eliminates': 0.84; 'environment?': 0.84; 'install.': 0.84;
'minor': 0.84; 'occasion': 0.84; 'realize.': 0.84; 'say,': 0.84;
'activate': 0.91; 'loss.': 0.91; 'newly': 0.93
X-Sender-Id: dreamhost|x-authsender|tpassin@tompassin.net
ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1735704765; a=rsa-sha256;
cv=none;
b=EPckm1zbMaVEjsXxNrjpYNtuqNU26sj2j5QR9WRJJKLHdCJz3qnWXdauZ9OVwul7KzNnil
AF6ID1kBuqel54YECO/lfPJ4nmgepJ1hI8skrQW9/eTUrGOIKlkMXPLAeJQPoUsNwn1Et7
qXZjc+rFp13V7wj9laVQvXZ8sqBPvBIe5YBfrWhPkuIv+OmRc+7dtpMTVEyioaHQmpr1tW
pwYKmfAC27xMPXQTtfyaC5PjWAL3ywjEmhVjzqyf7TkvWkA3DDqI4H9QYgXIg2d+OzJ8E7
aCW3lfnBhFY6T/3GlLjPDpaWIiIp+Mwbnk2KvgMsQQ/h1fqFeMPW7h21b3aJKA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed;
d=mailchannels.net; s=arc-2022; t=1735704765;
h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
to:to:cc:mime-version:mime-version:content-type:content-type:
content-transfer-encoding:content-transfer-encoding:
in-reply-to:in-reply-to:references:references:dkim-signature;
bh=xPtuhiSP/Av5mlovaFg3yyObH2taZbtpp/i30YyNd1w=;
b=6IiuFqeQ7Zmj3F963v6z6J5xTm5/cSUkaeL5iKPTUhEM7u5GnlAof6EkchFgoS7QUZNaQG
EaIlDXBI3Cm2GdUFMKbvOrxnXJH1chR2XGiMU1NTLlpUXiJRqbU3TuEEQRjBegnpVwt9uw
L7Q0P+NTbyzRhsB3gkzGgUA6B7wukFRgDE8Lqbue00u6ewXJWFjB8/a5U9cXeE4yJ4SBBA
FofXqGgE8WEoi76iW0jrklpHqbmt1uGXLSTi7uaO6lfRdcinmQNw2JDeik8aCqP5M/2rzC
vGnnYNtGfpqTAEA2x3fovMI7qMvqlPoRx9aJxeCCKzRtRoaYQE6qh4bWKS8GlA==
ARC-Authentication-Results: i=1; rspamd-7d788bbf85-9m5tg;
auth=pass smtp.auth=dreamhost smtp.mailfrom=list1@tompassin.net
X-Sender-Id: dreamhost|x-authsender|tpassin@tompassin.net
X-MC-Relay: Neutral
X-MailChannels-SenderId: dreamhost|x-authsender|tpassin@tompassin.net
X-MailChannels-Auth-Id: dreamhost
X-Decisive-Quick: 123a5d854808dd9d_1735704765345_2179559981
X-MC-Loop-Signature: 1735704765345:4249034388
X-MC-Ingress-Time: 1735704765345
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tompassin.net;
s=dreamhost; t=1735704765;
bh=xPtuhiSP/Av5mlovaFg3yyObH2taZbtpp/i30YyNd1w=;
h=Date:Subject:To:From:Content-Type:Content-Transfer-Encoding;
b=TNz/r0vwK7DmPz13MWzqjlXsKRn93b/dTPh1Xs4JjbYodJ8jfsLak3Tg0hNKRlVeY
nQFg2nwyiQ8QneJbLOLuFQD2dzB8un6KwzHtBXVY8B5iSPc0iRY99c/L3V4Xqy14OY
6K/Kghv4mbV2d4BPzOxWcf1zEMw/L8Oica4CO8UkfrJ0/+cUWd0B8I5GlR42ttYL23
iRQ1pICFgo6hzREh4dyPYp9+oEdh8uTIOIugsrXuREWjRhGaj1aCm3UkClrKmEph12
97+phyHsX7f5AYl1QtmaHBJuL7bwpUczKwKh5NSlcyxfDeqi5ewkD7xIZ4vHNCTlIZ
Q9L1632kGLCMA==
User-Agent: Mozilla Thunderbird
Content-Language: en-US
In-Reply-To: <2aab58dd-378d-4218-868d-09eda6e8d292@gmail.com>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <cb479792-7f8f-44a2-b35e-6d9bf792c7ef@tompassin.net>
X-Mailman-Original-References: <2aab58dd-378d-4218-868d-09eda6e8d292@gmail.com>
View all headers

On 12/31/2024 7:00 PM, Tim Johnson via Python-list wrote:
> Please let me grumble for a minute : I've been using python since before
> 1. 5, when I could email Guido van Rossum directly with questions
>
> and onĀ  at least one occasion we swapped stories about our cats. I put
> six kids though college writing python, and now after
>
> being retired for ten years, I get my butt kicked by python dependencies
> every time I upgrade ubuntu. (I'm newly on 24.04) now.
>
> Now, after three weeks on using the following code correctly:
>
> from mutagen import mp3, id3, File as mutaFile
> from mutagen.id3 import ID3, TIT2, TPE1
>
> I am as of today, getting an import error for mutagen. Mutagen package
> is installed at /root/.local/share/pipx/shared/lib/python3.12/site-packages
>
> and indeed, that is the content of /root/.local/share/pipx/shared/lib/
> python3.12/site-packages/pipx_shared.pth
>
> I have added that to my path and am still getting the error. Grrr...
>
> I am at a loss. don't know what to do. I am only using python script for
> command line utilities on my desktop and local network.
>
> Must I be using a virtual environment? If so, I would be happy to set
> one up if I am given the python-approved directions
>
> (lots of conflicting info out there....)

I go back to Python 1.52 (think I remember the minor version!) also,
though I never emailed Guido.

A different distro of mine in a VM just did an upgrade and changed the
system python from 3.12.x to 3.13.y. Naturally, none of my installed
packages were present in this new system python. I had to reinstall
them all. Maybe this happened to you and you didn't realize. Even if
you had created a venv, I believe you would have had to redo it. It's
very annoying!

One way to avoid this is to install your own, non-system Python. So if
the system python is invoked by python3, yours might be invoked by, say,
python3.12, or even python3.12.3. I've done that on a few VMs.

One advantage of using either your own Python install or a venv is that
it eliminates those warnings that say the system won't allow you to
install something, and then you have to work around it.

The way I use venvs - and I am not expert in them - is to create a
directory to contain my venvs, such as ~/venv. Now let's say you have a
project, call it proj1, that you want to develop or work with in its own
venv. You create it like this:

python3 -m venv ~/venv/proj1

This will create some directories including a site-packages directory,
which will be the location of all packages that you install. The venv
module will install the packages the system's Python already has.

To use the new venv you have to "activate" it, which creates some paths
and variables that cause Python to look first in the venv for modules.
You have to source this script:

source ~/venv/proj1/bin/activate

The activate script will also add "(proj1)" to your terminal's prompt so
you know it's in effect.

Once the venv is activated, which obviously will only be in effect for
that session in that terminal, you install as usual with pip (and pipx
although I don't use pipx so I don't know if there's anything special to
do for a venv):

python3 -m pip install matplotlib # or whatever

Don't use sudo or --user.

You should be able to run pip directly in the venv, but I have developed
the habit of using python3 -m pip because I can be sure I'm running the
right version of pip with the right version of python. It's possible to
end up with a bare "pip" invoked by an unexpected version of Python.
I've been bitten by this before, especially on Windows where I've had
several parallel Python installations.

1

rocksolid light 0.9.8
clearnet tor