Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add setuptools to runtime dependencies #56

Open
iconoclasthero opened this issue Mar 22, 2024 · 2 comments
Open

add setuptools to runtime dependencies #56

iconoclasthero opened this issue Mar 22, 2024 · 2 comments

Comments

@iconoclasthero
Copy link

iconoclasthero commented Mar 22, 2024

$ apt install python3-pkg-resources ; replaygain
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3-pkg-resources is already the newest version (68.1.2-2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Traceback (most recent call last):
  File "/home//.local/bin/replaygain", line 3, in <module>
    from rgain3.script.replaygain import replaygain
  File "/home//.local/share/pipx/venvs/rgain3/lib/python3.12/site-packages/rgain3/__init__.py", line 19, in <module>
    from .version import __version__
  File "/home//.local/share/pipx/venvs/rgain3/lib/python3.12/site-packages/rgain3/version.py", line 1, in <module>
    from pkg_resources import DistributionNotFound, get_distribution
ModuleNotFoundError: No module named 'pkg_resources'
$ pipx runpip rgain3 install setuptools; collectiongain
Collecting setuptools
  Using cached setuptools-69.2.0-py3-none-any.whl.metadata (6.3 kB)
Using cached setuptools-69.2.0-py3-none-any.whl (821 kB)
Installing collected packages: setuptools
Successfully installed setuptools-69.2.0
Usage: collectiongain [options] MUSIC_DIR

collectiongain: error: pass one directory path

@iconoclasthero
Copy link
Author

0h and ... <string>:1: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html

@iconoclasthero
Copy link
Author

So in my discussion on #python last night, it turns out that >= Python 3.12, setuptools is no longer packaged by default in the venv so it needs to be explicitly stated in e.g. requirements in order for it to work in a venv, however the deprecated dependency should probably be replaced instead... In my case, I'm managing it with pipx as suggested by pip when it fails to install system wide on a rolling Ubuntu derivative:*

$ python3 -m pip install --user rgain3
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.
    
    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.
    
    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.
    
    See /usr/share/doc/python3.12/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

Anyway, point being, I really don't know enough about what's going on to troubleshoot stuff like this which is why I'm submitting it as an issue and why I had to ask on #python.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant