donnemartin / saws

A supercharged AWS command line interface (CLI).
Other
5.24k stars 281 forks source link

ImportError: No module named dateutil.parser #42

Closed timmattison closed 8 years ago

timmattison commented 8 years ago

I installed saws using pip like the documentation states:

pip install saws

When I first try to run it I get this error:

Traceback (most recent call last):
  File "/usr/local/bin/saws", line 7, in <module>
    from saws.main import cli
  File "/usr/local/lib/python2.7/site-packages/saws/main.py", line 20, in <module>
    from .saws import Saws
  File "/usr/local/lib/python2.7/site-packages/saws/saws.py", line 31, in <module>
    from awscli import completer as awscli_completer
  File "/usr/local/lib/python2.7/site-packages/awscli/completer.py", line 12, in <module>
    import awscli.clidriver
  File "/usr/local/lib/python2.7/site-packages/awscli/clidriver.py", line 16, in <module>
    import botocore.session
  File "/usr/local/lib/python2.7/site-packages/botocore/session.py", line 26, in <module>
    import botocore.credentials
  File "/usr/local/lib/python2.7/site-packages/botocore/credentials.py", line 22, in <module>
    from dateutil.parser import parse
ImportError: No module named dateutil.parser

I checked to see if dateutil was installed and pip thinks it is:

$ pip install python-dateutil
Requirement already satisfied (use --upgrade to upgrade): python-dateutil in /usr/local/lib/python2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): six>=1.5 in /usr/local/lib/python2.7/site-packages (from python-dateutil)

I then tried to upgrade it just in case and pip thinks it is up to date:

$ pip install --upgrade python-dateutil
Requirement already up-to-date: python-dateutil in /usr/local/lib/python2.7/site-packages
Requirement already up-to-date: six>=1.5 in /usr/local/lib/python2.7/site-packages (from python-dateutil)

Is this possibly a different dependency that is missing or is my environment borked?

donnemartin commented 8 years ago

@timmattison I suspect there's something in your environment that's causing this. Based on the log it seems awscli or its underlying dependencies is the culprit. You might want to try to update awscli to see if that helps.

I just now tried an install from a fresh virtualenv with Python 2.7.10 with no issues. Can you try installing in a virtualenv? Instructions are here.

timmattison commented 8 years ago

Fixed:

sudo pip uninstall python-dateutil
pip install python-dateutil

Now it is running. Thanks!

donnemartin commented 8 years ago

@timmattison great, thanks for the update, glad you're up and running!

diegoavillegasg commented 6 years ago

@timmattison thanks for the update! it work for me too!

raengineer commented 6 years ago

@timmattison thank you this worked for me as well, I had the issue on Windows and needed to run the Anaconda Prompt as Administrator. I actually had multiple modules missing and used the same uninstall/install to fix all.

mohitsharma99 commented 4 years ago

Fixed:

sudo pip uninstall python-dateutil
pip install python-dateutil

Now it is running. Thanks!

it is not working

Ruthwik321 commented 4 years ago

python-dateutil is installed But i'm getting the error module not found