[Rivet] Rivet issue with PYTHONPATH variable

Maksym Deliyergiyev maksym.deliyergiyev at outlook.com
Mon Sep 28 10:38:18 BST 2015




Dear Rivet developers,

Could you please explain me how one should have to configure the PYTHONPATH in order to force the Rivet application to work? I have tried to setup this environment variable in several ways, but it seems the Rivet still do not recognized it. The most weird thing that during the configuration procedure the python is always found in the right place.

Method 1:
---------------------------------------------
export PYTHONPATH=$PYTHONPATH:/usr/lib/python2.7/site-packages
export PYTHONPATH=$PYTHONPATH:/usr/lib/python3.4/site-packages
export PYTHONPATH=$PYTHONPATH:/usr/lib64/python2.7/site-packages
export PYTHONPATH=$PYTHONPATH:/usr/lib64/python3.4/site-packages
export PYTHONPATH=$PYTHONPATH:/usr/local/include/python3.4m
export PYTHONPATH=$PYTHONPATH:/usr/include/python2.74
export PYTHONPATH=$PYTHONPATH:/bin/python


export PYTHON=$PYTHON:/usr/lib/python2.7/site-packages
export PYTHON=$PYTHON:/usr/lib/python3.4/site-packages
export PYTHON=$PYTHON:/usr/lib64/python2.7/site-packages
export PYTHON=$PYTHON:/usr/lib64/python3.4/site-packages
export PYTHON=$PYTHON:/usr/local/include/python3.4m
export PYTHON=$PYTHON:/usr/include/python2.74
export PYTHON=$PYTHON:/bin/python
---------------------------------------------


Method 2:
---------------------------------------------
./rivet-config --pythonpath=/usr/include/python3.4m  --libs=/usr/lib64/python3.4/site-packages  --libdir=/opt/Rivet/lib  --includedir=/opt/Rivet/include
---------------------------------------------


Method 3:
---------------------------------------------
import os, sys

## Load the rivet module
try:
    import rivet    
except:
    ## If rivet loading failed, try to bootstrap the Python path!
    try:
        # TODO: Is this a good idea? Maybe just notify the user that their PYTHONPATH is wrong?
        import commands
        ...
        ...
        ...
        sys.path.append('/usr/lib/python2.7/site-packages')
        sys.path.append('/usr/lib/python3.4/site-packages')
        sys.path.append('/usr/lib64/python2.7/site-packages')
        sys.path.append('/usr/lib64/python3.4/site-packages')
        sys.path.append('/usr/local/include/python3.4m')
        sys.path.append('/usr/include/python2.74')
        sys.path.append('/usr/include/python3.4m')
        sys.path.append('/opt/Rivet/lib64/python2.7/site-packages')       
        sys.path.append('/bin/python')       
        import rivet
    except:
        sys.stderr.write("The rivet Python module could not be loaded: is your PYTHONPATH set correctly?\n")
        sys.exit(1)
---------------------------------------------





Thanks in advance,
Max

 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.hepforge.org/lists-archive/rivet/attachments/20150928/627464f7/attachment.html>


More information about the Rivet mailing list