Skip to content

Setting up Conda environment

Gagandeep Singh edited this page Dec 27, 2021 · 3 revisions

This wiki documents the process of setting up conda environment for working on PyDataStructs project.

Linux Users

  1. Download anaconda from https://www.anaconda.com/products/individual. Make sure that you choose the right installer for your architecture. You can scroll down (in the above link) to find a section by the name of, Anaconda Installers.
  2. It will download a .sh file. You will have to open the terminal and run, bash <downloaded_file_name>.sh or ./<downloaded_file_name>.sh. Accept the license, and let the other options remain default. However, in the end conda will ask a yes/no question. It will be about automatically initialising conda for your shell. Just type yes there. It is no by default though we won't recommend going for that option.
  3. Once done, verify the installation by running, conda --version. It should output the version number and some other metadata which you can ignore.
  4. Now, run, conda create -n pyds python=3.8. It will list a set of packages that will be installed in your new environment. Type yes when it asks for your approval.
  5. Run, conda activate pyds. Finally, you are inside your environment for pydatastructs.
  6. Change your directory to the path where you have cloned pydatastructs project. Make sure that you have activated the pyds environment.
  7. Now execute, pip install -r requirements.txt and pip install -r docs/requirements.txt, one after the other.
  8. Now, install pydatastructs in development mode using, python scripts/build/develop.py.
  9. Run the tests, pytest --doctest-modules --cov=./ --cov-report=html. They should pass in a matter of seconds.
  10. Build the docs using, sphinx-build -b html docs/source/ docs/build/html. There will be a lot of warnings which you can safely ignore. Go inside, docs/build/html and open the index.html file in your preferred browser.

Apple Silicon Users

  1. Download mambaforge from this URL, https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-MacOSX-arm64.sh
  2. As you can see from the above link, it will download Mambaforge-MacOSX-arm64.sh. You have to follow the same steps as for Linux users from here onwards (i.e., 2 - 10). No differences.

Guide for Windows developers coming soon.