Installation

Environment

When installing software, you typically have two choices: install as root, or install as user in your own user space. You may only have one choice if you don’t have root privileges on your machine.

If you want to install nyucal in the system’s executable domain, you will probably need to preface any command below with sudo. If you already know what that means, proceed with caution. If you don’t, consider one of the alternatives, which are designed to prevent you from wrecking your system unintentionally.

To install in user space, you will need to add --user to the installation commands. The install scripts will put the files in the places within your user directory that will automatically be searched.

But nyucal relies on other python packages to run correctly. Installing nyucal will automatically download and install those packages as well. This can be trouble if you have other versions of those packages already installed, and different modules require different versions.

So as an alternative, python has virtual environments. This is a way to set up a complete python sandbox with packages and executables. Here is how to do that.

You should have a virtualenv executable on your system. Run it and give it the name of a directory, in which the environment will reside:

$ virtualenv ~/Library/virtualenv/nyucal

or, from another unix:

$ virtualenv ~/lib/virtualenv/nyucal

Not sure of the best place for Windows. This will give you a shiny new python installation that is independent from any others on your machine. To activate it, change into the directory specified above and run:

$ source bin/activate
(nyucal)$ which python
...

Notice how the prompt changes to indicate the active virtual environment. Your which command should return the directory of your virtual environment, with bin/python attached.

You can learn more about this from the Virtualenv user guide. Trust me, it’s worth it.

Installing from Source

The sources for can be downloaded from the Github repo.

You can either clone the public repository:

$ git clone git://github.com/nyumathclinic/nyucal

Or download the tarball:

$ curl  -OL https://github.com/nyumathclinic/nyucal/tarball/master

Once you have a copy of the source, you can install it in the virtual evironment with:

$ source ~/path/to/virtualenv/bin/activate
(nyucal)$ python setup.py install
(nyucal)$ deactivate
$ alias nyucal='~/path/to/virtualenv/bin/nyucal'

Replace ~/path/to/virtualenv/ with the path to your locally installed virtual environment.

The last line, which you can also put into your shell’s .profile, will allow you to use nyucal without always activating the virtual environment.

You can also install not in a virtual environment, as user:

$ python setup.py install --user

Installing from Github

We don’t plan to publish on PyPI, so this won’t work:

$ pip install nyucal

You should be able to install from the github repo instead:

$ pip install git+https://github.com/nyumathclinic/nyucal.git

For best results, use a virtual environment as above, and make sure that the pip version running is the one in that virtual environment.

If you don’t have pip installed, this Python installation guide can guide you through the process.