replicate/replicate-python

Error when importing package: `ModuleNotFoundError: No module named 'packaging'`

nathanfdunn opened this issue · 3 comments

When I perform a fresh install of the package and then attempt to import it, I get this error

Traceback (most recent call last):
  File "/Users/nathandunn/Projects/replicate-test/test.py", line 1, in <module>
    import replicate
  File "/Users/nathandunn/Projects/replicate-test/venv/lib/python3.10/site-packages/replicate/__init__.py", line 2, in <module>
    from .client import Client
  File "/Users/nathandunn/Projects/replicate-test/venv/lib/python3.10/site-packages/replicate/client.py", line 9, in <module>
    from replicate.model import ModelCollection
  File "/Users/nathandunn/Projects/replicate-test/venv/lib/python3.10/site-packages/replicate/model.py", line 6, in <module>
    from replicate.version import VersionCollection
  File "/Users/nathandunn/Projects/replicate-test/venv/lib/python3.10/site-packages/replicate/version.py", line 7, in <module>
    from replicate.schema import make_schema_backwards_compatible
  File "/Users/nathandunn/Projects/replicate-test/venv/lib/python3.10/site-packages/replicate/schema.py", line 1, in <module>
    from packaging import version
ModuleNotFoundError: No module named 'packaging'

I am running macOS 11.6.6, Python 3.10.4

Steps to reproduce

$ mkdir new-folder
$ cd new-folder
$ python -m venv venv
$ source venv/bin/activate
$ pip install replicate
$ echo 'import replicate' > test.py
$ python test.py

Running pip install packaging fixed this for me, so I think your package has an undeclared dependency

Ah, this is actually fixed in main, but we didn't ship a new release -- sorry! Doing that now. You should be able to pip install -U replicate in 5 mins. :)

Thanks for the report!