Python Configuration on version 3.0.3-neworders fails with has md5 not found

Asked by Silas Grossberndt on 2021-01-16

I have installed version 3.0.3-neworders and whenever I try to run bin/mg5_aMC I get the following error:

"root: code for hash md5 was not found.
Traceback (most recent call last):
  File "/usr/lib/python2.7/hashlib.py", line 139, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
    raise ValueError('unsupported hash type %s' % name)
ValueError: unsupported hash type md5"

and, by playing around with the PYTHONPATH and PYTHONHOME settings, I have been able to get the Python path configuration to show as

Python path configuration:
  PYTHONHOME = '/usr'
  PYTHONPATH = '/usr/lib/python2.7'
  program name = '/usr/bin/python3'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = '/usr/bin/python3'
  sys.base_prefix = '/usr'
  sys.base_exec_prefix = '/usr'
  sys.executable = '/usr/bin/python3'
  sys.prefix = '/usr'
  sys.exec_prefix = '/usr'
  sys.path = [
    '/usr/lib/python2.7',
    '/usr/lib/python38.zip',
    '/usr/lib/python3.8',
    '/usr/lib/python3.8/lib-dynload',
  ]

How can I resolve this issue, and how do I force the executables to python 2.7 instead of python3?

Thank you

Question information

Language:
English Edit question
Status:
Answered
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Last query:
2021-01-16
Last reply:
2021-01-16

Hi,

Are you sure that you are running python3?
for your traceback it seems that you are running python2.7

Now I do not know the status of that dev branch (we have so many) so I do not know if the branch is compatible with python3 or not. But in any case, you can force the python version that you want via using
python27 ./bin/mg5
(just change the number to get another version obviously)

This md5 has already been fixed for sure in the 2.8.3.py3 branch so you can also do the merging with that branch to avoid such issue and then push the merge in a new branch and ask to include that change in that branch (the usual workflow)

Cheers,

Olivier

> On 16 Jan 2021, at 20:05, Silas Grossberndt <email address hidden> wrote:
>
> New question #695033 on MadGraph5_aMC@NLO:
> https://answers.launchpad.net/mg5amcnlo/+question/695033
>
> I have installed version 3.0.3-neworders and whenever I try to run bin/mg5_aMC I get the following error:
>
> "root: code for hash md5 was not found.
> Traceback (most recent call last):
> File "/usr/lib/python2.7/hashlib.py", line 139, in <module>
> globals()[__func_name] = __get_hash(__func_name)
> File "/usr/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
> raise ValueError('unsupported hash type %s' % name)
> ValueError: unsupported hash type md5"
>
> and, by playing around with the PYTHONPATH and PYTHONHOME settings, I have been able to get the Python path configuration to show as
>
>
> Python path configuration:
> PYTHONHOME = '/usr'
> PYTHONPATH = '/usr/lib/python2.7'
> program name = '/usr/bin/python3'
> isolated = 0
> environment = 1
> user site = 1
> import site = 1
> sys._base_executable = '/usr/bin/python3'
> sys.base_prefix = '/usr'
> sys.base_exec_prefix = '/usr'
> sys.executable = '/usr/bin/python3'
> o sys.path = [
> '/usr/lib/python2.7',
> '/usr/lib/python38.zip',
> '/usr/lib/python3.8',
> '/usr/lib/python3.8/lib-dynload',
> ]
>
> How can I resolve this issue, and how do I force the executables to python 2.7 instead of python3?
>
> Thank you
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Silas Grossberndt (sgrossk87) said : #2

I did try forcing to python27, however, I am still getting the hash error. I was more worried about the fact that the python configuration seems to be using python3 as the executable but looking for commands in python2.7.

I was wondering how to set

" program name = '/usr/bin/python3'" to the proper python2 and the sys.executable

Hi,

> " program name = '/usr/bin/python3'" to the proper python2 and the
> sys.executable

I do not know how you get that information so I can not comment.

However by quickly looking at that branch:
1) that branch is not python3 compatible
2) this branch has been merged into another branch. So in principle, they are no (evident) good reason to use this branch now. What do you plan to develop in that branch? (and if you are not a develloper, then why using an unvalidated/outdated /not supported nightly build of the code?)

Cheers,

Olivier

> On 16 Jan 2021, at 20:50, Silas Grossberndt <email address hidden> wrote:
>
> Question #695033 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/695033
>
> Status: Answered => Open
>
> Silas Grossberndt is still having a problem:
> I did try forcing to python27, however, I am still getting the hash
> error. I was more worried about the fact that the python configuration
> seems to be using python3 as the executable but looking for commands in
> python2.7.
>
> I was wondering how to set
>
> " program name = '/usr/bin/python3'" to the proper python2 and the
> sys.executable
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Can you help with this problem?

Provide an answer of your own, or ask Silas Grossberndt for more information if necessary.

To post a message you must log in.