Home > front end >  Setting up Virtual Environment for Python on Windows
Setting up Virtual Environment for Python on Windows

Time:01-23

I'm having issues with setting up the virtual environment on my Windows 10 computer. I suspect that it might have to do with the GNU C compiler I have installed but I'm not sure.

So first I did: python3 -m venv env This created the following folders:

  • bin (includes the activate file — does not have the '.bat' extension — and the active.ps1 file)
  • include(empty)
  • lib (pip, setuptools, etc) and the folder
  • pyvenv.cfg

In pyvenv.cfg:

home = C:\msys64\mingw64\bin #Not the path to my python interpreter, it's my c compiler
include-system-site-packages = false
version = 3.9.7

So naturally, I looked at several tutorials to activate venv and when I try their method for windows computers in the cmd prompt it says that the path or command does not exist.

Furthermore, in the active file in the first line of the code, it says it must be used from bash.

How do I fix this?

CodePudding user response:

Had almost the same problem, few mounths ago. For me problem was that Python compiler was not in PATH. Try checking if Python is in environment variables - System (Control Panel)>> Advanced system settings>> Environment Variables

  •  Tags:  
  • Related