Python Datetime Import Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack no module named datetime python Overflow the company Business Learn more about hiring developers or posting ads with us
Install Python Datetime
Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community importerror: no module named datetime virtualenv of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up ImportError: No module named datetime up vote 22 down vote favorite 1 When I upgrade my importerror: cannot import name 'datetime' Ubuntu into 14.04 from 12.04, this time I get this error: ImportError: No module named datetime python ubuntu-12.04 ubuntu-14.04 share|improve this question edited Oct 4 '14 at 13:50 Tshepang 4,7061059103 asked Sep 25 '14 at 5:25 akbsmile 2391312 1 you get this error while doing what ? –g4ur4v Sep 25 '14 at 5:26 which version of python are you using ? –d-coder Sep 25 '14 at 5:28
Django No Module Named Datetime
Yes, while I'm upgrading it and also after it finish upgrading, the error is still there. –akbsmile Sep 25 '14 at 5:31 the version I'm using is python 2.7.6 –akbsmile Sep 25 '14 at 5:32 add a comment| 9 Answers 9 active oldest votes up vote 41 down vote accepted This happened to me when I created a virtualenv and then upgraded from 12.04 to 14.04. I had to delete my virtualenv and recreate it, and after doing that, everything worked again. share|improve this answer answered Oct 22 '14 at 2:38 erjiang 25.8k44478 3 I had the same problem after I did apt-get dist-upgrade my Debian. Solution was to delete the virtualenv and recreate it. –Sebastian Jylanki Oct 22 '14 at 15:57 2 Thanks for the hint! Simply running mkvirtualenv $my_venv_name solved it for me. –Chriki Jan 20 '15 at 17:31 1 same happened for me after upgrading from 14.04 to 16.04 –philx_x May 26 at 16:16 add a comment| up vote 23 down vote Just run this command. It worked like a charm! $ cp /usr/bin/python2.7 $(which python2.7) This just happened to me after the 14.10 update, and it seems to be because my virtual environments have old copies of /usr/bin/python2.7 that — unlike the ne
Course 701 points Submitted by preetom about 3 years ago ImportError: cannot import name datetime from datetime import datetime now = datetime.now() yr ubuntu 16.04 importerror: no module named datetime = now.year mn = now.month day = now.day hr = now.hour mnt pip install datetime = now.minute sec = now.second print str(day) + "/" + str(mn) + "/" + str(yr), \ str(hr) +
Importerror No Module Named Datetime Windows
":" + str(mnt) + ":" + str(sec) when i try to run this code in console, this pops out: Traceback (most recent call last): File "datetime.py", http://stackoverflow.com/questions/26031160/importerror-no-module-named-datetime data-to="">line 1, in
communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more http://askubuntu.com/questions/509283/python-no-module-named-datetime about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Ask Ubuntu Questions Tags Users Badges Unanswered Ask Question _ Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the no module top Python: no module named datetime? up vote 35 down vote favorite 5 OS: Ubuntu 14.04 LTS Python: 2.7.6 My installation of Gourmet Recipe Manager suddenly stopped loading. When I run it in a terminal window, I get the following at the end of the traceback: import datetime as dt ImportError: No module named datetime So far as I can tell, nothing has been changed and my Python installation is up no module named to date. It simply quit working yesterday. I'd certainly appreciate a good approach to diagnose and fix this problem! Update: thanks to all who replied! Tim, I'm sorry if I asked this question in the wrong place. Please chalk it up to being a new guy simply following the links from the Ubuntu website. TheSchwa, I tried your suggestion and got the same error message as above. muru, the package seems to be installed, but I have no idea if it's installed/configured correctly. How might I find out? I'm sorry for all the questions, but I'm an old RedHat guy who has been away from Linux for some time. All of the apt/dpkg stuff is new to me. python share|improve this question edited Dec 12 '14 at 17:27 Thomas Ward♦ 26.8k1673122 asked Aug 10 '14 at 6:51 Joe 179124 While this is (just) on topic here, you might get a better response on Stack Overflow. Also, I can't reproduce it. No errors at all, on the same set-up as you... –Tim Aug 10 '14 at 7:44 What happens if you try import datetime in the python interpreter? You can start the interpreter by opening a terminal and executing python. You can leave it with Ctrl+d. &nda