12

I'm trying to get a program called hangoutsbot to work on my linux server. I'm currently using a digital ocean server. However, every time I try to run the script it gives me an error that says:

ImportError: No module named 'appdirs'

I'm not sure what to do here. I've already tried installing appdirs from npm to no avail. This script works fine on my mac, however it doesn't seem to want to run on my linux server. Any help would be appreciated.

Kenan
  • 2,086
  • 1
  • 16
  • 20
Alex
  • 488
  • 2
  • 5
  • 20

4 Answers4

16

I ran across the same problem after solving the "missing pyparsing module" bug over here. I then started getting this error:

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 then used the manual installation steps there to find the missing package on pypi.python.org and came up with this manual installation sequence:

wget https://pypi.python.org/packages/48/69/d87c60746b393309ca30761f8e2b49473d43450b150cb08f3c6df5c11be5/appdirs-1.4.3.tar.gz
gunzip appdirs-1.4.3.tar.gz
tar -xvf appdirs-1.4.3.tar
cd appdirs-1.4.3
sudo python setup.py install

And that fixed it!

Community
  • 1
  • 1
Eloi George
  • 186
  • 1
  • 5
3

For some reason your pipenv installation is not completely done, maybe if you just uninstall and install all missing packages again, it can works. For example, if you are using a MAC:

sudo pip uninstall <missing packages> and after sudo pip install <missing packages>

In this specific case:

sudo pip uninstall appdirs and sudo pip install appdirs

Vinicius
  • 31
  • 2
0

When you run hangoutsbot you'll need to specifically call the python version that has the modules installed. The following worked for me and I had python3.4 and python3.5 installed.

python3.5 hangoutsbot/hangoutsbot.py -d
0

I had this issue on Ubuntu 14.04 , which ships with a really old version of pip. I was using python 2.7. Upgrading to a newer version of pip with "pip install --upgrade pip" solved this issue for me. (I did this within my virtualenv, but could be needed at the system level depending on what you are trying to do.)

This was where I discovered the solution:

https://www.reddit.com/r/Python/comments/5pwngp/setuptools_34_has_been_released_and_breaks_with/
Joe J
  • 9,985
  • 16
  • 68
  • 100
  • `pip install --upgrade pip` didn't work on my Linux Mint 18.1 (based on Ubuntu 16.04) as it refused to overwrite the system installation of pip: running `apt-get remove python-pip` followed by [installing pip](https://pip.pypa.io/en/stable/installing/) worked for me. – Homme Zwaagstra Mar 16 '17 at 09:30