-1

I created a virtual python environment with python -m venv virtual, and then i tried to install flask with virtual\Scripts\pip install flask. But then i got this error:

virtual\Scripts\pip : The module 'virtual' could not be loaded. For more information, run 'Import-Module virtual'.
At line:1 char:1
+ virtual\Scripts\pip install flask
+ ~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (virtual\Scripts\pip:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CouldNotAutoLoadModule

And when i tried Import-Module virtual i got:

Import-Module : The specified module 'virtual' was not loaded because no valid module file was found in any module directory.
At line:1 char:1
+ Import-Module virtual
+ ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (virtual:String) [Import-Module], FileNotFoundException
    + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

What should i do?

  • Did you try with any other virtual environment names than `virtual`? – Niko Föhr Jul 19 '20 at 14:10
  • Usually you activate your venv with `Scripts\activate.bat` first, then run `pip install flask` - activating the environment sets up the correct paths and environment variables. – MatsLindh Jul 19 '20 at 14:12

1 Answers1

0

I just changed the path of the virtual environment and it works well