ansys / pymapdl

Pythonic interface to MAPDL
https://mapdl.docs.pyansys.com
MIT License
423 stars 120 forks source link

pymapdl installation verification not possible #1068

Closed herttim closed 2 years ago

herttim commented 2 years ago

By starting MAPDL from Python by running the following prompt, a Value Error in Python appears.

from ansys.mapdl.core import launch_mapdl
mapdl = launch_mapdl()

Steps to reproduce the behavior:

  1. Install pyansys with pip install ansys.mapdl.core in anaconda prompt (Anaconda3)
  2. Go to Spyder Python and type the prompt from ansys.mapdl.core import launch_mapdl mapdl = launch_mapdl()
  3. See error

Appeared error:

Traceback (most recent call last):

  File "C:\Users\...\.spyder-py3\untitled2.py", line 8, in <module>
    from ansys.mapdl.core import launch_mapdl

  File "C:\Users\...\Anaconda\lib\site-packages\ansys\mapdl\core\__init__.py", line 26, in <module>
    from ansys.mapdl.core.launcher import (

  File "C:\Users\...\Anaconda\lib\site-packages\ansys\mapdl\core\launcher.py", line 19, in <module>
    from ansys.mapdl.core.mapdl import _MapdlCore

  File "C:\Users\...\Anaconda\lib\site-packages\ansys\mapdl\core\mapdl.py", line 16, in <module>
    from ansys.mapdl.reader.rst import Result

  File "C:\Users\...\Anaconda\lib\site-packages\ansys\mapdl\reader\__init__.py", line 8, in <module>
    from ansys.mapdl.reader.archive import (Archive, write_cmblock, write_nblock,

  File "C:\Users\...\Anaconda\lib\site-packages\ansys\mapdl\reader\archive.py", line 20, in <module>
    from ansys.mapdl.reader import _reader, _archive

  File "ansys\mapdl\reader\cython\_reader.pyx", line 1, in init ansys.mapdl.reader._reader

**ValueError:** numpy.ndarray size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

System Information:

Thank´s for helping!

germa89 commented 2 years ago

Hi @herttim

Could you try to update numpy is:

pip install --upgrade numpy

Ref: https://stackoverflow.com/questions/66060487/valueerror-numpy-ndarray-size-changed-may-indicate-binary-incompatibility-exp

herttim commented 2 years ago

Updating numpy worked for me. Now numpy is running on 1.22.3. Product: ANSYS Mechanical Enterprise Solver MAPDL Version: 20.2 ansys.mapdl Version: 0.61.3 Maybe an automatic update or match of different numpy versions could be useful while downloading for future.

Thank´s for your help! :)

germa89 commented 2 years ago

I'm happy it helps! We will review our numpy requirements. Thank you!