{"id":1589,"date":"2014-12-15T10:28:38","date_gmt":"2014-12-15T15:28:38","guid":{"rendered":"http:\/\/cd34.com\/blog\/?p=1589"},"modified":"2014-12-15T10:28:38","modified_gmt":"2014-12-15T15:28:38","slug":"importerror-no-module-named-datetime","status":"publish","type":"post","link":"https:\/\/cd34.com\/blog\/framework\/importerror-no-module-named-datetime\/","title":{"rendered":"ImportError: No module named datetime"},"content":{"rendered":"<p>Of course, a new upgrade to Python on my devbox and the virtualenv breaks. And, merely reinstalling the virtualenv over top doesn&#8217;t work.<\/p>\n<p>This is where you need to make sure your python project has an adequate setup.py to install the dependencies or you&#8217;re going to end up reinstalling by hand.<\/p>\n<p>First, deactivate and make sure you&#8217;re not in the virtualenv. Get into the virtualenv&#8217;s top level directory and:<\/p>\n<p><code><br \/>\ncd \/virtualenvroot<br \/>\nrm -rf bin\/ include\/ lib\/ local\/<br \/>\nvirtualenv \/virtualenvroot<br \/>\nsource bin\/activate<br \/>\n<\/code><\/p>\n<p>Then, rerun setup.py with either install or develop and you should be set.<\/p>\n<div style=\"float:left;\">\n<div id=\"fb-root\"><\/div>\n<fb:like href=\"https:\/\/cd34.com\/blog\/framework\/importerror-no-module-named-datetime\/\" width=\"250\" send=\"false\" show_faces=\"false\" layout=\"button_count\" action=\"recommend\"><\/fb:like>\n<\/div><div style=\"clear:both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p>Of course, a new upgrade to Python on my devbox and the virtualenv breaks. And, merely reinstalling the virtualenv over top doesn&#8217;t work. This is where you need to make sure your python project has an adequate setup.py to install the dependencies or you&#8217;re going to end up reinstalling by hand. First, deactivate and make [&hellip;]<\/p>\n<div style=\"float:left;\">\n<div id=\"fb-root\"><\/div>\n<fb:like href=\"https:\/\/cd34.com\/blog\/framework\/importerror-no-module-named-datetime\/\" width=\"250\" send=\"false\" show_faces=\"false\" layout=\"button_count\" action=\"recommend\"><\/fb:like>\n<\/div><div style=\"clear:both;\"><\/div>","protected":false},"author":15,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,7],"tags":[299,73],"class_list":["post-1589","post","type-post","status-publish","format-standard","hentry","category-framework","category-python","tag-python","tag-virtualenv"],"_links":{"self":[{"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/posts\/1589","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/comments?post=1589"}],"version-history":[{"count":1,"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/posts\/1589\/revisions"}],"predecessor-version":[{"id":1590,"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/posts\/1589\/revisions\/1590"}],"wp:attachment":[{"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/media?parent=1589"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/categories?post=1589"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cd34.com\/blog\/wp-json\/wp\/v2\/tags?post=1589"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}