Need help: django-admin.py startproject [projectname] creates directory which I cannot access

34 views
Skip to first unread message

Daisy

unread,
May 2, 2018, 5:13:29 PM5/2/18
to Django users
I installed django according to provided instructions and I am trying to follow the Django article: Writing your first Django app, part 1 but I am stuck at Creating a project with command: django-admin startproject mysite.
The problem is that I CAN execute command but when I try to access directory with cd mysite I get the message "The system cannot find the path specified." although when I try to execute command startproject again I get the message that it already exists. (see attachment)
I cannot find new directory via windows explorer neither.

I have installed django 2.0.5 version and python 3.6.3 (32-bit).
djangoproblem.JPG

Anthony Flury

unread,
May 2, 2018, 7:08:04 PM5/2/18
to django...@googlegroups.com, Daisy
Lets troubleshoot:

* Does the directory show up when you do a *dir* command in projectdir ?
* Can you do anything on the *mysite* directory - can you rename it,
or even delete it ?
* Can you see it in File explorer
* Can you manually create a directory in your *projectdir* ?
* Can you create a different projectdir - and run *django-admin
startproject mysite* in there ?

My gut feeling is that this is a diskdrive/OS type issue - rather than
Django specific

You may have a corrupted directory - or a bad section of disk; try the
troubleshooting steps above first.



On 02/05/18 22:09, Daisy wrote:
> I installed django according to provided instructions and I am trying
> to follow the Django article: Writing your first Django app, part 1
> <https://docs.djangoproject.com/en/2.0/intro/tutorial01/> but I am
> stuck at Creating a project with command: django-admin startproject
> mysite.
> The problem is that I CAN execute command but when I try to access
> directory with cd mysite I get the message "The system cannot find the
> path specified." although when I try to execute command startproject
> again I get the message that it already exists. (see attachment)
> I cannot find new directory via windows explorer neither.
> I have installed django 2.0.5 version and python 3.6.3 (32-bit).
> --
> 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...@googlegroups.com
> <mailto:django-users...@googlegroups.com>.
> To post to this group, send email to django...@googlegroups.com
> <mailto:django...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/c574d479-a1b6-4c20-91ab-208ae42d4996%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/c574d479-a1b6-4c20-91ab-208ae42d4996%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.


--
--
Anthony Flury
email : *Anthon...@btinternet.com*
Twitter : *@TonyFlury <https://twitter.com/TonyFlury/>*

Daisy

unread,
May 3, 2018, 1:59:34 AM5/3/18
to Django users
Thank you very much for your reply, and here I my answers:
  * Does the directory show up when you do a *dir* command in projectdir ? It does not show up, although it says that there are 2 directories (see attachment). 

  * Can you do anything on the *mysite* directory - can you rename it, 
    or even delete it ? I can't - system cannot find the file specified.
  * Can you see it in File explorer - No.
  * Can you manually create a directory in your *projectdir* ? - Yes, and it is displayed after command *dir*.

  * Can you create a different projectdir - and run *django-admin 
    startproject mysite* in there ? - I tried creating it on different paths, both on C and D disk, but it was the same behavior.

What can I do now? :)
directories.JPG

Anthony Flury

unread,
May 3, 2018, 3:10:17 AM5/3/18
to django...@googlegroups.com, Daisy
On 03/05/18 06:59, Daisy wrote:
> Thank you very much for your reply, and here I my answers:
>   * Does the directory show up when you do a *dir* command in
> projectdir ? It does not show up, although it says that there are 2
> directories (see attachment).
Those two directories '.' & '..' are standard in every directory
>   * Can you do anything on the *mysite* directory - can you rename it,
>     or even delete it ? I can't - system cannot find the file specified.
Very odd - points to a an OS/disk problem to be honest - I am not sure
Django is doing anything clever.
>   * Can you see it in File explorer - No.
>   * Can you manually create a directory in your *projectdir* ? - Yes,
> and it is displayed after command *dir*.
>   * Can you create a different projectdir - and run *django-admin
>     startproject mysite* in there ? - I tried creating it on different
> paths, both on C and D disk, but it was the same behavior.
>
> What can I do now? :)
>

Have you tried write a small Python application that creates a directory :

         from os import mkdirs
         top_dir = path.join(os.getcwd(), name)
         mkdirs(top_dir)

Copy that to a python file called '*create_dir.py*' in your *projectdir*
- and run it by this command '*python create_dir.py*'

One you run it you should have a new empty directory called
'python_created_me' - running the comand again should result in an error.

The reason for doing this is to check that the Python code that Django
is using does work ok.

--
Anthony Flury
email : *Anthon...@btinternet.com*
Twitter : *@TonyFlury <https://twitter.com/TonyFlury/>*

