catalyst-team / catalyst

Accelerated deep learning R&D
https://catalyst-team.com
Apache License 2.0
3.3k stars 388 forks source link

Dependency `packaging` not specified — ModuleNotFoundError #1417

Closed lainisourgod closed 2 years ago

lainisourgod commented 2 years ago

🐛 Bug Report

Hi!

Catalyst uses dependency packaging here but does not specify it directly in any of dependency files.

When installing catalyst via poetry poetry add catalyst, packaging dependency isn't installed. This bug is silent most of the times because some other packages as jupyter install packaging, but in my env this bug there is none of these packages.

How To Reproduce

Steps to reproduce the behavior:

  1. mkdir test-proj && cd test-proj
  2. Create pyproject.toml with catalyst being the only dependency
    
    [tool.poetry]
    name = "test-proj"
    version = "0.1.0"
    description = ""
    authors = ["Your Name <you@example.com>"]

[tool.poetry.dependencies] python = "^3.7" catalyst = "^22.4"

[build-system] requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api"

3. Create `main.py`
```bash
mkdir test_proj && touch test_proj/main.py && cat "import catalyst" > test_proj/main.py
  1. Get error message
    ❯ poetry run python test_proj/main.py 
    Traceback (most recent call last):
    File "test_proj/main.py", line 1, in <module>
    import catalyst
    File "/home/user/.cache/pypoetry/virtualenvs/test_proj-vU8Qtjuj-py3.7/lib/python3.7/site-packages/catalyst/__init__.py", line 12, in <module>
    from catalyst.settings import SETTINGS
    File "/home/user/.cache/pypoetry/virtualenvs/test_proj-vU8Qtjuj-py3.7/lib/python3.7/site-packages/catalyst/settings.py", line 6, in <module>
    from packaging.version import Version
    ModuleNotFoundError: No module named 'packaging'

Expected behavior

Environment

Catalyst version: 22.04
PyTorch version: 1.11.0+cu102
Python version: 3.7

Checklist

FAQ

Please review the FAQ before submitting an issue:

Scitator commented 2 years ago

🤔 Nice catch, could you please submit a PR with updated requirements?

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.