Windows10
I built a virtual environment with reference to django's official website, but it didn't work, and I managed to deal with it, so I will write how to do it.
After creating a new directory djangogirls in your home directory as shown on the official website, enter the following command using the command prompt. However, the virtual environment env is not created.
C:\Users\Name\djangogirls> python -m venv env
C:\Users\Name\djangogirls>
After python3.7, when I installed python, venv was also installed automatically, but I could not do it even though it was mentioned in some article, so check the version I installed just in case. Type the following command
C:\Users\Name\djangogirls>python3 -V
C:\Users\Name\djangogirls>
that? No reaction. Check again and type the following command
C:\Users\amanonda\djangogirls>python3 --version
C:\Users\amanonda\djangogirls>
Version information does not come out ...
Isn't the environment setting wrong in the first place? I decided to set the environment again. I referred to the following site for how to change the environment settings.
Click _ "Control Panel" from the displayed pages on this page. I'm starting from the place called "_".
As I proceeded with the environment settings, I was wondering which directory had Python installed in the first place, so I used the where command to find the installed directory.
C:\Users\Name\djangogirls>where python
C:\Users\Name\AppData\Local\Microsoft\WindowsApps\python.exe
C:\Users\Name\AppData\Local\Programs\Python\Python37\python.exe
C:\Users\Name\djangogirls>
There are two things here, Microsoft and others. Please select ** not Microsoft ** and set the path.
After completing the settings, use the cd command to move to the installed directory. It came out when I checked the version after moving.
C:\Users\Name\djangogirls>cd C:\Users\amanonda\AppData\Local\Programs\Python\Python37
C:\Users\Name\AppData\Local\Programs\Python\Python37>python -V
Python 3.7.9
It's 3.7 or later! But I wonder if this happened because the environment settings weren't working. So go back to the first directory and use venv again!
C:\Users\Name\djangogirls>python -m venv env
C:\Users\Name\djangogirls>
... I couldn't create the env directory.
Try using venv by moving to the directory where the path is set.
C:\Users\Name\djangogirls>cd C:\Users\amanonda\AppData\Local\Programs\Python\Python37
C:\Users\Name\AppData\Local\Programs\Python\Python37>python -m venv env
C:\Users\Name\AppData\Local\Programs\Python\Python37>
It's done ... I can't follow the official website, but I decided that the purpose was achieved because the virtual environment was created.
When creating a virtual environment using venv, move to the installed directory and type the command to create the virtual environment. Just in case, set the path.
It ended halfway, but I'm not in trouble now, so I'm happy with it!
I really wanted to create env under djangogirls, so I created a djangogirls directory with mkdir under the directory where python was installed. I typed the command again.
C:\Users\Name\AppData\Local\Programs\Python\Python37>cd djangogirls
C:\Users\Name\AppData\Local\Programs\Python\Python37\djangogirls>python -m venv env
C:\Users\Name\AppData\Local\Programs\Python\Python37\djangogirls>
... I couldn't create the env directory. ~ Complete ~
Recommended Posts