2

I tried to make a virtual environment as stated in the documentation of the visual studio code. I have already installed python 3.7.3 and anaconda on the system.

I did the following and I'm using vs code version 1.34 and windows 10:

I made an empty folder and used this line of code as stated in official documentation:

py -3 -m venv .venv

I expected a folder named .venv that has scripts folder with 'activate' file in it. As i have tested this method which worked on other systems with the same configuration, But instead i get the below error message:

Error: [Errno 2]: no such file or directory : 'C:\\ProgramData\\Anaconda3\\lib\\venv\\scripts\\nt\\python.exe'
Shahryar
  • 324
  • 1
  • 3
  • 17

2 Answers2

3

It look like installer is broken, or so...

Copy from Python 3 installation folder:

C:\Users{user}\AppData\Local\Programs\Python\Python37

Files: python.exe, python.pdb, python_d.exe, python_d.pdb, pythonw.exe & pythonw.pdb to folder: C:\ProgramData\Anaconda3\lib\venv\scripts\nt\

bofh
  • 46
  • 1
-1

That's because, in the python version you are trying create virtual environment venv [ in other cases -> vitualenv] has not been installed.

environment building process fails after python global version hand over to the specific version.

you can get idea how to install vitualenv on a specific version from the link below. Dealing with multiple python versions and pip

IndieGameDev
  • 2,905
  • 3
  • 16
  • 29
nipun
  • 672
  • 5
  • 11