2. Install in Virtual Environments#
If you do not want the installation to occupy your main python’s site-packages (either you are testing or the dependencies may clutter your existing installed packages), install the package in an isolated virtual environment. Two common virtual environments are virtualenv and conda.
2.1. Install in virtualenv Environment#
Install
virtualenv:python -m pip install virtualenvCreate a virtual environment and give it a name, such as
restoreio_envpython -m virtualenv restoreio_envActivate python in the new environment
source restoreio_env/bin/activateInstall
restoreiopackage with any of the above methods. For instance:python -m pip install restoreioThen, use the package in this environment.
To exit from the environment
deactivate
2.2. Install in conda Environment#
In the followings, it is assumed anaconda (or miniconda) is installed.
Initialize conda
conda initYou may need to close and reopen your terminal after the above command. Alternatively, instead of the above, you can do
sudo sh $(conda info --root)/etc/profile.d/conda.shCreate a virtual environment and give it a name, such as
restoreio_envconda create --name restoreio_env -yThe command
conda info --envsshows the list of all environments. The current environment is marked by an asterisk in the list, which should be the default environment at this stage. In the next step, we will change the current environment to the one we created.Activate the new environment
source activate restoreio_envInstall
restoreiowith any of the above methods. For instance:conda install -c s-ameli restoreioThen, use the package in this environment.
To exit from the environment
conda deactivate