> > an email to django-users...@googlegroups.com <javascript:>
> > <mailto:django-users...@googlegroups.com <javascript:>>.
> > To post to this group, send email to django...@googlegroups.com
> <javascript:>
> > <mailto:django...@googlegroups.com <javascript:>>.
> <https://groups.google.com/group/django-users>.
> <https://groups.google.com/d/msgid/django-users/c574d479-a1b6-4c20-91ab-208ae42d4996%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/optout>.
>
>
> --
> --
> Anthony Flury
> email : *Anthon...@btinternet.com <javascript:>*
> Twitter : *@TonyFlury <https://twitter.com/TonyFlury/
> <https://twitter.com/TonyFlury/>>*
>
> --
> 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...@googlegroups.com
> <mailto:django-users...@googlegroups.com>.
> To post to this group, send email to django...@googlegroups.com
> <mailto:django...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/c93769b1-55ca-47f7-9f8f-474ab07ede88%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/c93769b1-55ca-47f7-9f8f-474ab07ede88%40googlegroups.com?utm_medium=email&utm_source=footer>.

Daisy

unread,
May 3, 2018, 3:25:02 AM5/3/18
to Django users
I tried what you suggested and got this:
D:\projectdir>python create_dir.py
Traceback (most recent call last):
  File "create_dir.py", line 1, in <module>
    from os import mkdirs
ImportError: cannot import name 'mkdirs'

Gerald Brown

unread,
May 3, 2018, 3:50:19 AM5/3/18
to django...@googlegroups.com

Is Django installed on your C: or D: drive?  If it is on C: then "mysite" should also be on C:

--
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.

Duška Miloradović

unread,
May 3, 2018, 3:53:23 AM5/3/18
to django...@googlegroups.com
It is on C. I tried to create "mysite" also on C path but the result is the same.

On Thu, May 3, 2018 at 9:49 AM, Gerald Brown <gsbr...@gmail.com> wrote:

Is Django installed on your C: or D: drive?  If it is on C: then "mysite" should also be on C:


On Thursday, 03 May, 2018 03:25 PM, Daisy wrote:
I tried what you suggested and got this:
D:\projectdir>python create_dir.py
Traceback (most recent call last):
  File "create_dir.py", line 1, in <module>
    from os import mkdirs
ImportError: cannot import name 'mkdirs'

среда, 02. мај 2018. 23.13.29 UTC+2, Daisy је написао/ла:
I installed django according to provided instructions and I am trying to follow the Django article: Writing your first Django app, part 1 but I am stuck at Creating a project with command: django-admin startproject mysite.
The problem is that I CAN execute command but when I try to access directory with cd mysite I get the message "The system cannot find the path specified." although when I try to execute command startproject again I get the message that it already exists. (see attachment)
I cannot find new directory via windows explorer neither.
I have installed django 2.0.5 version and python 3.6.3 (32-bit).
--
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.

--
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 post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

Ayser shuhaib

unread,
May 3, 2018, 7:21:13 AM5/3/18
to django...@googlegroups.com
Create your projectdir manually then inside the projectdir folder (right click with your mouse and open command window here)
After that continue with Django commands
django-admin startproject ...

> To post to this group, send email to django...@googlegroups.com
> <mailto:django...@googlegroups.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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.

Umar Kambala

unread,
May 3, 2018, 7:26:48 AM5/3/18
to django...@googlegroups.com

That its not recognized as internal or external command

django-admin startproject ...

> To post to this group, send email to django...@googlegroups.com
> <mailto:django...@googlegroups.com>.
Twitter : *@TonyFlury <https://twitter.com/TonyFlury/>*

--
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.

--
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 post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

Duška Miloradović

unread,
May 3, 2018, 8:24:18 AM5/3/18
to django...@googlegroups.com
Ayser, thank you very much but that did not help neither. It is still the same - command ends successfully but still I do not see new folder created.

django-admin startproject ...

> To post to this group, send email to django...@googlegroups.com
> <mailto:django...@googlegroups.com>.
Twitter : *@TonyFlury <https://twitter.com/TonyFlury/>*

--
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.

--
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 post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

James Farris

unread,
May 3, 2018, 9:44:51 AM5/3/18
to django...@googlegroups.com
If you run these two commands from your command line, what is the output?

python -V 
django-admin.py version
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

Duška Miloradović

unread,
May 3, 2018, 10:36:08 AM5/3/18
to django...@googlegroups.com
I wrote what versions I have installed in first post, but here is a result of what you've asked:
For the first command output is: Python 3.6.3 and for the second: 2.0.5


python -V 
django-admin.py version
django-admin startproject ...

--
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 post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

Anthony Flury

