SModelS / smodels

SModelS
https://smodels.github.io
14 stars 4 forks source link

Error message on running ./runSModelS.py #34

Open juhidutta opened 1 year ago

juhidutta commented 1 year ago

Dear experts,

I am currently using SModelS Release v2.3.2 (the zip version from github). While I have successfully installed it on centos7 system, I encounter the following error on running ./runSModelS.py -h:

Traceback (most recent call last): File "./runSModelS.py", line 3, in from smodels.tools.runSModelS import main File "/raid05/users/jdutta/smodels-main/smodels/tools/runSModelS.py", line 12, in from smodels.tools import modelTester File "/raid05/users/jdutta/smodels-main/smodels/tools/modelTester.py", line 16, in from smodels.theory import theoryPrediction File "/raid05/users/jdutta/smodels-main/smodels/theory/theoryPrediction.py", line 16, in from smodels.tools.statsTools import StatsComputer File "/raid05/users/jdutta/smodels-main/smodels/tools/statsTools.py", line 20, in from smodels.tools.pyhfInterface import PyhfData, PyhfUpperLimitComputer File "/raid05/users/jdutta/smodels-main/smodels/tools/pyhfInterface.py", line 41, in import pyhf File "/home/jdutta/.local/lib/python3.7/site-packages/pyhf/init.py", line 7, in from pyhf.pdf import Model File "/home/jdutta/.local/lib/python3.7/site-packages/pyhf/pdf.py", line 11, in from pyhf import schema File "/home/jdutta/.local/lib/python3.7/site-packages/pyhf/schema/init.py", line 6, in from pyhf.schema.loader import load_schema File "/home/jdutta/.local/lib/python3.7/site-packages/pyhf/schema/loader.py", line 5, in from pyhf.schema import variables File "/home/jdutta/.local/lib/python3.7/site-packages/pyhf/schema/variables.py", line 9, in schemas = resources.files('pyhf') / "schemas" AttributeError: module 'importlib_resources' has no attribute 'files'

Could you please kindly advise how I may resolve this error?

Best regards, Juhi

WolfgangWaltenberger commented 1 year ago

Hey Juhi,

long time no see! The error is an issue with pyhf, the code reads

if sys.version_info >= (3, 9): from importlib import resources else: import importlib_resources as resources

Is there any way you can just use a python version >= 3.9? If you really need python 3.7 and pyhf and you have the latest importlib_resources module, then I suggest contacting the pyhf team about this.

Cheers

Wolfgang

On Wed, Aug 30, 2023 at 9:34 PM juhidutta @.***> wrote:

Dear experts,

I am currently using SModelS Release v2.3.1. While I have successfully installed it on centos7 system, I encounter the following error on running ./runSModelS.py -h:

Traceback (most recent call last): File "./runSModelS.py", line 3, in from smodels.tools.runSModelS import main File "/raid05/users/jdutta/smodels-main/smodels/tools/runSModelS.py", line 12, in from smodels.tools import modelTester File "/raid05/users/jdutta/smodels-main/smodels/tools/modelTester.py", line 16, in from smodels.theory import theoryPrediction File "/raid05/users/jdutta/smodels-main/smodels/theory/theoryPrediction.py", line 16, in from smodels.tools.statsTools import StatsComputer File "/raid05/users/jdutta/smodels-main/smodels/tools/statsTools.py", line 20, in from smodels.tools.pyhfInterface import PyhfData, PyhfUpperLimitComputer File "/raid05/users/jdutta/smodels-main/smodels/tools/pyhfInterface.py", line 41, in import pyhf File "/home/jdutta/.local/lib/python3.7/site-packages/pyhf/init.py", line 7, in from pyhf.pdf import Model File "/home/jdutta/.local/lib/python3.7/site-packages/pyhf/pdf.py", line 11, in from pyhf import schema File "/home/jdutta/.local/lib/python3.7/site-packages/pyhf/schema/init.py", line 6, in from pyhf.schema.loader import load_schema File "/home/jdutta/.local/lib/python3.7/site-packages/pyhf/schema/loader.py", line 5, in from pyhf.schema import variables File "/home/jdutta/.local/lib/python3.7/site-packages/pyhf/schema/variables.py", line 9, in schemas = resources.files('pyhf') / "schemas" AttributeError: module 'importlib_resources' has no attribute 'files'

