Installing python dateutil
Asked Answered
E

3

52

I tried to install python dateutil for my django tastypie but unsuccessful,

http://labix.org/python-dateutil#head-2f49784d6b27bae60cde1cff6a535663cf87497b

I downloaded the tar file in c:/python27 and unzipped it,

I get the following error msg,

**C:\Python27\Scripts>**easy_install dateutil-1.5
Searching for dateutil-1.5
Reading http://pypi.python.org/simple/dateutil-1.5/
Couldn't find index page for 'dateutil-1.5' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
No local packages or download links found for dateutil-1.5
Best match: None
Traceback (most recent call last):
  File "C:\Python27\Scripts\easy_install-script.py", line 8, in <module>
    load_entry_point('setuptools==0.6c11', 'console_scripts', 'easy_install')()
  File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 171
2, in main
  File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 170
0, in with_ei_usage
  File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 171
6, in <lambda>
  File "C:\Python27\lib\distutils\core.py", line 152, in setup
    dist.run_commands()
  File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
  File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 211
, in run
  File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 434
, in easy_install
  File "build/bdist.linux-i686/egg/setuptools/package_index.py", line 475, in fe
tch_distribution
AttributeError: 'NoneType' object has no attribute 'clone'
Elveraelves answered 15/8, 2012 at 0:34 Comment(0)
B
99

This will install tastypie and its dependencies:

$ easy_install pip
$ pip install django-tastypie

To get only dateutil:

$ pip install python-dateutil
Byyourleave answered 15/8, 2012 at 0:39 Comment(2)
I had to use the sudo command listed in tastypie's docs (django-tastypie.readthedocs.org/en/latest/tutorial.html). Otherwise, I use virtualenv for the python.django packages for each project.Genniegennifer
@RyanWalton: I adopted a general 'never use sudo'/'always use virtualenv' rule a few years ago. It's helped reduce the number of virtualenv'd projects that I've had to fight to get working on my system, and made it less likely for me to forget adding something to requirements.txt.Allison
V
15

I am not sure if this is different on Windows, but it does not appear you are referencing an actual link (see the Reading line). Instead, try this:

easy_install python-dateutil

That will (hopefully) get the package you need. Also, see this post for what looks like a similar issue.

Vaasta answered 15/8, 2012 at 0:54 Comment(2)
@starbox Sorry, should have mentioned that was meant to be entered at the command line (similar to Lois Di Qual's answer above). The error you got looks like it came from trying to include that line in your actual Python file.Vaasta
I'm using virtualenv and pip is available in virtualenv, so just using pip install python-dateutil works too as mentioned earlierLaoighis
C
5

On Windows:

Simply use following code,

$ pip install python-dateutil

If you want with easy_install try below command,( run Command Prompt CMD as Administrator )

$ easy_install python-dateutil

On Ubuntu:

For Ubuntu OS use following code,

sudo apt-get install python-dateutil
Connate answered 11/8, 2018 at 11:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.