PowerShell Opening File instead of Running When in Python Virtual Environment

Viewed 35

I am using Python 3.9.9 (installed via MSYS2) and Windows PowerShell on Windows 10 64-bit. I am trying to learn more about Python's virtual environment.

I was able to initialize and activate virtual environment using the respective commands in PowerShell.

python3 -m venv .venv
.\.venv\bin\Activate.ps1

I notice that before activating the virtual environment, python --version would work as expected and output the Python version installed. However, once virtual environment has been activated, the same command would prompt Windows to open a file (window below would pop up).

Window's reaction when in virtual environment

I know the virtual environment was activated because I could see (.venv) being displayed.

Is this expected behavior? What should I do for python commands to still work in virtual environments? Thank you for your help!

0 Answers
Related