-
Notifications
You must be signed in to change notification settings - Fork 71
python virtual environment setup
You can run IoT Edge Dev Tool inside a Python Virtual Environment. A Python virtual environment is a self-contained directory tree that contains a Python installation for a particular version of Python, plus a number of additional packages.
-
Install
virtualenvpip install virtualenv -
Create a virtual environment
virtualenv venvvenvis just a env name that can be anything you want, but we recommend sticking withvenvif you want to contribute to IoT Edge Dev Tool because the.gitignorefile excludes it.To create a virtual environment with a Python version different with your system default, just use the
--python/-poption to specify the Python executable path, e.g.:virtualenv --python /usr/bin/python2.7 py27 -
Activate the virtual environment
-
Windows
- cmd.exe:
venv\Scripts\activate.bat - PowerShell:
venv\Scripts\activate.ps1(You may need to runSet-ExecutionPolicy RemoteSignedin an Administrator Powershell first to allow scripts to run)
- cmd.exe:
-
Posix:
source venv/bin/activate
It will be active until you deactivate it or close the terminal instance.
-
-
Install dependencies
Continue with the instructions above starting with the Manual Dev Machine Setup -> Install Dependencies.
-
Deactivate the virtual environment
When you are done with your virtualenv, you can deactivate it with the follow command:
deactivate