cms-sw / cmssw

CMS Offline Software
http://cms-sw.github.io/
Apache License 2.0
1.08k stars 4.32k forks source link

Rivet unit test fails with python3 #28919

Open silviodonato opened 4 years ago

silviodonato commented 4 years ago

The new rivet tests (#28873) revealed an incompatibility of rivet with Python3

===== Test "test-rivet-list" ====
The rivet Python module could not be loaded: is your PYTHONPATH set correctly?

---> test test-rivet-list had ERRORS

^^^^ End Test test-rivet-list ^^^^

Indeed, the command rivet --list-analyses gives the error The rivet Python module could not be loaded: is your PYTHONPATH set correctly?.

This error seems rather similar to issue #28837, solved with PR #28842. The probkem is that Rivet is an external package, perhaps we need to use a different version for python3. Do you have any idea about how to solve this issue?

silviodonato commented 4 years ago

assign core-software

silviodonato commented 4 years ago

assign generators

cmsbuild commented 4 years ago

New categories assigned: generators

@alberto-sanchez,@SiewYan,@qliphy,@efeyazgan,@mkirsano,@agrohsje you have been requested to review this Pull request/Issue and eventually sign? Thanks

cmsbuild commented 4 years ago

A new Issue was created by @silviodonato Silvio Donato.

@Dr15Jones, @smuzaffar, @silviodonato, @makortel, @davidlange6, @fabiocos can you please review it and eventually sign/assign? Thanks.

cms-bot commands are listed here

Dr15Jones commented 4 years ago

assign core

cmsbuild commented 4 years ago

New categories assigned: core

@Dr15Jones,@smuzaffar,@makortel you have been requested to review this Pull request/Issue and eventually sign? Thanks

qliphy commented 4 years ago

adding @intrepid42 @xjanssen

mseidel42 commented 4 years ago

Hi, if python3 is configured as default it should be picked up when Rivet is compiled. See some ./configure output from my local system:

checking for python... /usr/bin/python
checking for a version of Python >= '2.1.0'... yes
checking for a version of Python >= '2.7.3'... yes
checking for the distutils Python package... yes
checking for Python include path... -I/usr/include/python3.7m
checking for Python library path... -L/usr/lib64 -lpython3.7m
checking for Python site-packages path... /usr/lib/python3.7/site-packages
checking python extra libraries... 
checking python extra linking flags... 
checking consistency of all components of python development environment... yes
checking for python version... 3.7
checking for python platform... linux
checking for python script directory... ${prefix}/lib/python3.7/site-packages
checking for python extension module directory... ${exec_prefix}/lib64/python3.7/site-packages
% python
Python 3.7.6 (default, Jan 30 2020, 09:44:41) 
[GCC 9.2.1 20190827 (Red Hat 9.2.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import rivet
>>> rivet.__version__
'3.1.0'

(same applies to yoda)

silviodonato commented 3 years ago

Update of the error (CMSSW_11_2_PY3_X_2020-11-11-2300)

===== Test "test-rivet-list" ====
The rivet Python module could not be loaded: are your PYTHONPATH and (DY)LD_LIBRARY_PATH set correctly?
Try running 'python -c "import rivet"' at the command line (or "import rivet" in a Python REPL)
Full error message:
No module named 'commands'

---> test test-rivet-list had ERRORS
mseidel42 commented 3 years ago

Hi Fabio,

I think @smuzaffar has solved the problem for YODA: https://github.com/cms-sw/cmsdist/blame/IB/CMSSW_11_2_X/py3/yoda.spec#L19 (see output below)

Would the same work for Rivet?

% python
Python 3.8.2 (default, May  7 2020, 20:12:14) 
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import yoda
Warning in <TInterpreter::ReadRootmapFile>: typedef  HepMC::FourVector found in libHepMC3rootIO.so  is already in libSimDataFormatsGeneratorProducts.so 
>>> yoda.__version__
b'1.8.3'
>>> yoda.__path__
['/cvmfs/cms-ib.cern.ch/nweek-02654/slc7_amd64_gcc820/external/yoda/1.8.3-ddf25d9922c60df7fe0fdf63f8d8e5b0/lib/python3.8/site-packages/yoda']
>>> import rivet
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/cvmfs/cms-ib.cern.ch/nweek-02654/slc7_amd64_gcc820/lcg/root/6.22.03-694cb0996bc307ad6096a3730e294a41/lib/ROOT/_facade.py", line 121, in _importhook
    return _orig_ihook(name, *args, **kwds)
ModuleNotFoundError: No module named 'rivet'
makortel commented 1 month ago

I guess this issue has been solved?

cmsbuild commented 1 month ago

cms-bot internal usage