-
Notifications
You must be signed in to change notification settings - Fork 0
Development
To set up a Python virtual environment in a folder called openplc and name it test_env, follow these steps:
-
Navigate to the
openplcfolder: Open your terminal or command prompt and navigate to the directory where you want to create theopenplcfolder.mkdir openplc cd openplc -
Create the virtual environment: Use Python’s
venvmodule to create a virtual environment namedtest_env.python -m venv env
-
Activate the virtual environment:
-
On Windows:
env\Scripts\activate
-
On macOS/Linux:
source ./env/bin/activate
-
bin/activate ```
-
Verify that the environment is active: You can check if the virtual environment is activated by running:
which python # macOS/Linux where python # Windows
The output should point to the
test_envdirectory.
Now you have successfully set up and activated a Python environment called test_env inside the openplc folder. You can install packages and develop your project within this isolated environment.
To deactivate (disable) a Python virtual environment, follow these steps based on your operating system: Simply run the following command in your terminal or command prompt:
deactivateAfter running deactivate, your terminal will return to its normal state, and the virtual environment will no longer be active. You can now work outside of the test_env environment or activate a different one if needed.