Deutsch   English   Français   Italiano  
<mailman.49.1735737722.2912.python-list@python.org>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!not-for-mail
From: "Peter J. Holzer" <hjp-python@hjp.at>
Newsgroups: comp.lang.python
Subject: Re: No module name mutagen
Date: Wed, 1 Jan 2025 14:16:34 +0100
Lines: 88
Message-ID: <mailman.49.1735737722.2912.python-list@python.org>
References: <2aab58dd-378d-4218-868d-09eda6e8d292@gmail.com>
 <20250101131634.vgrfeetikvq7y7hi@hjp.at>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
 protocol="application/pgp-signature"; boundary="gq6pumhij37jo72l"
X-Trace: news.uni-berlin.de 2YGUo96CjFw0+2Zl1bBhzA3+eSe/W11bjYVhKjRRFnKg==
Cancel-Lock: sha1:JgbaD4AIn+sasOv7OwtwSD2ra5A= sha256:noFwuHu7mWaOWA/+SRXK+e3OyNTkA27vcAimSzhLk+A=
Return-Path: <hjp-python@hjp.at>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
 dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.002
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '(which': 0.04; 'content-
 type:multipart/signed': 0.05; 'else.': 0.07; 'subject:module':
 0.07; 'subject:name': 0.07; 'content-type:application/pgp-
 signature': 0.09; 'dependencies': 0.09; 'environments': 0.09;
 'filename:fname piece:asc': 0.09; 'filename:fname
 piece:signature': 0.09; 'filename:fname:signature.asc': 0.09;
 'supplied': 0.09; 'ubuntu': 0.09; 'import': 0.15; '"creative':
 0.16; "(i'm": 0.16; '5000': 0.16; '__/': 0.16; 'anything,': 0.16;
 'challenge!"': 0.16; 'computers': 0.16; 'from:addr:hjp-python':
 0.16; 'from:addr:hjp.at': 0.16; 'from:name:peter j. holzer': 0.16;
 'hjp@hjp.at': 0.16; 'holzer': 0.16; 'invoke': 0.16; 'lot,': 0.16;
 'reality.': 0.16; 'stick': 0.16; 'stross,': 0.16; 'url-
 ip:212.17.106.129/32': 0.16; 'url-ip:212.17.106/24': 0.16; 'url-
 ip:212.17/16': 0.16; 'url:hjp': 0.16; '|_|_)': 0.16; 'wrote:':
 0.16; 'python': 0.16; "can't": 0.17; 'installing': 0.19; 'to:addr
 :python-list': 0.20; 'option': 0.20; 'maybe': 0.22; 'version':
 0.23; 'install': 0.23; 'command': 0.23; 'installed': 0.23;
 'weeks': 0.23; 'code': 0.23; 'idea': 0.24; 'anything': 0.25;
 'stuff': 0.25; 'seems': 0.26; 'library': 0.26; 'normally': 0.26;
 'tim': 0.26; 'mostly': 0.28; 'sense': 0.28; 'error': 0.29;
 'packages': 0.31; 'context': 0.32; 'python-list': 0.32; 'users.':
 0.32; 'but': 0.32; 'unless': 0.32; 'there': 0.33; 'header:In-
 Reply-To:1': 0.34; 'mean': 0.34; 'package': 0.34; 'running': 0.35;
 'following': 0.35; 'target': 0.36; 'change': 0.36; 'using': 0.37;
 'file': 0.38; 'way': 0.38; 'use': 0.39; 'want': 0.40; 'michael':
 0.60; 'best': 0.61; 'likely': 0.61; 'ten': 0.61; 'above': 0.62;
 'today,': 0.62; 'ever': 0.63; 'between': 0.63; 'your': 0.64;
 'upgrade': 0.64; 'received:userid': 0.66; 'now,': 0.67; 'worked':
 0.67; '[1]': 0.67; 'bad': 0.67; 'management': 0.68; 'refers':
 0.69; 'you.': 0.70; 'audio': 0.70; 'them,': 0.70; 'care': 0.71;
 'virtual': 0.71; 'tools': 0.74; 'reasons': 0.84; 'environment?':
 0.84; 'os.': 0.84; 'received:at': 0.84; 'upgrades': 0.84;
 'products': 0.88; 'include:': 0.91; 'today?': 0.91; 'manager.':
 0.93; 'newly': 0.93
