E ImportError: Error during import of ansys-dpf-core:
E detected one of ['ansys-dpf-gatebin', 'ansys-dpf-gate', 'ansys-grpc-dpf'] installed. The current version of ansys-dpf-core requires uninstalling these previous dependencies to run correctly.
I am having the same issue!
I have just performed a fresh install of ANSYS2024R1, and setup a new venv.
In this venv i have run the following commands:
pip install pyansys
pip install spyder
When doing this, i encountered the error "AttributeError: 'dict' object has no attribute 'return_arrays'"
To solve the issue, i updated to ansys-dpf-core==0.11.0
:
pip install --force-reinstall -v "ansys-dpf-core==0.11.0"
And I recieved the same self-explanatory error you encountered:
E ImportError: Error during import of ansys-dpf-core:
E detected one of ['ansys-dpf-gatebin', 'ansys-dpf-gate', 'ansys-grpc-dpf'] installed. The current version of ansys-dpf-core requires uninstalling these previous dependencies to run correctly.
So solve the issue, i performed:
pip uninstall ansys-dpf-gatebin
pip uninstall ansys-dpf-gate
pip uninstall ansys-grpc-dpf
Now i just receive the following error:
ModuleNotFoundError: No module named 'ansys.dpf.gate'
... Obviously i just removed ansys.dpf.gate, but I thought that was the point?
Can anyone please help me?
Update:
I started over... New venv installed pyansys=2024.1.2
got error: "AttributeError: 'dict' object has no attribute 'return_arrays'"
updated dpf core: pip install ansys-dpf-core==0.11.0
got error: E detected one of ['ansys-dpf-gatebin', 'ansys-dpf-gate', 'ansys-grpc-dpf'] installed...
reinstalled old dpf core: pip install ansys-dpf-core==0.10.1
Now everything works...
TLDR; in my case, simply forcing the install of dpf core 0.10.1 fixed it...
pip install ansys-dpf-core==0.10.1
Hello everyone,
Just to confirm, ansys-dpf-core 0.10.1 should not have ansys-dpf-gate, ansys-dpf-gatebin or ansys-grpc-dpf installed along with it.
This is why 0.11.0 now raises an Error.
ansys-dpf-core 0.10.1 installed in a fresh venv will not install ansys-dpf-gate, gatebin or grpc-dpf, and should not raise the initial issue anymore.
The issue you got hen installing everything from the start is probably due to the "pyansys" module still marking ansys-dpf-gate as required.
Hi @Paul Profizi that's good to know! I think I ended up in this situation after doing pip install pyansys
so do you know if the bundle has also fixed it?
@James Derrick said:
@Rajesh Meena Thanks for your input, I'm afraid this hasn't fixed it for me. I did a completely clean venv with Python and just installed ansys-dpf-core
and jupyterlab
then tried to run the example again (this should have worked).
It did not because
File ~\dpfvenv\Lib\site-packages\ansys\dpf\core\plotter.py:44, in _PyVistaPlotter.__init__(self, **kwargs)
42 def __init__(self, **kwargs):
43 # Import pyvista
---> 44 from ansys.dpf.core.vtk_helper import PyVistaImportError
46 try:
47 import pyvista as pv
File ~\dpfvenv\Lib\site-packages\ansys\dpf\core\vtk_helper.py:2
1 import numpy as np
----> 2 import pyvista as pv
3 import ansys.dpf.core as dpf
4 from ansys.dpf.core import errors
ModuleNotFoundError: No module named 'pyvista'
@James Derrick ah you found an error. This is supposed to raise an explicit error telling the user to install plotting dependencies to use plotting features. Will fix.
@James Derrick said:
Hi @Paul Profizi that's good to know! I think I ended up in this situation after doing pip install pyansys
so do you know if the bundle has also fixed it?
I just checked and the latest PyAnsys meta package indeed contains ansys-dpf-gate as a dependency along with ansys-dpf-core 0.10.1, which is wrong. Will tell them to fix and release.