2

I just uploaded my project to be hosted on webfaction and am getting the following error.

No module named dateutil.relativedelta

I'm using this module in one of my forms. Is this something to do with the python path?

Austin
  • 4,296
  • 6
  • 40
  • 52
  • Are you using PIP to manage dependencies? Perhaps `dateutil` was installed into your local `site-packages` directory which doesn't exist on the server. – Josh Smeaton Jun 29 '12 at 01:56
  • 1
    Yes, PIP and easy_install. When I run "pip install python-dateutil" on the server i get this... Requirement already satisfied (use --upgrade to upgrade): python-dateutil in /home/username/lib/python2.4/python_dateutil-2.1-py2.4.egg Requirement already satisfied (use --upgrade to upgrade): six in /home/username/lib/python2.4/six-1.1.0-py2.4.egg (from python-dateutil) – Austin Jun 29 '12 at 02:20
  • python2.4? Are you sure that's the version of python being used for your django project? – Josh Smeaton Jun 29 '12 at 02:35
  • I'm almost positive it's python2.7. About 95% sure. Does python path have anything to do with this?I tried to upload my "site-packages" directory but that didn't do anything – Austin Jun 29 '12 at 02:41
  • 2
    The problem most likely is that django is running under python2.7, but your pip is currently installing for python2.4. I've not used webfaction so I don't know how it's managed. You might want to change your bash_profile so that python2.7 comes before python2.4 in your path. This isn't a problem with pythonpath - it's a problem with the installed python version. – Josh Smeaton Jun 29 '12 at 02:50
  • Following @Josh comment, check out: http://docs.webfaction.com/software/python.html – AJJ Jun 29 '12 at 09:00

1 Answers1

0

Worked for me on Ubuntu when Eclipse gave the same error:

sudo apt-get install python-dateutil
SpiRail
  • 1,377
  • 19
  • 28