-
Notifications
You must be signed in to change notification settings - Fork 70
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
virtualenv
pip install virtualenv
-
Create a virtual environment
virtualenv venv
venv
is just a env name that can be anything you want, but we recommend sticking withvenv
if you want to contribute to IoT Edge Dev Tool because the.gitignore
file excludes it.To create a virtual environment with a Python version different with your system default, just use the
--python/-p
option 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 RemoteSigned
in 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