fishjojo/pyscfad

from pyscf.lib import ops

Closed this issue · 4 comments

When I try to run the example script provided here:
https://github.com/fishjojo/pyscfad/blob/main/examples/cc/00-simple.py

I get the following error:

Traceback (most recent call last):
  File "pyscfad_test.py", line 2, in <module>
    from pyscfad import gto, scf, cc
  File "/Users/deyanmihaylov/opt/anaconda3/envs/python38/lib/python3.8/site-packages/pyscfad/gto/__init__.py", line 1, in <module>
    from pyscfad.gto import mole
  File "/Users/deyanmihaylov/opt/anaconda3/envs/python38/lib/python3.8/site-packages/pyscfad/gto/mole.py", line 8, in <module>
    from pyscfad.lib import ops, custom_jvp
  File "/Users/deyanmihaylov/opt/anaconda3/envs/python38/lib/python3.8/site-packages/pyscfad/lib/__init__.py", line 1, in <module>
    from pyscf.lib import ops
ImportError: cannot import name 'ops' from 'pyscf.lib' (/Users/deyanmihaylov/opt/anaconda3/envs/python38/lib/python3.8/site-packages/pyscf/lib/__init__.py)

Now, looking at both the original pyscf and your fork of pyscf, the lib directory does not include any file or directory names ops. On the other hand, the pyscfad has a lib/ops.py. May I please ask if I am doing something wrong, or should the import be from pyscfad instead of from pyscf?

Have you tried to import from pyscfad?

Did you use the ad branch of pyscf, the file is here:
https://github.com/fishjojo/pyscf/blob/ad/pyscf/lib/ops.py

Are you still getting this error @deyanmihaylov? If not, perhaps this issue could be closed.

Yes, the issue can be closed as the error was resolved.