Mail-Followup-To: python-list@python.org
Content-Disposition: inline
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: <20250101131634.vgrfeetikvq7y7hi@hjp.at>
X-Mailman-Original-References: <2aab58dd-378d-4218-868d-09eda6e8d292@gmail.com>
Bytes: 7691


--gq6pumhij37jo72l
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On 2024-12-31 15:00:10 -0900, Tim Johnson via Python-list wrote:
> 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.
>=20
> Now, after three weeks on using the following code correctly:
>=20
> from mutagen import mp3, id3, File as mutaFile
> from mutagen.id3 import ID3, TIT2, TPE1
>=20
> I am as of today, getting an import error for mutagen.

So what changed between the last time it worked and today? Did you
upgrade anything, install anything, delete anything, change permissions,
etc.? Or maybe just invoke your scripts in a different context
(different user, different environment) than before?

> Mutagen package is
> installed at /root/.local/share/pipx/shared/lib/python3.12/site-packages

As Michael already noted, /root is not normally accessible by normal
users. So installing stuff into /root/.local is a bad idea unless you
only ever want to use it as root (which in the case of an audio metadata
library seems unlikely).


> Must I be using a virtual environment?

I use virtual environments a lot, but that may not be the best option
for you. Especially if you mostly writing command line tools and having
difficulties with upgrades, it might be a good idea to stick with
packages supplied by Ubuntu (I'm guessing that =E2=80=9C24.04=E2=80=9D abov=
e refers to
=E2=80=9CUbuntu 24.04 LTS=E2=80=9D). There are over 5000 of them, so it is =
very likely
that you don't need anything else. This way Ubuntu's package management
will take care of all the dependencies.

Good reasons to use virtual enviroments (on Linux) include:

* You have many different products[1] with different requirements
  running on several computers and you want to decouple upgrades of your
  products from upgrades to the hosts' OS.
* You need either a package or a specific version not supplied by your
  distribution.
* You can't install packages on the target host.

A not so good reason is:

* You are not familiar with your distribution's package manager.

        hp

[1] By "product" I mean a collection of software for a common purpose.
    That might be a collection of scripts, it might be web site, etc.

--=20
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

--gq6pumhij37jo72l
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAmd1QCoACgkQ8g5IURL+
KF2A0Q//Ur6SPrPos9a8DGRP/kErumpmPyqV8pRJNcEjDAfH1TWuzVJSORA+p0df
3hPTgmiSNn7sxalgXnK6TOuEdbsAlEqG1MBF/CsLJIU3r2YEVZtB8GvBN959hGi2
z/+u22HEHvgiufQ30oauYoB8zHo1tPyyFsm63jlJBoiZiYhyTIocLwEWevnbzoOw
vsQ8vaVvsLqCzs/L1QTwYq69z9UyFD5C9/Z3FGWM/xAP4jF1v5cFz8oOob6Cruet
RZJwEiWvZzi/w0NY84pxfxteei26cNHGGrlxGkWx6JysyapKnAEhDBTiIvbd8CPw
bPhefsqJk9v8A3uTgsiRXi2OYoRjWK0m53V4IjZEqFlko3zh52rEVkhFaQl4+e/K
jK0dKflYRsRj3Q7HMAm0Sa0lWe7WrjFLU1vzuKa3vz0DAcK0AUZGOsj2q7TISCMI
+ZFTkbkUFu4lgvcDRhQ8dOOgMug+CDns7ArjK329WCWTvzRdIJPtuyZWFrOXeHlR
ZymDQc6tuMB8V3YGsHlC5M+VXFmqkz2QSMDUruxtA/ApsxdOtA8uCsoYhozkGjol
kA73WIQ8x7bv8nTrq2wJ1kSUa++Jz5kDjV7zfVh2QM3uRtL9Tq287SMBvX80r4sd
FvokMNdmilFniIAwefqJ8ZDQY5duCrIn5oBuC/zsK3hkjLRWCjM=
=hrjB
-----END PGP SIGNATURE-----

--gq6pumhij37jo72l--