ansys / pydpf-core

Data Processing Framework - Python Core
http://dpf.docs.pyansys.com/
MIT License
67 stars 25 forks source link

DPFServerException error after installing ANSYS2023 R2 #1104

Closed junming1202 closed 1 year ago

junming1202 commented 1 year ago

Before submitting the issue

Description of the bug

Hi, the previous ANSYS version i used is ANSYS 2022 R11, currently still installed in my pc. The pyansys dpf core is able to run with no issue previously. After installing ANSYS 2023 R2, I encounter dpfserverexception error even with simple demo example.

Steps To Reproduce

  1. Install ANSYS 2023 R2

  2. open command prompt

  3. open python environment by entering "python"

  4. run a simple demo example:

    >>> from ansys.dpf.core import Model
    >>> from ansys.dpf.core import examples
    >>> model = Model(examples.find_simple_bar())
    >>> print(model)
  5. Following error shows after entering "print(model)"

    
    Traceback (most recent call last):
    File "C:\Users\junmisoh.AMD\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\ansys\dpf\core\errors.py", line 101, in wrapper
    out = func(*args, **kwargs)
    File "C:\Users\junmisoh.AMD\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\ansys\dpf\core\model.py", line 504, in result_info
    self._cache_result_info()
    File "C:\Users\junmisoh.AMD\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\ansys\dpf\core\model.py", line 282, in _cache_result_info
    self._result_info = self._load_result_info()
    File "C:\Users\junmisoh.AMD\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\ansys\dpf\core\model.py", line 429, in _load_result_info
    raise e
    File "C:\Users\junmisoh.AMD\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\ansys\dpf\core\model.py", line 423, in _load_result_info
    result_info = op.get_output(0, types.result_info)
    File "C:\Users\junmisoh.AMD\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\ansys\dpf\core\dpf_operator.py", line 494, in get_output
    parameters = {type_tuple[2]: type_tuple[1](self, pin)}
    File "C:\Users\junmisoh.AMD\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\ansys\dpf\gate\generated\operator_capi.py", line 579, in operator_getoutput_result_info
    raise errors.DPFServerException(sError.value)
    ansys.dpf.gate.errors.DPFServerException: ResultInfoProvider:2<-Data sources not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "", line 1, in File "C:\Users\junmisoh.AMD\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\ansys\dpf\core\model.py", line 203, in str txt += str(self.results) File "C:\Users\junmisoh.AMD\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\ansys\dpf\core\model.py", line 157, in results self.metadata.result_info, File "C:\Users\junmisoh.AMD\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\ansys\dpf\core\errors.py", line 106, in wrapper raise DPFServerException(details) ansys.dpf.gate.errors.DPFServerException: ResultInfoProvider:2<-Data sources not defined



### Which Operating System causes the issue?

Windows

### Which DPF/Ansys version are you using?

Ansys 2023 R2

### Which Python version causes the issue?

3.10

### Installed packages

Package                      Version   Editable project location
---------------------------- --------- ------------------------------------
ansys-dpf-core               0.9.0
ansys-dpf-gate               0.4.1
ansys-dpf-gatebin            0.3.1
ansys-dpf-post               0.4.0
ansys-dpf-server-2023-2-pre1 2023.2rc1 d:\ansys_dpf_server_win_v2023.2.pre1
ansys-grpc-dpf               0.7.1
asttokens                    2.2.1
backcall                     0.2.0
cachetools                   5.3.0
certifi                      2022.12.7
charset-normalizer           3.1.0
cli2gui                      2022.3
colorama                     0.4.6
comm                         0.1.3
contourpy                    1.0.6
cycler                       0.11.0
debugpy                      1.6.7
decorator                    5.1.1
et-xmlfile                   1.1.0
executing                    1.2.0
fonttools                    4.38.0
getostheme                   2021
google-api-core              2.11.0
google-api-python-client     2.82.0
google-auth                  2.16.3
google-auth-httplib2         0.1.0
googleapis-common-protos     1.59.0
grpcio                       1.51.3
httplib2                     0.22.0
idna                         3.4
importlib-metadata           6.1.0
ipykernel                    6.23.1
ipython                      8.14.0
jedi                         0.18.2
joblib                       1.2.0
jupyter_client               8.2.0
jupyter_core                 5.3.0
kiwisolver                   1.4.4
matplotlib                   3.6.2
matplotlib-inline            0.1.6
nest-asyncio                 1.5.6
numpy                        1.23.5
openpyxl                     3.1.2
packaging                    22.0
pandas                       1.5.3
parso                        0.8.3
pickleshare                  0.7.5
Pillow                       9.3.0
pip                          23.0.1
platformdirs                 3.5.1
prompt-toolkit               3.0.38
protobuf                     4.22.1
psutil                       5.9.4
pure-eval                    0.2.2
pyasn1                       0.4.8
pyasn1-modules               0.2.8
Pygments                     2.15.1
pyparsing                    3.0.9
PyQt5                        5.15.9
PyQt5-Qt5                    5.15.2
PyQt5-sip                    12.11.1
PySimpleGUI                  4.60.4
python-dateutil              2.8.2
pytz                         2022.7
pywin32                      306
PyYAML                       6.0
pyzmq                        25.1.0
requests                     2.28.2
rsa                          4.9
scikit-learn                 1.2.2
scipy                        1.9.3
scooby                       0.7.2
six                          1.16.0
sklearn                      0.0.post1
stack-data                   0.6.2
threadpoolctl                3.1.0
tk                           0.1.0
tornado                      6.3.2
tqdm                         4.65.0
traitlets                    5.9.0
uritemplate                  4.1.1
urllib3                      1.26.15
wcwidth                      0.2.6
XlsxWriter                   3.0.6
zipp                         3.15.0
junming1202 commented 1 year ago

Hi, the way i got it work is:

  1. Uninstall ANSYS 2023R2
  2. Uninstall Python
  3. Reinstall Python
  4. Reinstall ANSYS 2023R2

Although not 100% sure, I believe the error has something to do with the python library where ansys-dpf-core is installed. FYI, you can find where the module is install when you redo the "pip install ansys-dpf-core".

PProfizi commented 1 year ago

Hi @junming1202, Not sure what the error could have been, but I am glad this is now working.

aukselis-c1connections commented 6 months ago

I am having exactly the same issue after upgrading from 2023R1 to 2024R1 on a Linux machine. Can't reinstall so easily due to extensive RSM configuration. Would be nice to get a better solution.

I use virtual environments for Python so that is a bit different than OP.

tagging @PProfizi for visibility as this issue is closed.

PProfizi commented 6 months ago

Hi @aukselis-c1connections, Looking back at the issue I can see that OP had some out-of-date libraries in his environment which could prevent PyDPF from working properly with ANSYS2023 R2. Could you please share a pip list? You can find more information on server-client compatibility here.