Python Virtual Environment - ankit-jha/commands GitHub Wiki

export ML_PATH="$HOME/ml"

mkdir -p $ML_PATH

python3 -m pip --version

python3 -m pip install --user -U pip

python3 -m pip install --user -U virtualenv

-m module

-U upgrade

cd $ML_PATH

virtualenv env #Create virtual env

source env/bin/activate #Activate virtual env on Linux or MacOSX

python3 -m pip install -U jupyter matplotlib numpy pandas scikit-learn scipy #Install jupyter and ds packages

jupyter notebook [--port=8888] #Start local jupyter notebook

deactivate #Deactivate env

Adding R kernel to virtual environment

Activate the virtualenv before starting R (using source path/to/env/bin/activate)

Open R prompt

install.packages('IRkernel')

IRkernel::installspec() Installation

How to add it to only one virtual environment. The above process adds it for the current user not current virtual environment ?

virtualenvwrapper

https://virtualenvwrapper.readthedocs.io/en/latest/command_ref.html