ImportError: No module named appdirs

735 views
Skip to first unread message

Sean Pendergrast

unread,
Apr 20, 2017, 4:38:29 PM4/20/17
to NetBox
Trying to install NetBox for the first time on a Debian box.

I have been following the directions located at


I have installed both the Python 3 and Python 2 required modules (which may actually be part of the issue - more on this below), and opted to pull the latest release (v1.9.5) rather than clone the repository.  I am able to complete all the steps up to downloading the release, and creating the symlink.

After that I run "pip install -r requirements.txt" which happily chunks along but it never finishes.  The process runs most of the way through but eventually drops an error that I don't have saved.  It was a pip.exceptions.InstallationError I believe.  At any rate, from that point forward when I try to run the install again, I get the following message.

Traceback (most recent call last):
  File "/usr/bin/pip", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 74, in <module>
    import appdirs
ImportError: No module named appdirs

I tried running "pip3 install -r requirements.txt", which as you can imagine didn't help.  It throws a different error on this one, complaining about no module named pyparsing.

In an attempt to reset everything, I removed all of the python modules, deleted the netbox tree and recloned it, reinstalled all of the python stuff for python3 only, and tried again, but it never even starts running the installation, it just gives me the "pyparsing" module error again.

At this point, neither pip or pip3 will respond (for example to list the installed modules or try to uninstall something).  Running either just gives the Traceback error.

Prior to starting the install, I did update and upgrade through apt-get.

At a loss here and not sure where to go first or next.

Thanks for the help.

Sean Pendergrast

unread,
Apr 20, 2017, 5:46:28 PM4/20/17
to NetBox
More information here.

First of all, this is running on Debian 8.

So, I manually removed all of the modules that had been previously installed, making sure to remove the python2.7 and python3.4 modules directories at the start.

I followed the suggestion made by Brian Candler in this thread:

and removed "python-psycopg2" from the initial install.  I re-cloned the repo, and ran "pip3 install -r requirements.txt" which ran smoothly up until I got these errors:

Running setup.py install for coreapi
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/usr/local/lib/python3.4/dist-packages/setuptools/__init__.py", line 12, in <module>
        import setuptools.version
      File "/usr/local/lib/python3.4/dist-packages/setuptools/version.py", line 1, in <module>
        import pkg_resources
      File "/usr/local/lib/python3.4/dist-packages/pkg_resources/__init__.py", line 72, in <module>
        import packaging.requirements
      File "/usr/local/lib/python3.4/dist-packages/packaging/requirements.py", line 9, in <module>
        from pyparsing import stringStart, stringEnd, originalTextFor, ParseException
    ImportError: No module named 'pyparsing'
    Complete output from command /usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-q6o3k7_x/coreapi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-hj4su1zh-record/install-record.txt --single-version-externally-managed --compile:
    Traceback (most recent call last):

  File "<string>", line 1, in <module>

  File "/usr/local/lib/python3.4/dist-packages/setuptools/__init__.py", line 12, in <module>

    import setuptools.version

  File "/usr/local/lib/python3.4/dist-packages/setuptools/version.py", line 1, in <module>

    import pkg_resources

  File "/usr/local/lib/python3.4/dist-packages/pkg_resources/__init__.py", line 72, in <module>

    import packaging.requirements

  File "/usr/local/lib/python3.4/dist-packages/packaging/requirements.py", line 9, in <module>

    from pyparsing import stringStart, stringEnd, originalTextFor, ParseException

ImportError: No module named 'pyparsing'

----------------------------------------
Cleaning up...
Command /usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-q6o3k7_x/coreapi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-hj4su1zh-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip-build-q6o3k7_x/coreapi
Storing debug log for failure in /root/.pip/pip.log

That's all for now.
Reply all
Reply to author
Forward
0 new messages