Project

General

Profile

Actions

Bug #7949

open

Using Miniconda to simplify deployment of Leginon/Appion

Added by Scott Stagg over 5 years ago. Updated over 5 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
08/20/2019
Due date:
% Done:

0%

Estimated time:
Affected Version:
Appion/Leginon 3.4
Show in known bugs:
No
Workaround:

Description

This issue was created to log my attempts to find a single command Miniconda python installation that will setup python and all the pythonic dependencies without requiring root. Additionally, with the use of environment modules, Miniconda will allow users to easily switch between different python environments.

Actions #1

Updated by Scott Stagg over 5 years ago

In this example, I install python2 and python3 environments and run them from within the same shell.

#first we get the minicondas
wget https://repo.anaconda.com/miniconda/Miniconda2-latest-Linux-x86_64.sh
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh

#then we install them. At the installation stage it is important to have a clean environment with no PYTHONPATHS set
bash Miniconda2-latest-Linux-x86_64.sh -b -p /gpfs/home/sstagg/miniconda2_test
bash Miniconda3-latest-Linux-x86_64.sh -b -p /gpfs/home/sstagg/miniconda3_test

#then we install dependencies
./miniconda2_test/bin/conda install scipy numpy matplotlib
./miniconda3_test/bin/conda install scipy numpy matplotlib

Now we have two different python environments in my home directory

In the following test scripts, I have each script call its own python by having them point to the right python in the #! line at the top of the script.
test2.py

#!/gpfs/home/sstagg/miniconda2_test/bin/python

import numpy
import matplotlib
from matplotlib import pyplot

print "Using python2.7" 
print "numpy version", numpy.__version__, numpy.__path__
print "matplotlib version", matplotlib.__version__, matplotlib.__path__
x=numpy.arange(1,100,1)
y=x*x
pyplot.plot(x,y)
pyplot.show()

test3.py
#!/gpfs/home/sstagg/miniconda2_test/bin/python

import numpy
import matplotlib
from matplotlib import pyplot

print ("Using python3.7.3")
print ("numpy version", numpy.__version__, numpy.__path__)
print ("matplotlib version", matplotlib.__version__, matplotlib.__path__)
x=numpy.arange(1,100,1)
y=x*x
pyplot.plot(x,y)
pyplot.show()

Actions

Also available in: Atom PDF