Skip to content

Instantly share code, notes, and snippets.

@pwgerman
Forked from michaelaye/install_new_package.sh
Created December 18, 2015 01:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pwgerman/59cc3088f4c2d562d38b to your computer and use it in GitHub Desktop.
Save pwgerman/59cc3088f4c2d562d38b to your computer and use it in GitHub Desktop.
My procedure for (Ana/Mini)conda users for installing new packages.
# set package_name, replace SpiceyPy with what you need.
PACKAGE_NAME = SpiceyPy
# First make sure you have activated the conda env where you want `package_name` installed
source activate myenv
# Then update pip to newest versions, as they are usually better in handling uninstalls:
conda update pip
# Now check if `package_name` is in conda:
conda install $PACKAGE_NAME
# if not, check if it's on pypi:
pip install $PACKAGE_NAME
# if still not found, resort to GitHub installs.
# find repository needed and copy the install link as offered by GitHub
# (use the https version of the link if you haven't set up ssh access to GitHub yet
# I'm using AndrewAnnex awesome interface to NASA's solar system geometry tools SPICE
# as an example. Make sure you are in a folder where you store your codes.
git clone git@github.com:AndrewAnnex/SpiceyPy.git
# go into the new folder:
cd SpiceyPy
# if you know about a certain branch you have been recommended to install, check it out:
git checkout branch_name
# now install it, usually that's just this, but check INSTALL.txt or similar:
python setup.py install
# In case you are developing, fixing something and want your changes be active immediately
# in your Python environment, replace the previous line with:
python setup.py develop
# That should you guys get going for a while. I'm using this procedure successfully for over a year
# now with Miniconda and had only few problems. (There's always SOMETHING with Python packaging...)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment