Project

General

Profile

Support #3621

Automate Pycosmo build?

Added by Ben Hambrecht over 6 years ago. Updated over 6 years ago.

Status:
Assigned
Priority:
Normal
Category:
Estimate Cosmo Params
Target version:
Start date:
03/26/2013
Due date:
% Done:

0%

Estimated time:
Duration:

Description

This happens when running SPOKES with just EstimCosmo:

**************************
=======================***
Running pipeline***
=======================***
**************************
[0]: Estimate_Cosmo_Params
... running Estimate_Cosmo_Params
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mpl_toolkits/__init__.py:2: UserWarning: Module readline was already imported from /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/IPython/utils/rlineimpl.pyc, but /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/readline is being added to sys.path
  __import__('pkg_resources').declare_namespace(__name__)
Module PyCosmo not installed in python path. Adding relative path..
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/IPython/utils/py3compat.pyc in execfile(fname, *where)
    176             else:
    177                 filename = fname
--> 178             __builtin__.execfile(filename, *where)

/Users/ben/Documents/DESpec/repo/despec/Estimate_Cosmo_Params/Estimate_Cosmo_Params_Nicola_2/shell_script_cosmoparams.py in <module>()
      7 import Plotters
      8 
----> 9 import PyCosmo_params as CO
     10 import scipy.integrate
     11 import scipy.optimize

/Users/ben/Documents/DESpec/repo/despec/Estimate_Cosmo_Params/Estimate_Cosmo_Params_Nicola_2/PyCosmo_params.py in <module>()
     13     pycosmo_path = os.path.realpath(pycosmo_path)
     14     sys.path.append(pycosmo_path)
---> 15     import PyCosmo
     16 
     17 import archive

/Users/ben/Documents/DESpec/repo/despec/Estimate_Cosmo_Params/Estimate_Cosmo_Params_Nicola_2/PyCosmo/PyCosmo/PyCosmo/__init__.py in <module>()
      2 
      3 # make one file for each class
----> 4 from classes import *
      5 
      6 """ 

/Users/ben/Documents/DESpec/repo/despec/Estimate_Cosmo_Params/Estimate_Cosmo_Params_Nicola_2/PyCosmo/PyCosmo/PyCosmo/classes.py in <module>()
    286                 return temp
    287 
--> 288 if sys.platform == 'linux2':
    289     import DLFCN as dl
    290     flags = sys.getdlopenflags()

NameError: name 'sys' is not defined

This after checking out a clean copy of the tree and recompiling recfast. Adding "import sys" to classe.py just shifts the problem:

**************************
=======================***
Running pipeline***
=======================***
**************************
[0]: Estimate_Cosmo_Params
... running Estimate_Cosmo_Params
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mpl_toolkits/__init__.py:2: UserWarning: Module readline was already imported from /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/IPython/utils/rlineimpl.pyc, but /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/readline is being added to sys.path
  __import__('pkg_resources').declare_namespace(__name__)
Module PyCosmo not installed in python path. Adding relative path..
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/IPython/utils/py3compat.pyc in execfile(fname, *where)
    176             else:
    177                 filename = fname
--> 178             __builtin__.execfile(filename, *where)

/Users/ben/Documents/DESpec/repo/despec/Estimate_Cosmo_Params/Estimate_Cosmo_Params_Nicola_2/shell_script_cosmoparams.py in <module>()
      7 import Plotters
      8 
----> 9 import PyCosmo_params as CO
     10 import scipy.integrate
     11 import scipy.optimize

/Users/ben/Documents/DESpec/repo/despec/Estimate_Cosmo_Params/Estimate_Cosmo_Params_Nicola_2/PyCosmo_params.py in <module>()
     13     pycosmo_path = os.path.realpath(pycosmo_path)
     14     sys.path.append(pycosmo_path)
---> 15     import PyCosmo
     16 
     17 import archive

/Users/ben/Documents/DESpec/repo/despec/Estimate_Cosmo_Params/Estimate_Cosmo_Params_Nicola_2/PyCosmo/PyCosmo/PyCosmo/__init__.py in <module>()
      2 
      3 # make one file for each class
----> 4 from classes import *
      5 
      6 """ 

/Users/ben/Documents/DESpec/repo/despec/Estimate_Cosmo_Params/Estimate_Cosmo_Params_Nicola_2/PyCosmo/PyCosmo/PyCosmo/classes.py in <module>()
    294     sys.setdlopenflags(flags)
    295 else:
--> 296     import pycosmo_c
    297 
    298 # TODO: remove at some point ...

ImportError: No module named pycosmo_c

History

#1 Updated by Brian Nord over 6 years ago

Pycosmo import is complete but inconvenient:

Go to
Estimate_Cosmo_Params/Estimate_Cosmo_Params_Nicola_2/PyCosmo
type:
./build.sh

Occasionally, I need to do this, but I'm not sure what causes having to redo it.

#2 Updated by Brian Nord over 6 years ago

  • Tracker changed from Bug to Support
  • Subject changed from PyCosmo imports incomplete? to Automate Pycosmo build?
  • Category set to Estimate Cosmo Params
  • Status changed from New to Assigned
  • Assignee changed from Brian Nord to Laurenz Gamper
  • Target version set to May 2013

Is it possible to automate Pycosmo build or avoid the manual "./build.sh"?



Also available in: Atom PDF