0

I just installed Python3.10.1 from the Windows10 App Store. Showing help is OK

 python -m venv --help

actually creating a venv is not

python -m venv venv
# -> Error 1260: Windows cannot open this program because it has been prevented by a software restriction policy

I guess it is those exe files generated on Windows when creating a venv (btw --symlinks does not help).

Is there any way to create a virtual environment without some admin/AppLocker rights?

More insights: The command actually does create the following structure

venv
│   pyvenv.cfg
│
├───Include
├───Lib
│   └───site-packages
└───Scripts
        python.exe
        pythonw.exe

But site-packages is empty, independent of whether we choose --system-site-packages or not.

Wolfgang Kuehn
  • 12,206
  • 2
  • 33
  • 46
  • Using `--without-pip` helps, so this seems to be related to [Create venv with pip fails when target dir is under userappdata using Microsoft Store python](https://bugs.python.org/issue45337), which was supposed to be solved with Python 3.9. – Wolfgang Kuehn Dec 12 '21 at 12:12
  • And [venv python reports wrong sys.executable in a subprocess on Windows](https://bugs.python.org/issue38905) mentions [PEP 582](https://www.python.org/dev/peps/pep-0582/) – Wolfgang Kuehn Dec 12 '21 at 12:18
  • I opened https://bugs.python.org/issue46056 – Wolfgang Kuehn Dec 12 '21 at 12:47
  • I know it's an old question, but is python installed on a path with any space? If so, you might have bitten by the bug that I just [found](https://stackoverflow.com/questions/71039131) The behavior is different from what I experienced, likely because you're using the App Store version. Sorry if this isn't related at all. – kesh Feb 10 '22 at 03:00
  • No spaces in path. The problem is caused by MS AppLocker or Defender policies. – Wolfgang Kuehn Feb 11 '22 at 09:14

0 Answers0