LHAPDF python version not found

Asked by Jethro Gaglione

Hi,
I am running MadGraph v3_2_0 with Python 3.8.6
When trying to use an LHAPDF PDF set, I get the following error:

fail
Failed to access python version of LHAPDF: If the python interface to LHAPDF is available on your system, try adding its location to the PYTHONPATH environment variable and theLHAPDF library location to LD_LIBRARY_PATH (linux) or DYLD_LIBRARY_PATH (mac os x).The required LD_LIBRARY_PATH is /gpfs52/home/gaglijt1/MG/MG5_aMC_v3_2_0/HEPTools/lhapdf6_py3//lib
WARNING: lhapdf 6.2.1 requires python integration in order to download pdf set. Trying anyway
PDF data file location not known: can't upgrade or install
--2021-09-30 14:41:03-- http://lhapdfsets.web.cern.ch/lhapdfsets/current/NNPDF30_lo_as_0130.tar.gz
Resolving lhapdfsets.web.cern.ch (lhapdfsets.web.cern.ch)... 188.185.90.87, 188.185.87.216, 137.138.31.235, ...
Connecting to lhapdfsets.web.cern.ch (lhapdfsets.web.cern.ch)|188.185.90.87|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://lhapdfsets.web.cern.ch/lhapdfsets/current/NNPDF30_lo_as_0130.tar.gz [following]
--2021-09-30 14:41:03-- https://lhapdfsets.web.cern.ch/lhapdfsets/current/NNPDF30_lo_as_0130.tar.gz
Connecting to lhapdfsets.web.cern.ch (lhapdfsets.web.cern.ch)|188.185.90.87|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://lhapdfsets.web.cern.ch/current/NNPDF30_lo_as_0130.tar.gz [following]
--2021-09-30 14:41:04-- https://lhapdfsets.web.cern.ch/current/NNPDF30_lo_as_0130.tar.gz
Reusing existing connection to lhapdfsets.web.cern.ch:443.
HTTP request sent, awaiting response... 200 OK
Length: 27331752 (26M) [application/x-gzip]

It then goes on to download the PDF set indicated and madgraph creates events and seems to run as normal. Seems to me it might be finding the python version on the second attempt. Just wanted to make sure it is not something I need to worry about. Thank you.

Best,
Jethro

Question information

Language:
English Edit question
Status:
Answered
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#1

Nothing to worry about.
lhapdf is quite messy when using their official method to download pdf. So we do have workaround in case the tools of lhapdf are failing to download the pdf set.

Cheers,

Olivier

> On 7 Oct 2021, at 21:35, Jethro Gaglione <email address hidden> wrote:
>
> New question #699010 on MadGraph5_aMC@NLO:
> https://answers.launchpad.net/mg5amcnlo/+question/699010
>
> Hi,
> I am running MadGraph v3_2_0 with Python 3.8.6
> When trying to use an LHAPDF PDF set, I get the following error:
>
>
> fail
> Failed to access python version of LHAPDF: If the python interface to LHAPDF is available on your system, try adding its location to the PYTHONPATH environment variable and theLHAPDF library location to LD_LIBRARY_PATH (linux) or DYLD_LIBRARY_PATH (mac os x).The required LD_LIBRARY_PATH is /gpfs52/home/gaglijt1/MG/MG5_aMC_v3_2_0/HEPTools/lhapdf6_py3//lib
> WARNING: lhapdf 6.2.1 requires python integration in order to download pdf set. Trying anyway
> PDF data file location not known: can't upgrade or install
> --2021-09-30 14:41:03-- http://lhapdfsets.web.cern.ch/lhapdfsets/current/NNPDF30_lo_as_0130.tar.gz
> Resolving lhapdfsets.web.cern.ch (lhapdfsets.web.cern.ch)... 188.185.90.87, 188.185.87.216, 137.138.31.235, ...
> Connecting to lhapdfsets.web.cern.ch (lhapdfsets.web.cern.ch)|188.185.90.87|:80... connected.
> HTTP request sent, awaiting response... 302 Found
> Location: https://lhapdfsets.web.cern.ch/lhapdfsets/current/NNPDF30_lo_as_0130.tar.gz [following]
> --2021-09-30 14:41:03-- https://lhapdfsets.web.cern.ch/lhapdfsets/current/NNPDF30_lo_as_0130.tar.gz
> Connecting to lhapdfsets.web.cern.ch (lhapdfsets.web.cern.ch)|188.185.90.87|:443... connected.
> HTTP request sent, awaiting response... 302 Found
> Location: https://lhapdfsets.web.cern.ch/current/NNPDF30_lo_as_0130.tar.gz [following]
> --2021-09-30 14:41:04-- https://lhapdfsets.web.cern.ch/current/NNPDF30_lo_as_0130.tar.gz
> Reusing existing connection to lhapdfsets.web.cern.ch:443.
> HTTP request sent, awaiting response... 200 OK
> Length: 27331752 (26M) [application/x-gzip]
>
> It then goes on to download the PDF set indicated and madgraph creates events and seems to run as normal. Seems to me it might be finding the python version on the second attempt. Just wanted to make sure it is not something I need to worry about. Thank you.
>
> Best,
> Jethro
>
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
James Young (sbartlesenson37) said :
#2

Today I can download but there is a new problem during the building

Already downloaded: /Users/matthieumarinangeli/Library/Caches/Homebrew/lhapdf-6.1.6.tar.gz
==> ./configure --prefix=/usr/local/Cellar/lhapdf/6.1.6 --with-boost=/usr/local/opt/boost
==> make
Last 15 lines from /Users/matthieumarinangeli/Library/Logs/Homebrew/lhapdf/02.make:
running install
running build
running build_ext
building 'lhapdf' extension
creating build
creating build/temp.macosx-10.12-x86_64-2.7
clang -fno-strict-aliasing -fno-common -dynamic -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/private/tmp/lhapdf-20170719-1709-1fgmqco/LHAPDF-6.1.6/include -I/private/tmp/lhapdf-20170719-1709-1fgmqco/LHAPDF-6.1.6/include -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include - I/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c lhapdf.cpp -o build/temp.macosx-10.12-x86_64-2.7/lhapdf.o -I/usr/local/opt/boost/include -I/usr/local/Cellar/lhapdf/6.1.6/include
lhapdf.cpp:4:10: fatal error: 'Python.h' file not found
#include "Python.h" https://kaio-dia.eu/
^
1 error generated.
error: command 'clang' failed with exit status 1
make[2]: *** [all-local] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#3

Are you on Mac? Never face such issue on mac.
On linux, this happens when python-dev package are not installed.
Since it looks like that you are using homebrew, I would suggest to check if such module are available on homebrew.

Cheers,

Olivier

Can you help with this problem?

Provide an answer of your own, or ask Jethro Gaglione for more information if necessary.

To post a message you must log in.