Team Ai
Modelpublic

AnnaMats/ppo-Pyramids-Training

sourceHugging Faceupdated 3y agoView on Hugging Face
0likes110downloads
Using-Virtual-Environment.md70 linesDownload Raw Back to docs
1# Using Virtual Environment2 3## What is a Virtual Environment?4 5A Virtual Environment is a self contained directory tree that contains a Python6installation for a particular version of Python, plus a number of additional7packages. To learn more about Virtual Environments see8[here](https://docs.python.org/3/library/venv.html).9 10## Why should I use a Virtual Environment?11 12A Virtual Environment keeps all dependencies for the Python project separate13from dependencies of other projects. This has a few advantages:14 151. It makes dependency management for the project easy.161. It enables using and testing of different library versions by quickly17   spinning up a new environment and verifying the compatibility of the code18   with the different version.19 20## Python Version Requirement (Required)21This guide has been tested with Python 3.8.13 through Python 3.10.x. Newer versions might not22have support for the dependent libraries, so are not recommended.23 24## Installing Pip (Required)25 261. Download the `get-pip.py` file using the command27   `curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py`281. Run the following `python3 get-pip.py`291. Check pip version using `pip3 -V`30 31Note (for Ubuntu users): If the32`ModuleNotFoundError: No module named 'distutils.util'` error is encountered,33then python3-distutils needs to be installed. Install python3-distutils using34`sudo apt-get install python3-distutils`35 36## Mac OS X Setup37 381. Create a folder where the virtual environments will reside39   `$ mkdir ~/python-envs`401. To create a new environment named `sample-env` execute41   `$ python3 -m venv ~/python-envs/sample-env`421. To activate the environment execute43   `$ source ~/python-envs/sample-env/bin/activate`441. Upgrade to the latest pip version using `$ pip3 install --upgrade pip`451. Upgrade to the latest setuptools version using46   `$ pip3 install --upgrade setuptools`471. To deactivate the environment execute `$ deactivate` (you can reactivate the48   environment using the same `activate` command listed above)49 50## Ubuntu Setup51 521. Install the python3-venv package using `$ sudo apt-get install python3-venv`531. Follow the steps in the Mac OS X installation.54 55## Windows Setup56 571. Create a folder where the virtual environments will reside `md python-envs`581. To create a new environment named `sample-env` execute59   `python -m venv python-envs\sample-env`601. To activate the environment execute `python-envs\sample-env\Scripts\activate`611. Upgrade to the latest pip version using `pip install --upgrade pip`621. To deactivate the environment execute `deactivate` (you can reactivate the63   environment using the same `activate` command listed above)64 65Note:66- Verify that you are using a Python version between 3.8.13 and 3.10.x. Launch a67  command prompt using `cmd` and execute `python --version` to verify the version.68- Python3 installation may require admin privileges on Windows.69- This guide is for Windows 10 using a 64-bit architecture only.70