How to Run a Python Script in a VirtualEnv

Last modified by Leon Poon on 2021/03/23 05:16

After you have created a virtualenv, and installed some libraries in the virtualenv, you should run your script in the virtualenv if your script makes use of the libraries that you installed.

Assuming that your script is at /abc/def/

In your console change working directory to your virualenv and type:

bin/python3 /abc/def/

In Windows you should type:

scripts\python3.exe C:\abc\def\

if your file is in C:\abc\def\ in windows.

Created by Leon Poon on 2018/12/24 12:27