为什么我的程序在本地运行,而在虚拟环境中却没有?
Why does my program run locally, but not in the virtual environment?
我正在使用 PyCharm。当我按下 运行 按钮时,我的文件 运行 没问题:
但是当我尝试 运行 我的 virtualenv 中的同一个文件时,没有任何反应:
我的解释器设置 设置为 virtualenv,所以还有什么问题?
Mac 用户:
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 用户:
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.
我正在使用 PyCharm。当我按下 运行 按钮时,我的文件 运行 没问题:
但是当我尝试 运行 我的 virtualenv 中的同一个文件时,没有任何反应:
我的解释器设置 设置为 virtualenv,所以还有什么问题?
Mac 用户:
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 用户:
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.