(inspiration from this page)
For users that are not sudoers it is possible to install libraries by using the --user
option of the pip
command
> pip install --user <lib>
The libraries will be installed in the ~/.local/bin
path. In order to run them, there is the need of including this path in the environment var PATH
:
> export PATH=$PATH:~/.local/bin
or
> export PATH=$HOME/.local/bin:$PATH
(inspiration from this page)
Using virtual environment is a good way to keep your personal space clean and installing libraries at your needs, in your virtual environment.
- Initialize a python3 virtual environment in your directory of choice:
> virtualenv -p python3 <venv_dir>
- Activate the virtual environment:
> source <venv_dir>/bin/activate
-
Now you can install whatever python dependencies you need (using
pip3
for python3), and run your program -
To deactivate the virtualenvironment:
> deactivate
- Install ipython
> pip2 install ipython
> pip2 install jupyter
- Run
> jupyter notebook
> pip install numpy
> pip install pandas
> pip install sklearn