ansys / pydpf-core

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

Crash during server shutdown #718

Open ayush-kumar-423 opened 1 year ago

ayush-kumar-423 commented 1 year ago

Before submitting the issue

Description of the bug

With the following libs. installed, any PyDPF script after being executed, throws the following error:

image

/usr/local/opensoftware/python/3.10.9/lib/python3.10/site-packages/ansys/dpf/core/server_types.py:1141: UserWarning: Traceback (most recent call last):
  File "/usr/local/opensoftware/python/3.10.9/lib/python3.10/site-packages/ansys/dpf/core/server_types.py", line 1129, in shutdown
    self._shutdown_func[0](self._shutdown_func[1])
TypeError: 'NoneType' object is not callable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/opensoftware/python/3.10.9/lib/python3.10/site-packages/ansys/dpf/core/server_types.py", line 1132, in shutdown
    if self.meet_version("4.0"):
  File "/usr/local/opensoftware/python/3.10.9/lib/python3.10/site-packages/ansys/dpf/core/server_types.py", line 537, in meet_version
    return server_meet_version(required_version, self)
  File "/usr/local/opensoftware/python/3.10.9/lib/python3.10/site-packages/ansys/dpf/core/check_version.py", line 29, in server_meet_version
    return meets_version(version, required_version)
  File "/usr/local/opensoftware/python/3.10.9/lib/python3.10/site-packages/ansys/dpf/core/check_version.py", line 82, in meets_version
    from packaging.version import parse
ImportError: sys.meta_path is None, Python is likely shutting down

Steps To Reproduce

..

Which Operating System are you using?

Linux

Which Ansys version are you using?

Ansys 2022 R1

Which Python version are you using?

3.10

Installed packages

Package Version


