Unable to create Flask Virtual environment

Hello,

I’m following this video in the course build webapps with python & flask here.

I don’t get further than opening visual studio code because when I try to execute:

 - python3 -m venv myapp

The command gets executed but nothing gets created.

See screenshot of VS here.

In the video this gets created:

Am I doing something wrong or do I need to fix something?

Hey there @mr.harrows!

If you check your home directory through your computer’s file navigator, do you see a folder named myapp? You may not have that directory open in VSCode, which may be why you aren’t seeing the generated files in the sidebar.

If the files are not in the home directory, try running the below command to ensure that you have the proper packages installed.

pip3 install virtualenv  

After running this command, try creating the virtual environment once again with the below:

python3 -m venv myapp

Let me know if this works!

Hi @javaninja55993,

Thanks for your reply!
So, it’s not in my Home directory after having searched it.

When I run

pip3 install virtualenv

it says “Requirement already satisfied”.

I should let you know that I’m running this on a virtual ubuntu machine. (myApp doesn’t seem to get created in Virtualbox either).

If I turn the virtualbox off and run the same in VS I get the following:

bash: /c/Users/Harrow/AppData/Local/Microsoft/WindowsApps/python3: Permission denied

(Running VS as admin).

What do you think?

The error you are receiving seems to indicate that there is some permission issue occurring. Can you try running the following command:

sudo python3 -m venv myapp

sudo will allow you to run the command as a super user and should bypass the permission issue.

Permission error only happens if I run it locally (not on ubuntu through virtualbox).
I uninstalled Python and re-installed it first manually (because I don’t think visual studio knew where it was located when I ran it on the windows machine for whatever reason), didn’t work.

Uninstalled python
Reinstalled python through microsoft store.

Now it works and the folder has been created.

Thanks for the support.

Glad to hear uninstalling and reinstalling Python solved the issue! Enjoy the rest of the content :slight_smile: