<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>The weird thing, but I have tried this option, but still does not work.<br>So, I'm a bit puzzled, since on my Fedora22 both Rivet-2.2.1 and Rivet-2.3.0 have the same problem.<br><br>Best regards,<br>Max<br><br><br><br><div>> Subject: Re: [Rivet] Rivet issue with PYTHONPATH variable<br>> To: maksym.deliyergiyev@outlook.com; rivet@projects.hepforge.org<br>> From: andy.buckley@cern.ch<br>> Date: Mon, 28 Sep 2015 12:52:09 +0100<br>> <br>> Why not set PYTHONPATH to /opt/Rivet/lib64/python2.7/site-packages as <br>> your rivet-config output indicates? /opt/Rivet is the prefix you set, so <br>> you would not expect to have to specify locations in /usr<br>> <br>> Andy<br>> <br>> <br>> On 28/09/15 12:39, Maksym Deliyergiyev wrote:<br>> > Hi Andy,<br>> ><br>> > > All Rivet should require in PYTHONPATH is the path to the directory (or<br>> > > directories) containing the rivet and yoda Python modules. These modules<br>> ><br>> > It seems that Rivet was build properly according to the "rivet-config"dump:<br>> > ------------------------------------------<br>> > [root@maksym bin]# ./rivet-config --pythonpath --libs --libdir --includedir<br>> > /opt/Rivet/include /opt/Rivet/lib /<br>> > opt/Rivet/lib64/python2.7/site-packages -lRivet<br>> > ------------------------------------------<br>> ><br>> > Nevertheless, with your advice in mind I removed the PYTHON and the<br>> > Python3 from the setup of the environment variables.<br>> > But once I tried to run Rivet it starts complaining:<br>> > [root@maksym bin]# ./rivet --help<br>> > The rivet Python module could not be loaded: is your PYTHONPATH set<br>> > correctly?<br>> ><br>> > So, afterwards I even tried to copy the Rivet folder with python modules<br>> > to the system path<br>> > /usr/lib/python2.7/site-packages/<br>> > /usr/lib64/python2.7/site-packages/<br>> ><br>> > And again I got the same messagethat PYTHONPATH does not set<br>> > correctly.In addition, if I will run another Rivet executable fileit<br>> > starts complaining that rivet module does not exist.<br>> > ---------------------------------<br>> > [root@maksym bin]# ./rivet-which<br>> > Traceback (most recent call last):<br>> > File "./rivet-which", line 13, in <module><br>> > import rivet, sys, os<br>> > ImportError: No module named rivet<br>> > ---------------------------------<br>> ><br>> ><br>> > Do you have any ideas how to make it work?BTW, the Rivet installation<br>> > was configured in the following way:<br>> > ---------------------------------<br>> > [blessed@maksym Rivet-2.2.1]$ ./configure --prefix=/opt/Rivet<br>> > --exec-prefix=/opt/Rivet --with-yoda=/opt/YODA<br>> > --with-yoda-libpath=/opt/YODA/lib<br>> > --with-yoda-incpath=/opt/YODA/include --with-hepmc=/opt/HEPMC2<br>> > --with-hepmc-libpath=/opt/HEPMC2/lib<br>> > --with-hepmc-incpath=/opt/HEPMC2/include --with-fastjet=/opt/FastJet<br>> > --with-fastjet-libpath=/opt/FastJet/lib<br>> > --with-fastjet-incpath=/opt/FastJet/include<br>> > --with-gsl-incpath=/usr/local/include/gsl PYTHON=/bin/python<br>> ><br>> > checking for python... /bin/python<br>> > checking whether /bin/python version >= 2.5... yes<br>> > checking for Python include path... /usr/include/python2.7<br>> > configure: All Python build checks successful: 'yoda' Python extension<br>> > will be built<br>> > checking if the /usr/bin/g++ compiler accepts the<br>> > -Wno-unused-but-set-variable flag... yes<br>> > checking if the /usr/bin/g++ compiler accepts the -Wno-sign-compare<br>> > flag... yes<br>> > checking for python version... 2.7<br>> > checking for python platform... linux2<br>> > checking for python script directory...<br>> > ${prefix}/lib/python2.7/site-packages<br>> > checking for python extension module directory...<br>> > ${exec_prefix}/lib64/python2.7/site-packages<br>> > checking for Cython >= 0.18... yes<br>> > configure: Cython >= 0.18 found: Python extension source can be rebuilt<br>> > (for developers)<br>> > configure: All Python build checks successful: 'rivet' Python extension<br>> > will be built<br>> > ---------------------------------<br>> ><br>> ><br>> ><br>> ><br>> > Best regards,<br>> > Max<br>> ><br>> ><br>> ><br>> ><br>> ><br>> ><br>> ><br>> ><br>> > > Subject: Re: [Rivet] Rivet issue with PYTHONPATH variable<br>> > > To: maksym.deliyergiyev@outlook.com; rivet@projects.hepforge.org<br>> > > From: andy.buckley@cern.ch<br>> > > Date: Mon, 28 Sep 2015 10:54:59 +0100<br>> > ><br>> > > Hi Max,<br>> > ><br>> > > I'm not sure what you are trying to do. Those paths look like<br>> > > system-level Python paths, which should be automatically searched by the<br>> > > active Python executable. In addition it doesn't make sense to have<br>> > > Python search module directories both for Python3 (which Rivet doesn't<br>> > > yet support) and Python2 -- you are either using one or the other!<br>> > ><br>> > > Your method 1 is setting a PYTHON variable as well as PYTHONPATH. I<br>> > > don't know if that has any effect, but note that $PYTHON is often used<br>> > > to refer to the python executable itself, so this could cause problems.<br>> > ><br>> > > Your method 2 implies some confusion over what rivet-config does: it<br>> > > just prints paths and config flags according to what was used to build<br>> > > and install Rivet, to help with consistency when building plugin modules<br>> > > or linking other codes against libRivet. It does not *set* the<br>> > > environment -- no executable can do that, because they can only modify<br>> > > the subshell that they execute in, which disappears when the program<br>> > > finishes.<br>> > ><br>> > > All Rivet should require in PYTHONPATH is the path to the directory (or<br>> > > directories) containing the rivet and yoda Python modules. These modules<br>> > > are actually directories, which contain files like __init__.py, other<br>> > > *.py files, and the C extensions which both cases are called core.so. I<br>> > > usually install into my home directory, and hence need to set<br>> > > PYTHONPATH; if you have installed into system paths like /usr or<br>> > > /usr/local then I suspect you should not need to set anything because<br>> > > e.g. /usr/lib64/pythonX.Y/site-packages should already be in the Python<br>> > > X.Y default search path.<br>> > ><br>> > > Andy<br>> > ><br>> > ><br>> > > On 28/09/15 10:38, Maksym Deliyergiyev wrote:<br>> > > > Dear Rivet developers,<br>> > > ><br>> > > > Could you please explain me how one should have to configure the<br>> > > > PYTHONPATH in order to force the Rivet application to work? I have<br>> > tried<br>> > > > to setup this environment variable in several ways, but it seems the<br>> > > > Rivet still do not recognized it. The most weird thing that during the<br>> > > > configuration procedure the python is always found in the right place.<br>> > > ><br>> > > > Method 1:<br>> > > > ---------------------------------------------<br>> > > > export PYTHONPATH=$PYTHONPATH:/usr/lib/python2.7/site-packages<br>> > > > export PYTHONPATH=$PYTHONPATH:/usr/lib/python3.4/site-packages<br>> > > > export PYTHONPATH=$PYTHONPATH:/usr/lib64/python2.7/site-packages<br>> > > > export PYTHONPATH=$PYTHONPATH:/usr/lib64/python3.4/site-packages<br>> > > > export PYTHONPATH=$PYTHONPATH:/usr/local/include/python3.4m<br>> > > > export PYTHONPATH=$PYTHONPATH:/usr/include/python2.74<br>> > > > export PYTHONPATH=$PYTHONPATH:/bin/python<br>> > > ><br>> > > ><br>> > > > export PYTHON=$PYTHON:/usr/lib/python2.7/site-packages<br>> > > > export PYTHON=$PYTHON:/usr/lib/python3.4/site-packages<br>> > > > export PYTHON=$PYTHON:/usr/lib64/python2.7/site-packages<br>> > > > export PYTHON=$PYTHON:/usr/lib64/python3.4/site-packages<br>> > > > export PYTHON=$PYTHON:/usr/local/include/python3.4m<br>> > > > export PYTHON=$PYTHON:/usr/include/python2.74<br>> > > > export PYTHON=$PYTHON:/bin/python<br>> > > > ---------------------------------------------<br>> > > ><br>> > > ><br>> > > > Method 2:<br>> > > > ---------------------------------------------<br>> > > > ./rivet-config --pythonpath=/usr/include/python3.4m<br>> > > > --libs=/usr/lib64/python3.4/site-packages --libdir=/opt/Rivet/lib<br>> > > > --includedir=/opt/Rivet/include<br>> > > > ---------------------------------------------<br>> > > ><br>> > > ><br>> > > > Method 3:<br>> > > > ---------------------------------------------<br>> > > > import os, sys<br>> > > ><br>> > > > ## Load the rivet module<br>> > > > try:<br>> > > > import rivet<br>> > > > except:<br>> > > > ## If rivet loading failed, try to bootstrap the Python path!<br>> > > > try:<br>> > > > # TODO: Is this a good idea? Maybe just notify the user that<br>> > > > their PYTHONPATH is wrong?<br>> > > > import commands<br>> > > > ...<br>> > > > ...<br>> > > > ...<br>> > > > sys.path.append('/usr/lib/python2.7/site-packages')<br>> > > > sys.path.append('/usr/lib/python3.4/site-packages')<br>> > > > sys.path.append('/usr/lib64/python2.7/site-packages')<br>> > > > sys.path.append('/usr/lib64/python3.4/site-packages')<br>> > > > sys.path.append('/usr/local/include/python3.4m')<br>> > > > sys.path.append('/usr/include/python2.74')<br>> > > > sys.path.append('/usr/include/python3.4m')<br>> > > > sys.path.append('/opt/Rivet/lib64/python2.7/site-packages')<br>> > > > sys.path.append('/bin/python')<br>> > > > import rivet<br>> > > > except:<br>> > > > sys.stderr.write("The rivet Python module could not be loaded:<br>> > > > is your PYTHONPATH set correctly?\n")<br>> > > > sys.exit(1)<br>> > > > ---------------------------------------------<br>> > > ><br>> > > ><br>> > > ><br>> > > ><br>> > > ><br>> > > > Thanks in advance,<br>> > > > Max<br>> > > ><br>> > > ><br>> > > > _______________________________________________<br>> > > > Rivet mailing list<br>> > > > Rivet@projects.hepforge.org<br>> > > > https://www.hepforge.org/lists/listinfo/rivet<br>> > > ><br>> > ><br>> > ><br>> > > --<br>> > > Dr Andy Buckley, Lecturer / Royal Society University Research Fellow<br>> > > Particle Physics Expt Group, University of Glasgow<br>> <br>> <br>> -- <br>> Dr Andy Buckley, Lecturer / Royal Society University Research Fellow<br>> Particle Physics Expt Group, University of Glasgow<br></div> </div></body>
</html>