I know that this question was asked million of time regarding other libraries. However none of the answers in other discussions was helpful.
I tried:
import datetime
print datetime.version
import datetime
print datetime._version_
import datetime
print datetime.__version__
None is working.
It says
attribute error: AttributeError: 'module' object has no attribute 'version'
Same for the others.
This library do have versions: https://pypi.python.org/pypi/DateTime
datetime
is different with DateTime
. datetime
is the native Python library, while your link is a third party library. Try using pkg_resources
import pkg_resources
pkg_resources.get_distribution("DateTime").version
As datetime
is a build-in package, it correspondences with your Python installation. https://docs.python.org/2/library/datetime.html
The DateTime module you provided is not the same.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With