Hi Justin,

You need to include the naming scheme with a command line option:
    --include-module-naming-schemes=INCLUDE-MODULE-NAMING-SCHEMES
                        Location(s) of extra or customized module naming
You can add that to your EB configuration (however you chose to do it) and it 
will be maintained across updates then.

Alan

On 17 November 2016 at 08:03, Justin Lee 
<[email protected]<mailto:[email protected]>> wrote:
Hi,

I've been following the instructions to build a custom module naming
scheme, as provided at
https://github.com/hpcugent/easybuild/wiki/Using-a-custom-module-naming-scheme
but keep getting an error, even when implementing the example provided.
The error is  "ImportError: cannot import name GENERAL_CLASS".

All eb commands fail with this error as soon as I've updated the
PYTHONPATH to add the new module naming scheme. If instead of modifing
the PYTHONPATH, I copy the file into the directory containing the
standard naming scheme python modules (i.e. under site-packages:
easybuild_framework-2.9.0-py2.7.egg/easybuild/tools/module_naming_scheme/),
then it works. However, this is not maintainable (for example upgrading
to EasyBuild ver 3.0.0 doesn't keep the changes).

I know that GENERAL_CLASS is defined in the original naming scheme
__init__.py, so I suspect that the original __init.py__ is not being
processed, but lack the depth of Python expertise to know how to remedy
this, beyond copy-and-pasting the contents of the original into the
custom naming scheme's __init__.py.

Currently we are sym-linking from the original module_naming_scheme
directory to a custom module elsewhere. This works, but isn't a robust
solution. Can anyone provide a better solution to this (or point out
where I'm going wrong)?

The following snippet provides further details of the error:

leejm@cl2n056:/pkg/suse12/eb_test> export
EASYBUILD_PREFIX=/pkg/suse12/eb_test
leejm@cl2n056:/pkg/suse12/eb_test> module load EasyBuild
leejm@cl2n056:/pkg/suse12/eb_test> echo $PYTHONPATH
/pkg/suse12/software/EasyBuild/2.9.0/lib/python2.7/site-packages
leejm@cl2n056:/pkg/suse12/eb_test> export
PYTHONPATH=$PYTHONPATH:/pkg/suse12/eb_test
leejm@cl2n056:/pkg/suse12/eb_test> eb --avail-module-naming-schemes
Traceback (most recent call last):
  File "/usr/lib64/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File
"/pkg/suse12/software/EasyBuild/2.9.0/lib/python2.7/site-packages/easybuild_framework-2.9.0-py2.7.egg/easybuild/main.py",
line 49, in <module>
    import easybuild.tools.config as config
  File
"/pkg/suse12/software/EasyBuild/2.9.0/lib/python2.7/site-packages/easybuild_framework-2.9.0-py2.7.egg/easybuild/tools/config.py",
line 48, in <module>
    from easybuild.tools.module_naming_scheme import GENERAL_CLASS
ImportError: cannot import name GENERAL_CLASS

Thanks,

Justin





--
Dr. Alan O'Cais
E-CAM Software Manager
Juelich Supercomputing Centre
Forschungszentrum Juelich GmbH
52425 Juelich, Germany

Phone: +49 2461 61 5213
Fax: +49 2461 61 6656
E-mail: [email protected]<mailto:[email protected]>
WWW:    http://www.fz-juelich.de/ias/jsc/EN


------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr.-Ing. Wolfgang Marquardt (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------

Reply via email to