slaclab / anarel-manage

Manage the conda based analysis release environments that include psana at LCLS.
Other
3 stars 3 forks source link

conda_setup doesn't run on old python #19

Open davidslac opened 7 years ago

davidslac commented 7 years ago

on pswww, conda_setup won't source from the default system python. That python is 2.4.3, and it doesn't have argparse. The mechanism I put in place to find argparse isn't working, the argparse, if it is found, doesn't load - looks like language differences.

This is weird because https://pypi.python.org/pypi/argparse says argparse 1.4.0 is tested on python 2.4, so I'm not sure why the argparse I copied in isn't working.

In anycase, the simplest thing is just to run from a more modern version of python. Unfortunately, the simplest way to do that is to turn our one step instruction:

source /reg/g/psdm/bin/conda_setup

into two

source /reg/g/psdm/etc/ana_setup.sh
source conda_setup

just so that we can first get the python 2.7 that we built for rhel5/6/ or 7 on the path, before sourcing the conda_setup.

Or, we could work on getting conda_setup/argparse to work on the rhel5 machines, or port it to bash

davidslac commented 7 years ago

@klabattermann run into this on a rhel6 machine, where system python should be new enought that argparse will work, after looking at the code, he thinks the problem is that it fails through the softlink, so I should try

 the problem is that /reg/g/psdm/bin/conda_setup is a link.
maybe os.realpath(__file__) works better.