1

I can find the module https://pypi.python.org/pypi/DateTime

But I don't know the command to install via easy_install. I'm getting a no module named datetime error and so I need to get this installed.

o_O
  • 4,862
  • 11
  • 46
  • 84
  • Out of curiosity, why do you want to install Zope's `DateTime` module? The code is rather... outdated and archaic. Outside of a Zope or Plone project, I can't see much use for it. – Martijn Pieters Dec 31 '13 at 00:20
  • I'm using a python application with lots of community modules. One of the modules I want has the dependency on DateTime. – o_O Dec 31 '13 at 01:09
  • @o_O: Are you sure? Because the error message you posted is complaining about `datetime`, not `DateTime`. – abarnert Dec 31 '13 at 02:30
  • Yeah I just wrote it from memory and not a copy paste. Following the answers below set me straight and fixed my errors. – o_O Dec 31 '13 at 02:39

3 Answers3

4

The package, like the module, is named DateTime, not datetime. datetime is a different module, which is already part of Python's standard library.

When I do this, it works:

$ sudo easy_install-2.7 DateTime

Because easy_install is a big collection of PyPI-scraping hacks designed to make your life easier rather than an interface to a well-defined API, sometimes you can get away with getting the case wrong, or even leaving bits off, and it'll figure out what you mean and install the right thing. But you should not rely on this, because sometimes you can't get away with it.

Of course you really should be using pip instead of easy_install.

And you probably shouldn't be using this module at all. Notice that it says right at the top "Unless you need to communicate with Zope 2 APIs, you're probably better off using Python's built-in datetime module". And the fact that your error is no module named datetime implies pretty strongly that your code is trying to use datetime, not DateTime, so installing this won't help you.

abarnert
  • 313,628
  • 35
  • 508
  • 596
1

Module names are case sensitive. easy_install DateTime works for me:

enter image description here

BartoszKP
  • 32,105
  • 13
  • 92
  • 123
0

If you are on Mac:

In order to install the DateTime library you have to install 'pip' first (see Official instructions on How to install pip)

Then you can install DateTime library running this command on Terminal:

pip install DateTime

Hope it helps.

Community
  • 1
  • 1
Edison Q
  • 71
  • 1
  • 2
  • 7