0

Django is unable to create a new project folder when I code after activating virtualenv (namely myDjangoEnv):

django-admin.py startproject myproject

The error displayed is:

Unable to create process using 'C:/Users/Shreyas Jain/Miniconda3/envs/myDjangoEnv\python.exe "C:\Users\Shreyas Jain\Miniconda3\envs\myDjangoEnv\django-admin.py"  startproject myproject'

When I tried the same command without activating the virtualenv, django created a project folder without any error.

This problem is occurring from past 2-3 days and I am still unable to fix this issue. Please help me. Thanks in advance.

Before asking this question, I've tried to google it a lot. I read so many community answers on various communities and also I read a lot on StackOverflow. But unfortunately, nothing helped me.

  • this didn't work? https://stackoverflow.com/a/5601612/4186008 – Aman Garg Apr 26 '19 at 06:40
  • have you tried `python -m django startproject `? – Josh21 Apr 26 '19 at 06:45
  • @AmanGarg unfortunately not. The error shown is: "python: can't open file 'C:\Users\Shreyas': [Errno 2] No such file or directory." – Shreyas Jain Apr 26 '19 at 06:52
  • @Josh21 Yes. It worked for me. Thanks a lot. – Shreyas Jain Apr 26 '19 at 06:54
  • @Josh21 But can you tell me why it is not working with django-admin? – Shreyas Jain Apr 26 '19 at 06:55
  • @ShreyasJain will post it as an answer then; click the check in the answer if it helps you. – Josh21 Apr 26 '19 at 06:55
  • @Josh21 Can you tell me why it is not working with django-admin? Because some days ago, I was able to do this using django-admin. – Shreyas Jain Apr 26 '19 at 07:01
  • @ShreyasJain, I don't know why `django-admin.py` does not work as I am using `python -m django startproject ` whenever I create new projects, and did not bother using other options, since its working fine. You may check the answer to know that this question has been resolved (at least you are able to start new project) – Josh21 Apr 26 '19 at 07:03

1 Answers1

-1

Try python -m django startproject <project name> to create new project.

Josh21
  • 506
  • 5
  • 15