Friday, January 3, 2020

Re: ModuleNotFoundError: No module named 'datetime'

How about deleting your virtualenv and recreating a new one.
It may be located here ::: C:\Users\<user>\.virtualenvs\cargo

When reactivated, could you please provide as with the results of "echo $PATH" from cmdline.


On Fri, Jan 3, 2020 at 7:09 PM sanusi ibrahim adekunle <ibrahimsanusiwizy@gmail.com> wrote:
You do not have datetime module installed on your virtual environment. 

To install, type this command: "pip install datetime"

On Fri, Jan 3, 2020, 18:37 bhushan Gupta <bhushangupta51@gmail.com> wrote:
I want to use Django to build a simple portal. I have done the following on Windows 10
installed Python 3.8 and pip
Installed virtualenv 
Created an env 'cargo' 
Installed Djengo 3.0.1
Set the path: 
C:\Program Files (x86)\Python38-32\
C:\Program Files (x86)\Python38-32\Python.exe
C:\Program Files (x86)\Python38-32\Scripts\
C:\Program Files (x86)\Python38-32\Lib\site-packages
C:\Program Files (x86)\Python38-32\Lib\site-packages\django\bin\

I have activated the environment - (cargo) C:\Users\Gupta Consulting\Envs\cargo>
When I start a project using - python django-admin.py startproject cargo  I get the following error:
(cargo) C:\Users\Gupta Consulting\Envs\cargo>django-admin.py startproject myproject
Traceback (most recent call last):
  File "C:\Users\GUPTAC~1\Envs\cargo\Scripts\django-admin.py", line 2, in <module>
    from django.core import management
  File "c:\users\guptac~1\envs\cargo\lib\site-packages\django\__init__.py", line 1, in <module>
    from django.utils.version import get_version
  File "c:\users\guptac~1\envs\cargo\lib\site-packages\django\utils\version.py", line 1, in <module>
    import datetime
ModuleNotFoundError: No module named 'datetime'

I commented out "import datetime" from the vsersion.py file. Then it did not find the next module in in the version.py file.

Looks like there is a setup problem.
Any help will be appreciated
Thanks. 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/17cf2d01-94f8-45e7-a4f6-171e93e32176%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAGvEB52i2MeHcn%2BwTpiidXtVRCOQogFxiz6Gg_yuCJ5%2B7Mmq-g%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAJenkLBmGfz_wQ9rsZC5p_ByjapcJqwHnYgR6LRbRkcDNYVwrw%40mail.gmail.com.

No comments:

Post a Comment