unread,
May 3, 2018, 11:09:01 AM5/3/18
to django...@googlegroups.com, Daisy
On 03/05/18 08:06, Anthony Flury wrote:
> On Thursday, 03 May, 2018 03:25 PM, Daisy wrote:
>
> I tried what you suggested and got this:
> D:\projectdir>python create_dir.py
> Traceback (most recent call last):
>   File "create_dir.py", line 1, in <module>
>     from os import mkdirs
> ImportError: cannot import name 'mkdirs'
>
Sorry - that should be :

            import os
            top_dir = path.join(os.getcwd(), 'python_created_me')
            os.makedirs(top_dir)
>
> Copy that to a python file called '*create_dir.py*' in your
> *projectdir* - and run it by this command '*python create_dir.py*'
>
> One you run it you should have a new empty directory called
> 'python_created_me' - running the comand again should result in an error.
>
> The reason for doing this is to check that the Python code that Django
> is using does work ok.
>
The other thing you could do is to use the File Manager search to see if
'my_site' has been created else where on your system

Fidel Leon

unread,
May 3, 2018, 12:03:24 PM5/3/18
to django...@googlegroups.com
Please try to create a different project specifying -v 3:
$ django-admin startapp -v 3 mytest

The output should tell you where django-admin is creating its files and could be a clue about where is your mysite :)

django-admin startproject ...

> To post to this group, send email to django...@googlegroups.com
> <mailto:django...@googlegroups.com>.
Twitter : *@TonyFlury <https://twitter.com/TonyFlury/>*

--
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...@googlegroups.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...@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

--
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...@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

For more options, visit https://groups.google.com/d/optout.


--

Duška Miloradović

unread,
May 3, 2018, 12:06:35 PM5/3/18
to Anthony Flury, django...@googlegroups.com
Anthony, I got this:

D:\projectdir>python create_dir.py
Traceback (most recent call last):
  File "create_dir.py", line 2, in <module>
    top_dir = path.join(os.getcwd(), 'python_created_me')
NameError: name 'path' is not defined

I searched for it through windows explorer again and I actually found it on this strange location: C:\VTRoot\HarddiskVolume1\projectdir\mysite
Do you have any clue how this happened?
How to make things right? :)

Fidel Leon

unread,
May 3, 2018, 12:10:28 PM5/3/18
to django...@googlegroups.com, anthon...@btinternet.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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--

Duška Miloradović

unread,
May 3, 2018, 12:19:18 PM5/3/18
to django...@googlegroups.com, Anthony Flury
Yes? :/

To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.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 post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

Fidel Leon

unread,
May 3, 2018, 12:24:59 PM5/3/18
to django...@googlegroups.com
As part of its protection, Comodo Antivirus has something named “sandboxing”, so when you execute anything, Comodo catches it, runs it inside a protected environment and if it finds it’s not malware, runs the actual command.

Seems Comodo is mapping your D: drive to that C:\VTRoot\HarddiskVolume1 thing, so django-admin gets fooled.

I haven’t used Comodo for decades so I can’t help with this exact issue, sorry - maybe disabling the antivirus while you’re at Django? O:-)

Fidel Leon

To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

Duška Miloradović

unread,
May 3, 2018, 12:31:35 PM5/3/18
to django...@googlegroups.com
Ha! I will try to see what will happen when I disable Comodo. I hope it will work properly then.

Thanks Fidel Leon.

--
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 post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

Anthony Flury

unread,
May 3, 2018, 12:56:02 PM5/3/18
to django...@googlegroups.com
Serves me right for writing code without testing :-(

It of course should be :

            import os
            top_dir = os.path.join(os.getcwd(), 'python_created_me')
            os.makedirs(top_dir)

Glad you have it sorted - and glad it turned out not to be Django ...

On 03/05/18 17:06, Duška Miloradović wrote:
> Anthony, I got this:
>
> D:\projectdir>python create_dir.py
> Traceback (most recent call last):
>   File "create_dir.py", line 2, in <module>
>     top_dir = path.join(os.getcwd(), 'python_created_me')
> NameError: name 'path' is not defined
>
> I searched for it through windows explorer again and I actually *found
> it* on this strange location: C:\VTRoot\HarddiskVolume1\projectdir\mysite
> Do you have any clue how this happened?
> How to make things right? :)
>
> On Thu, May 3, 2018 at 5:08 PM, Anthony Flury
> <anthon...@btinternet.com <mailto:anthon...@btinternet.com>>
> <mailto:Anthon...@btinternet.com>*
> Twitter : *@TonyFlury <https://twitter.com/TonyFlury/
> <https://twitter.com/TonyFlury/>>*
>
>
> --
> 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...@googlegroups.com
> <mailto:django-users...@googlegroups.com>.
> To post to this group, send email to django...@googlegroups.com
> <mailto:django...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAJ0SFUA52autPYk95a9s4t%2BHXzdx-OYgj%3DzLyfynYX9XiM%3D6NQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAJ0SFUA52autPYk95a9s4t%2BHXzdx-OYgj%3DzLyfynYX9XiM%3D6NQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.


Reply all
Reply to author
Forward
0 new messages