Install under Anaconda or Miniconda
February 11, 2026 ยท View on GitHub
I successfully tested pyslam with Miniconda (conda 25.7.0) under Linux.
I assume you already installed Anaconda or Miniconda, and correctly initialized your conda python environment in your terminal (you should see a (base) in your bash prefix).
Installation
In order to use pyslam under conda, ensure conda is active in your terminal. From the root of this repository, run the following command:
git clone --recursive https://github.com/luigifreda/pyslam.git
cd pyslam
./install_all.sh # unified install procedure
This script will detect your active conda, create a dedicated pyslam conda environment, and build the required thirdparty packages. Under the hood, the script install_all.sh calls the conda-specific script scripts/install_all_conda.sh.
Please, discard any error like this:
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed....
These are typically warnings rather than critical issues. These messages do not prevent the main and test scripts from running successfully. See TROUBLESHOOTING file for further details.
Usage
Now, from the same terminal, you can run:
$ . scripts/pyenv-activate.sh # Activate pyslam python virtual environment. This is just needed once in a new terminal.
$ ./main_vo.py # test visual odometry
or
$ . scripts/pyenv-activate.sh # Activate pyslam python virtual environment. This is just needed once in a new terminal.
$ ./main_slam.py # test full SLAM
The script scripts/pyenv-activate.sh will call scripts/pyenv-conda-activate.sh, which is a conda-specific script.
If you want to use a new terminal, you need to activate the pyslam environment as explained in this section.
Manually create a pyslam conda environment
You already see this above. In order to create a custom pyslam conda environment, get in the root of this repository and run the following command:
$ . pyenv-conda-create.sh
Activate the created pyslam conda environment
Run the following command (N.B., do not forget the dot!):
$ . scripts/pyenv-conda-activate.sh # This will also set some environment variables
Under the hood this will call
$ conda activate pyslam
Now, you can launch pySLAM scripts.
Deactivate pyslam conda environment
To deactivate the pyslam environment, run
$ conda deactivate
Delete pyslam conda environment
To delete the pyslam environment, run
$ . scripts/pyenv-conda-delete.sh
General Notes About Conda
Below, you can find some useful details. The scripts mentioned above make the work for you.
Install packages/env from file
You can generate a requirements.txt file by running:
$ conda list -e > requirements-conda.txt
You can create and environment from such a file by runnning:
$ conda create --name <env> --file requirements-conda.txt
N.B.: the file requirements.txt generated by conda cannot be used with pip3 (and viceversa)!
Another approach is to use .yml files. In order to create a file requirements-conda.yml run:
$ conda env export > requirements-conda.yml
or
$ conda env export --no-builds > requirements-conda-nobuilds.yml
for generating a requirements file without build numbers.
You can create an environment from it by running:
$ conda env create -f requirements.yml
Deleting an environment
To delete an environment, in your terminal window or an Anaconda Prompt, run:
$ conda remove --name myenv --all
this command will also return you some conda infos.
You may instead use the simpler command:
$ conda env remove --name myenv
To verify that the environment was removed, in your terminal window or an Anaconda Prompt, run:
$ conda info --envs
The environments list that displays should not show the removed environment.
Creating an environment
In order to create a new conda environment opencvenv, activate it and install OpenCV in it, run the following commands:
$ conda create -yn opencvenv python=3.6.9
$ conda activate opencvenv
$ conda install -c menpo opencv3
This should install OpenCV 3.4.1 and everything you need to run SIFT and SURF.
In order to install pytorch and torchvision:
$ conda install pytorch torchvision cudatoolkit=10.1 -c pytorch
or (if you do not have an NVIDIA GPU)
$ conda install -c pytorch torchvision
To deactivate the opencvenv environment, use
$ conda deactivate
This command will bring you back to your default conda environment.
To re-activate the conda opencvenv environment, use
$ conda activate opencvenv