Skip to content

Instantly share code, notes, and snippets.

@davidrpugh
Last active July 25, 2021 15:21
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save davidrpugh/89b83de23503b30155f5 to your computer and use it in GitHub Desktop.
Save davidrpugh/89b83de23503b30155f5 to your computer and use it in GitHub Desktop.
Instructions for setting up a Conda development environment

Creating a Conda development environment

We recommend that you set up a Python environment for developing quantecon that is separate from the "default" Python environment that you use in your own research. This will allow you to contribute to quantecon without worrying about corrupting the Python environment on which your other work depends.

Below are instructions for building a separate development environment for contributing to the quantecon package using the Conda package management system which comes bundled with the Anaconda Python distribution provided by Continuum Analytics.

Step 1:

Fork and clone a copy of the quant-econ repository on to your local machine.

Step 2:

Create a conda environment called quantecon-dev and install all the necessary dependencies:

$ conda create -n quantecon-dev pip python ipython numpy scipy sympy matplotlib pandas

Step 3:

Install the extra dependencies required to run the IPython notebook with you Conda environment:

$ conda install jinja2 sphinx pyzmq pygments tornado nose readline

Step 4:

Activate the quantecon-dev environment:

$ source activate quantecon-dev

To confirm that everything has installed correctly, type

$ which pip

at the terminal prompt. You should see something like the following:

$ ~/anaconda/envs/quantecon-dev/bin/pip

which indicates that you are using the version of pip that is installed inside the quantecon-dev Conda environment and not the system-wide version of pip that you would normally use to install Python packages.

Step 5:

Change into your local copy of the quantecon repo:

$ cd /PATH/TO/LOCAL/CLONE/quant-econ

Step 6:

Use pip to install the quantecon package in editable mode into the newly created quantecon-dev environment:

$ pip install -e .

Step 7:

Final step is to add the upstream quant-econ repository as a remote:

$ git remote add upstream https://github.com/jstac/quant-econ.git

this will enable you to quickly grab any changes that other devs have pushed to the master quant-econ repository using

$ pip fetch upstream

At this point you are ready to start developing quantecon!

Switching between environments:

Whenever you wish to start developing quantecon you need to switch into the quantecon-dev Conda environment:

$ source activate quantecon-dev

Note that when you are done developing quantecon and wish to switch back to your default Python environment simply type

$ source deactivate

at the terminal prompt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment