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.
Fork and clone a copy of the quant-econ
repository on to your local machine.
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
Install the extra dependencies required to run the IPython notebook with you Conda environment:
$ conda install jinja2 sphinx pyzmq pygments tornado nose readline
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.
Change into your local copy of the quantecon
repo:
$ cd /PATH/TO/LOCAL/CLONE/quant-econ
Use pip
to install the quantecon
package in editable mode into the newly created quantecon-dev
environment:
$ pip install -e .
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
!
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.