To activate a Python environment in Windows, follow these steps:

  1. Open the command prompt by pressing Windows key + R and type cmd in the Run dialog box.

  2. Once the command prompt opens, navigate to the directory where you want to create the environment.

  3. Create a new environment using the following command:

    python -m venv <environment-name>

    Replace <environment-name> with the name you want to give to your environment.

  4. Once the environment is created, activate it using the following command:

    <environment-name>\Scripts\activate.bat

    Replace <environment-name> with the name of your environment.

  5. You will see the name of your environment in the command prompt, indicating that you have successfully activated it.

  6. You can now install packages and run Python scripts in the activated environment.

  7. To deactivate the environment, simply type deactivate in the command prompt.

pyhon environment activate in windows

原文地址: https://www.cveoy.top/t/topic/bbBX 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录