Quantum-Accelerators / quacc

quacc is a flexible platform for computational materials science and quantum chemistry that is built for the big data era.
https://quantum-accelerators.github.io/quacc/
BSD 3-Clause "New" or "Revised" License
167 stars 45 forks source link

vasp custodian python call might not follow running python interpreter #1521

Closed zulissimeta closed 8 months ago

zulissimeta commented 8 months ago

Details about the quacc environment

What is the issue?

The vasp w/ custodian calculator has the ASE calculator make a subprocess that calls custodian with python: https://github.com/Quantum-Accelerators/quacc/blob/main/src/quacc/calculators/vasp/vasp.py#L176

This works if you are in an environment where python always refers the current running python. This is not necessarily the case in a jupyter notebook that is using a loaded conda kernel.

A safer way to do this would be return f"{sys.executable} {run_vasp_custodian_file}"

This works because explicitly calling the python from the appropriate conda environment will handle imports/etc cleanly.

How can we easily reproduce the issue?

Any vasp calculator call with custodian in jupyter if the process that launched jupyter does not have custodian installed.

Andrew-S-Rosen commented 8 months ago

Thanks for the report. Indeed, I have never tried doing that. Will be closed by #1522.