adc-connect / adcc

adcc: Seamlessly connect your program to ADC
https://adc-connect.org
GNU General Public License v3.0
32 stars 19 forks source link

Problem running adcc: Prohibited to create memoryview without Py_buffer #94

Closed BranisalavStankovic closed 3 years ago

BranisalavStankovic commented 3 years ago

Hi all,

I tried to do 1st exampe (i. e. one named Getting a first taste) and it told me that it is "Prohibited to create memoryview without Py_buffer"

Below is the whole message.

So, what I have to do?

Best, Branislav

/home/bane/PycharmProjects/ADC/venv/bin/python /home/bane/PycharmProjects/ADC/prime.py converged SCF energy = -76.0571904154806 Traceback (most recent call last): File "/home/bane/PycharmProjects/ADC/prime.py", line 17, in state = adcc.adc3(scfres, n_singlets=3) File "/home/bane/PycharmProjects/ADC/venv/lib/python3.6/site-packages/adcc/init.py", line 108, in adc3 return run_adc(*args, **kwargs, method="adc3") File "/home/bane/PycharmProjects/ADC/venv/lib/python3.6/site-packages/adcc/workflow.py", line 175, in run_adc frozen_virtual=frozen_virtual, method=method) File "/home/bane/PycharmProjects/ADC/venv/lib/python3.6/site-packages/adcc/workflow.py", line 232, in construct_adcmatrix frozen_virtual=frozen_virtual) File "/home/bane/PycharmProjects/ADC/venv/lib/python3.6/site-packages/adcc/ReferenceState.py", line 146, in init core_orbitals=core_orbitals) File "/home/bane/PycharmProjects/ADC/venv/lib/python3.6/site-packages/adcc/MoSpaces.py", line 133, in init spaceargs["frozen_core"], spaceargs["frozen_virtual"]) RuntimeError: Prohibited to create memoryview without Py_buffer

Process finished with exit code 1

maxscheurer commented 3 years ago

Hi,

sorry that you're having troubles with the example. This is a problem caused by pybind11 version 2.6, which was used, in your case, to build the Python bindings for adcc.

Support for pybind11 2.6 is now also available in the current master branch, because we recently discovered this problem (see #93). So, you need to re-build the adcc extensions after updating your checked out adcc version (git pull --ff).

Let us know if this does the job...

BranisalavStankovic commented 3 years ago

Hi,

I am new to this so can you tell me in more details what I should do?

Best regards, Branislav

maxscheurer commented 3 years ago

Ok. How did you install adcc on your machine? (Possible options are via conda, pip, or from source...)

BranisalavStankovic commented 3 years ago

pip or conda, not sure. One was working, other not. Think conda

mfherbst commented 3 years ago

Since conda is distributed as binaries I would assume conda to work (If not please tell us, since that would not be on our radar).

The pip installation will likely fail at the moment, since by default pip will use pybind11 2.6 that is incompatible with the lastest adcc. If you want to use pip, the simplest workaround at the moment is:

pip install "pybind11<2.6" "h5py<3.0" "adcc==0.15.1"

i.e. to pin the version of adcc and some of its dependencies to a known-to-work setup. I just tested this in a fresh virtualenv and it worked for me. Please let us know if not.

Current plan is to release a new version of adcc within the next week, which will have the issue fixed in either case.

mfherbst commented 3 years ago

Closing as adcc 0.15.2 (containing the bugfix) has been released on PyPI.