No module named 'haddock'

Prof. Bonvin,
When I tried to run HADDOCK 3.0, I got this error:
Traceback (most recent call last):
File “/home/alex/share/haddock3-3.0.alpha2/bin/haddock3.py”, line 8, in
from haddock.modules.analysis.ana import Ana
ModuleNotFoundError: No module named ‘haddock’
What should I modify?
Thanks in advance,
Alexandru Tirziu

Did you follow the installation instruction?

Dear Prof. Bonvin,
Yes, I followed the installation instructions as they were described. I think I have some issues regarding the path specification in the activate file.
#!/bin/bash
export HADDOCK3=/home/alex/share/haddock3-3.0.alpha2
export CNS_EXE=/home/alex/share/cns_solve_1.3/bin/cns

if [[ -z "{PYTHONPATH}" ]]; then PYTHONPATH={HADDOCK3}
else
PYTHONPATH={PYTHONPATH}:{HADDOCK3}
fi

export PATH={PATH}:{HADDOCK3}/bin
I have untared HADDOCK and CNS on the home/alex/share folder. Am I specifying the path correctly?
Thank you in advance!

The part of code that you pasted do not contain the exports and the $ in the variables, check if you are running the distributed version: https://github.com/haddocking/haddock3/blob/master/bin/activate

Also, try checking if /home/alex/share/haddock3-3.0.alpha2 is in your PYTHONPATH
if not, export it directly and try again

$ export PYTHONPATH=${PYTHONPATH}:/home/alex/share/haddock3-3.0.alpha2
$ python /home/alex/share/haddock3-3.0.alpha2/bin/haddock3.py
1 Like

Did you check the PYTHONPATH variable?

1 Like

That was the problem, thank you.
However, I get this error when I’m trying to run HADDOCK:

File “/home/alex/share/haddock3-3.0.alpha2/bin/haddock3.py”, line 250, in
valid_cns = CNS().validate_cns()
File “/home/alex/share/haddock3-3.0.alpha2/haddock/modules/cns/engine.py”, line 28, in validate_cns
raise False
TypeError: exceptions must derive from BaseException

My activate file:
export HADDOCK3=/home/alex/share/haddock3-3.0.alpha2/
export CNS_EXE=/home/alex/share/cns_solve_1.3/intel-x86_64bit-linux/bin/cns
export PYTHONPATH=${PYTHONPATH}:/home/alex/share/haddock3-3.0-alpha2/

Is it about the path that I’m specifying?
Thank you!

That was the problem. Thank you, professor!
However, I get this error when I’m trying to run HADDOCK:

File “/home/alex/share/haddock3-3.0.alpha2/bin/haddock3.py”, line 250, in
valid_cns = CNS().validate_cns()
File “/home/alex/share/haddock3-3.0.alpha2/haddock/modules/cns/engine.py”, line 28, in validate_cns
raise False
TypeError: exceptions must derive from BaseException

My activate file:
export HADDOCK3=/home/alex/share/haddock3-3.0.alpha2/
export CNS_EXE=/home/alex/share/cns_solve_1.3/intel-x86_64bit-linux/bin/cns
export PYTHONPATH=${PYTHONPATH}:/home/alex/share/haddock3-3.0-alpha2/

Is it about the path that I’m specifying?
Thank you!

You have to install CNS yourself, recompiling it with the provided code in the cns1.3 folder

Prof. Bonvin,
I have copied the files from the cns1.3 into the cns bin folder, configured cns_solve_env and compiled it with gfortran. I have a .exe in the cns_solve_1.3/intel-x86_64bit-linux/source: cns_solve-2010061434.exe. Is this the one I need to specify for CNS_EXE?
Should I compile cns with other compiler?
Thank you so much!
Alexandru Tirziu

Yes - but you should copy first the files into the source directory and not bin

1 Like

Now it’s working, running it0. Thank you so much, professor!