Skip to content

Instantly share code, notes, and snippets.

@bonfus
Last active February 27, 2018 19:24
Show Gist options
  • Save bonfus/b6c66d7974327b2b61d7e2a19830a260 to your computer and use it in GitHub Desktop.
Save bonfus/b6c66d7974327b2b61d7e2a19830a260 to your computer and use it in GitHub Desktop.
Install muesr from within a MantidPlot shell
# === This works inside the MantiPlot shell on Win 7 ===
import subprocess
# install phase
print(subprocess.Popen("python -m pip install --upgrade pip",shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE,stdin=subprocess.PIPE).communicate())
print(subprocess.Popen("python -m pip install --user --upgrade mulfc muesr",shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE,stdin=subprocess.PIPE).communicate())
# use phase
import sys, site
sys.path.insert(0,site.USER_SITE)
# === This works on Mantid Notebook ===
import pip
pip.main("install --user --upgrade muLFC muesr".split())
@bonfus
Copy link
Author

bonfus commented Feb 27, 2018

Added upgrade as default

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