-1

I'm using PyCharm. When I press the run button, my file runs fine:

enter image description here

But when I try to run the same file in my virtualenv, nothing happens:

enter image description here

My interpreter settings are set to the virtualenv, so what else could be wrong?

Display name
  • 95
  • 1
  • 2
  • 12
  • 2
    my guess is that python3 isn't the same python installed in your virtualenv; and thusly can't find the necessary modules to run the python script 'run.py' – ewokx Jul 13 '20 at 06:46

1 Answers1

1

Mac users:

The answer was that python3 wasn't using the same site-packages as the virtualenv; and thusly, running python3 run.py would not run.

Ensure that you're running the virtualenv's python binary instead of the generally installed python3 binary.

Windows users:

There is no Python on Windows by default. And therefore any version that you've installed is just python (I guess). The recommended way to manage multiple python versions is to use the Python launcher. Source

Display name
  • 95
  • 1
  • 2
  • 12
ewokx
  • 2,204
  • 3
  • 14
  • 27