Installing lazylinop
Installing lazylinop with PIP
Creating a virtual environment
First, you need to create your virtual environment into a directory reserved to lazylinop:
python3 -m venv test_lazylinop_venv
- Note
For Windows users the command is rather:
py -3 -m venv test_lazylinop_venv
Second, you need to enable the virtual environment:
source ./test_lazylinop_venv/bin/activate
- Note
For Windows users the command is rather:
C:\> call .\test_lazylinop_venv\Scripts\activate
Then, if all worked correctly you should see the test_lazylinop_venv prompt of your virtual environment.
Installing the lazylinop package
It remains now to install lazylinop in the environment you just created.
If you downloaded the whl package the command is:
pip install lazylinop-*.whl
Otherwise, a simpler way is to directly install lazylinop from the public PYPI repository:
pip install lazylinop
All the dependencies will be downloaded and installed by the command above.
You can launch this python command to validate the installation:
python -c 'from lazylinop import __version__; print(__version__)'
If all went properly you should see the version of installed lazylinop.
- Note
In the virtual environment python is necessarily python version 3 (because the creation was made through python3 in the section creating a virtual environment).
Installing lazylinop with Anaconda
The lazylinop package is also available on a dedicated conda repository. Follow the next commands to install lazylinop for Anaconda.
Create and enable a dedicated environment:
conda create -y -n lazylinop_venv python==3.9
conda activate lazylinop_venv
The specifier for the python version is due to the fact that at the moment of writing this guide, pylops (a dependency of lazylinop) is not available on python 3.11 while pyfaust (another dependency of lazylinop) is available (for its latest version) only for python 3.11 and python 3.9.
Add necessary anaconda channels:
The channel pyfaust is necessary for installing pyfaust. The channel conda-forge is necessary for installing numpy, scipy and moreover pylops. Both of them, pyfaust and pylops, are dependencies of lazylinop.
conda config --add channels conda-forge
conda config --add channels pyfaust
conda config --add channels lazylinop
Then you are ready to install the lazylinop package:
conda install lazylinop
Finally, test that the install succeeded:
python -c 'from lazylinop import __version__; print(__version__)'
It should print the version of lazylinop you just installed.