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

pyznap in a venv on macOS Sonoma has dependencies #109

Open
LnxGnome opened this issue Oct 3, 2024 · 1 comment
Open

pyznap in a venv on macOS Sonoma has dependencies #109

LnxGnome opened this issue Oct 3, 2024 · 1 comment

Comments

@LnxGnome
Copy link

LnxGnome commented Oct 3, 2024

Just a note for the Docs...

pyznap in a venv on macOS Sonoma has dependencies (setuptools)

superuser@mac ~ % which python3   
/opt/homebrew/bin/python3

superuser@mac ~ % python3 -V   
Python 3.12.7

superuser@mac ~ % python3 -m venv venv/pyznap

superuser@mac ~ % source venv/pyznap/bin/activate

(pyznap) superuser@mac ~ % which python3
/Users/superuser/venv/pyznap/bin/python3

(pyznap) superuser@mac ~ % pip3 install pyznap
Collecting pyznap
  Downloading pyznap-1.6.0-py3-none-any.whl.metadata (12 kB)
Downloading pyznap-1.6.0-py3-none-any.whl (39 kB)
Installing collected packages: pyznap
Successfully installed pyznap-1.6.0

(pyznap) superuser@mac ~ % pyznap
Traceback (most recent call last):
  File "/Users/superuser/venv/pyznap/bin/pyznap", line 5, in <module>
    from pyznap.main import main
  File "/Users/superuser/venv/pyznap/lib/python3.12/site-packages/pyznap/main.py", line 18, in <module>
    from .utils import read_config, create_config
  File "/Users/superuser/venv/pyznap/lib/python3.12/site-packages/pyznap/utils.py", line 21, in <module>
    from pkg_resources import resource_string
ModuleNotFoundError: No module named 'pkg_resources'

(pyznap) superuser@mac ~ % pyznap setup -p ~/pyznap
Traceback (most recent call last):
  File "/Users/superuser/venv/pyznap/bin/pyznap", line 5, in <module>
    from pyznap.main import main
  File "/Users/superuser/venv/pyznap/lib/python3.12/site-packages/pyznap/main.py", line 18, in <module>
    from .utils import read_config, create_config
  File "/Users/superuser/venv/pyznap/lib/python3.12/site-packages/pyznap/utils.py", line 21, in <module>
    from pkg_resources import resource_string
ModuleNotFoundError: No module named 'pkg_resources'

(pyznap) superuser@mac ~ % pip3 install setuptools
Collecting setuptools
  Downloading setuptools-75.1.0-py3-none-any.whl.metadata (6.9 kB)
Downloading setuptools-75.1.0-py3-none-any.whl (1.2 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 13.5 MB/s eta 0:00:00
Installing collected packages: setuptools
Successfully installed setuptools-75.1.0

(pyznap) superuser@mac ~ % pyznap setup -p ~/pyznap
Oct 03 19:10:26 INFO: Starting pyznap...
Oct 03 19:10:26 INFO: Initial setup...
Oct 03 19:10:26 INFO: Creating directory /Users/superuser/pyznap...
Oct 03 19:10:26 INFO: Creating sample config /Users/superuser/pyznap/pyznap.conf...
Oct 03 19:10:26 INFO: Finished successfully...

(pyznap) superuser@mac ~ % brew search setuptools
==> Formulae
python-setuptools ✔

Looking back, python-setuptools was installed by Brew, but apparently venv doesn't include them automagically.

I also reviewed the virtualenv link from the README.md, and tried venv that way, but the current version of pipenv install pyznap doesn't install setuptools either.

I'd say this is more of a venv issue, but one worth noting in the README.

@dalito
Copy link

dalito commented Oct 4, 2024

In earlier Python versions setuptools were installed into every virtual env. This stopped at some point (in 3.8? - I can't remember exactly). It is not a venv issue but a missing dependency specification in pyznap which has not been adapted to modern Python packaging (no pyproject.toml yet).

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

2 participants