Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

ModuleNotFoundError: No module named 'packaging' #39

Closed
johanndiedrick opened this issue Jan 7, 2020 · 2 comments
Closed

ModuleNotFoundError: No module named 'packaging' #39

johanndiedrick opened this issue Jan 7, 2020 · 2 comments

Comments

@johanndiedrick
Copy link

johanndiedrick commented Jan 7, 2020

I started a fresh install of fastai2 and got the following error when installing with pip:

(fastai2) paperspace@ps4y32elp:~/fastai2$ pip install git+https://github.com/fastai/fastai2
Collecting git+https://github.com/fastai/fastai2
  Cloning https://github.com/fastai/fastai2 to /tmp/pip-req-build-osgksw0h
  Running command git clone -q https://github.com/fastai/fastai2 /tmp/pip-req-build-osgksw0h
    ERROR: Command errored out with exit status 1:
     command: /home/paperspace/anaconda3/envs/fastai2/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-osgksw0h/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-osgksw0h/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-req-build-osgksw0h/pip-egg-info
         cwd: /tmp/pip-req-build-osgksw0h/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-req-build-osgksw0h/setup.py", line 1, in <module>
        from packaging.version import parse
    ModuleNotFoundError: No module named 'packaging'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

This was solved by running pip install packaging and re-rerunning the pip install command for fastai2, but I wasn't sure where upstream this fix could/should be made. Just wanted to let you all know.

@sgugger
Copy link
Contributor

sgugger commented Jan 8, 2020

For a dev install, you need to pip install packaging before being able to run the setup. We can't work around by just putting as a dep since the setup file itself uses packaging.
Note that this is documented in the README.

@sgugger sgugger closed this as completed Jan 8, 2020
@sgugger
Copy link
Contributor

sgugger commented Jan 8, 2020

Oh actually you're right, it's only mentioned for the dev install, will fix that today!

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

No branches or pull requests

2 participants