Could you please kindly advise how I may resolve this error?

Best regards, Juhi

— Reply to this email directly, view it on GitHub https://github.com/SModelS/smodels/issues/34, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLSE42GV7CRTBT3KECEZBDXX6IUFANCNFSM6AAAAAA4E76UVI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

juhidutta commented 1 year ago

Hi Wolfgang,

Thank you for your response.

I will upgrade importlib_resources and retry again on the cluster. Meanwhile, it runs successfully on a Ubuntu system.

With best regards, Juhi

On Thu, Aug 31, 2023 at 3:28 PM Wolfgang Waltenberger < @.***> wrote:

Hey Juhi,

long time no see! The error is an issue with pyhf, the code reads

if sys.version_info >= (3, 9): from importlib import resources else: import importlib_resources as resources

Is there any way you can just use a python version >= 3.9? If you really need python 3.7 and pyhf and you have the latest importlib_resources module, then I suggest contacting the pyhf team about this.

Cheers

Wolfgang

On Wed, Aug 30, 2023 at 9:34 PM juhidutta @.***> wrote:

Dear experts,

I am currently using SModelS Release v2.3.1. While I have successfully installed it on centos7 system, I encounter the following error on running ./runSModelS.py -h:

Traceback (most recent call last): File "./runSModelS.py", line 3, in from smodels.tools.runSModelS import main File "/raid05/users/jdutta/smodels-main/smodels/tools/runSModelS.py", line 12, in from smodels.tools import modelTester File "/raid05/users/jdutta/smodels-main/smodels/tools/modelTester.py", line 16, in from smodels.theory import theoryPrediction File "/raid05/users/jdutta/smodels-main/smodels/theory/theoryPrediction.py", line 16, in from smodels.tools.statsTools import StatsComputer File "/raid05/users/jdutta/smodels-main/smodels/tools/statsTools.py", line 20, in from smodels.tools.pyhfInterface import PyhfData, PyhfUpperLimitComputer File "/raid05/users/jdutta/smodels-main/smodels/tools/pyhfInterface.py", line 41, in import pyhf File "/home/jdutta/.local/lib/python3.7/site-packages/pyhf/init.py", line 7, in from pyhf.pdf import Model File "/home/jdutta/.local/lib/python3.7/site-packages/pyhf/pdf.py", line 11, in from pyhf import schema File "/home/jdutta/.local/lib/python3.7/site-packages/pyhf/schema/init.py", line 6, in from pyhf.schema.loader import load_schema File "/home/jdutta/.local/lib/python3.7/site-packages/pyhf/schema/loader.py", line 5, in from pyhf.schema import variables File

"/home/jdutta/.local/lib/python3.7/site-packages/pyhf/schema/variables.py", line 9, in schemas = resources.files('pyhf') / "schemas" AttributeError: module 'importlib_resources' has no attribute 'files'

Could you please kindly advise how I may resolve this error?

Best regards, Juhi

— Reply to this email directly, view it on GitHub https://github.com/SModelS/smodels/issues/34, or unsubscribe < https://github.com/notifications/unsubscribe-auth/ABLSE42GV7CRTBT3KECEZBDXX6IUFANCNFSM6AAAAAA4E76UVI>

. You are receiving this because you are subscribed to this thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/SModelS/smodels/issues/34#issuecomment-1700734435, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHNKT6QHSRE6ZB47RY4YHK3XYBN25ANCNFSM6AAAAAA4E76UVI . You are receiving this because you authored the thread.Message ID: @.***>