absl-py 1.3.0 aiohttp 3.8.3 aiosignal 1.3.1 alabaster 0.7.12 ansys-api-mapdl 0.5.1 ansys-api-platform-instancemanagement 1.0.0b3 ansys-dpf-core 0.7.0 ansys-dpf-gate 0.3.0 ansys-dpf-gatebin 0.3.0 ansys-dpf-post 0.2.5 ansys-grpc-dpf 0.4.0 ansys-mapdl-core 0.63.3 ansys-mapdl-reader 0.52.3 ansys-platform-instancemanagement 1.0.2 anyio 3.6.2 appdirs 1.4.4 argon2-cffi 21.3.0 argon2-cffi-bindings 21.2.0 arrow 1.2.3 astroid 2.12.13 astunparse 1.6.3 async-generator 1.10 async-timeout 4.0.2 atomicwrites 1.4.1 attrs 22.1.0 autopep8 1.6.0 Babel 2.11.0 backcall 0.2.0 beautifulsoup4 4.11.1 binaryornot 0.4.4 black 22.10.0 bleach 5.0.1 cachetools 5.2.0 certifi 2022.9.24 cffi 1.15.1 chardet 5.1.0 charset-normalizer 2.1.1 click 8.1.3 cloudpickle 2.2.0 configparser 5.3.0 contourpy 1.0.6 cookiecutter 2.1.1 cryptography 38.0.4 cycler 0.11.0 Cython 0.29.32 debugpy 1.6.4 decorator 5.1.1 defusedxml 0.7.1 diff-match-patch 20200713 dill 0.3.6 distlib 0.3.6 docstring-to-markdown 0.11 docutils 0.17.1 entrypoints 0.4 et-xmlfile 1.1.0 exceptiongroup 1.0.4 fastjsonschema 2.16.2 feedparser 6.0.10 filelock 3.8.2 flake8 5.0.4 flatbuffers 22.11.23 fonttools 4.38.0 frozenlist 1.3.3 funcsigs 1.0.2 gast 0.4.0 geomdl 5.3.1 ghp-import 2.1.0 google-api-core 2.11.0 google-api-python-client 2.68.0 google-auth 2.15.0 google-auth-httplib2 0.1.0 google-auth-oauthlib 0.4.6 google-pasta 0.2.0 googleapis-common-protos 1.57.0 grpcio 1.51.1 h11 0.14.0 h5py 3.7.0 html2text 2020.1.16 httplib2 0.21.0 hypothesis 6.60.0 idna 3.4 imageio 2.22.4 imagesize 1.4.1 importlib-metadata 5.1.0 inflection 0.5.1 iniconfig 1.1.1 intervaltree 3.1.0 ipykernel 6.17.1 ipython 7.34.0 ipython-genutils 0.2.0 isort 5.10.1 jaraco.classes 3.2.3 jdcal 1.4.1 jedi 0.18.2 jeepney 0.8.0 jellyfish 0.9.0 Jinja2 3.1.2 jinja2-time 0.2.0 joblib 1.2.0 json5 0.9.10 jsonschema 4.17.3 jupyter_client 7.4.8 jupyter_core 5.1.0 jupyter-server 1.23.3 jupyterlab 3.5.1 jupyterlab-pygments 0.2.2 jupyterlab_server 2.16.3 keras 2.11.0 keyring 23.11.0 kiwisolver 1.4.4 lazy-object-proxy 1.8.0 libclang 14.0.6 livereload 2.6.3 logilab-common 1.9.7 lxml 4.9.1 Markdown 3.3.7 MarkupSafe 2.1.1 matplotlib 3.6.2 matplotlib-inline 0.1.6 mccabe 0.7.0 mergedeep 1.3.4 mistune 2.0.4 mkdocs 1.4.2 mock 4.0.3 more-itertools 9.0.0 mpmath 1.2.1 multidict 6.0.3 mypy 0.991 mypy-extensions 0.4.3 nbclassic 0.4.8 nbclient 0.7.2 nbconvert 7.2.6 nbformat 5.7.0 nest-asyncio 1.5.6 nose 1.3.7 notebook 6.5.2 notebook_shim 0.2.2 npTDMS 1.6.0 numpy 1.23.5 numpydoc 1.5.0 oauthlib 3.2.2 olefile 0.46 openpyxl 3.0.10 opt-einsum 3.3.0 outcome 1.2.0 packaging 21.3 pandas 1.5.2 pandocfilters 1.5.0 parso 0.8.3 pathspec 0.10.2 pbr 5.11.0 pep8 1.7.1 pexpect 4.8.0 pickleshare 0.7.5 Pillow 9.3.0 pip 22.3.1 platformdirs 2.5.4 pluggy 1.0.0 ply 3.11 Pmw 2.1.1 pooch 1.6.0 posix-ipc 1.1.0 prometheus-client 0.15.0 prompt-toolkit 3.0.36 protobuf 3.19.6 protoc-gen-swagger 0.1.0 psutil 5.9.4 ptyprocess 0.7.0 pyasn1 0.4.8 pyasn1-modules 0.2.8 pycodestyle 2.9.1 pycparser 2.21 pydocstyle 6.1.1 pyflakes 2.5.0 Pygments 2.13.0 pyiges 0.2.1 pylint 2.15.8 pylint-venv 2.3.0 pyls-spyder 0.4.0 pyodbc 4.0.35 Pyomo 6.4.3 pyparsing 3.0.9 PyQt5 5.15.7 PyQt5-Qt5 5.15.2 PyQt5-sip 12.11.0 PyQtWebEngine 5.15.6 PyQtWebEngine-Qt5 5.15.2 pyrsistent 0.19.2 PySocks 1.7.1 pytest 7.2.0 pytest-runner 6.0.0 python-dateutil 2.8.2 python-lsp-black 1.2.1 python-lsp-jsonrpc 1.0.0 python-lsp-server 1.6.0 python-pptx 0.6.21 python-slugify 7.0.0 pytoolconfig 1.2.2 pytz 2022.6 pyvista 0.37.0 pyxdg 0.28 PyYAML 6.0 pyyaml_env_tag 0.1 pyzmq 24.0.1 QDarkStyle 3.0.3 qstylizer 0.2.2 QtAwesome 1.2.1 qtconsole 5.4.0 QtPy 2.3.0 requests 2.28.1 requests-oauthlib 1.3.1 rope 1.5.1 rsa 4.9 rss2email 3.14 Rtree 1.0.1 scikit-learn 1.1.3 scipy 1.9.3 scooby 0.7.0 SecretStorage 3.3.3 selenium 4.7.2 Send2Trash 1.8.0 setuptools 65.6.3 sgmllib3k 1.0.0 six 1.16.0 sniffio 1.3.0 snowballstemmer 2.2.0 sortedcontainers 2.4.0 soupsieve 2.3.2.post1 Sphinx 5.3.0 sphinx-rtd-theme 1.1.1 sphinxcontrib-applehelp 1.0.2 sphinxcontrib-devhelp 1.0.2 sphinxcontrib-htmlhelp 2.0.0 sphinxcontrib-jsmath 1.0.1 sphinxcontrib-qthelp 1.0.3 sphinxcontrib-serializinghtml 1.1.5 spyder 5.4.0 spyder-kernels 2.4.0 sympy 1.11.1 tensorboard 2.11.0 tensorboard-data-server 0.6.1 tensorboard-plugin-wit 1.8.1 tensorflow 2.11.0 tensorflow-estimator 2.11.0 tensorflow-io-gcs-filesystem 0.28.0 termcolor 2.1.1 terminado 0.17.1 text-unidecode 1.3 textdistance 4.5.0 threadpoolctl 3.1.0 three-merge 0.1.1 tinycss2 1.2.1 toml 0.10.2 tomli 2.0.1 tomlkit 0.11.6 tornado 6.2 tqdm 4.64.1 traitlets 5.6.0 trio 0.22.0 trio-websocket 0.9.2 typed-ast 1.5.4 typing_extensions 4.4.0 ujson 5.6.0 uritemplate 4.1.1 urllib3 1.26.13 virtualenv 20.17.1 vtk 9.2.2 watchdog 2.2.0 wcwidth 0.2.5 webencodings 0.5.1 websocket-client 1.4.2 Werkzeug 2.2.2 whatthepatch 1.0.3 wheel 0.38.4 wrapt 1.14.1 wslink 1.9.1 wsproto 1.2.0 wurlitzer 3.0.3 xlrd 2.0.1 XlsxWriter 3.0.3 yapf 0.32.0 yarl 1.8.2 zipp 3.11.0

PProfizi commented 1 year ago

Hi @ayush-kumar-423, would it be possible to have to whole list of installed packages? With pip list. This is most likely an incompatibility issue. I was not able to reproduce for Ansys 221 on a Linux machine with Python 3.10 and the package versions as listed in the picture.

>>> server = dpf.start_local_server(config=dpf.AvailableServerConfigs.LegacyGrpcServer, ansys_path=r"/XXX/v221")
>>> server.ip
'127.0.0.1'
>>> server.version
'3.0'
>>> server.shutdown()
Killed

Would it also be possible to test if the problem persists with ansys-dpf-core==0.7.2?

ayush-kumar-423 commented 1 year ago

Hi @PProfizi, I have updated the packages list in the description. I have asked customer if it is possible to test with 23R1.