ansys / pymechanical

Pythonic interface to Ansys Mechanical ā„¢
https://mechanical.docs.pyansys.com/
MIT License
36 stars 18 forks source link

Script works differently with python 3.8 and 3.10 #531

Closed rs-bh-n closed 2 months ago

rs-bh-n commented 9 months ago

šŸ” Before submitting the issue

šŸž Description of the bug

Attached zip file . (a) "01.py" is a Trace import script that runs fine with standalone 241 Mechanical on console or when passed on as script in batch mode (b) "02.py" is an equivalent pymech file that runs fine with 3.8 but not 3.10

šŸ“ Steps to reproduce

1) Standalone Mechanical - Gui Mode : runs fine a. Open standalone Mechanical 241 . b. Paste the script from 01_mech_script.py in the scripting console.

2) Standalone Mechanical - Batch Mode : runs fine a. Terminal>Activate venv b. launch standalone mechanical (pymech_test) D:\S\dec_bug_test> ansys-mechanical -r 241 -i D:\S\dec_bug_test**01_mech_script.py**

3) PyMechanical a. Terminal > Activate venv b. D:\S\dec_bug_test> python .**02_pymech.py** c. runs into this error

image

This is with Python 3.10.

However step3 with Python 3.8 works fine (i.e., trace import happens fine)

šŸ’» Which operating system are you using?

Windows

šŸ“€ Which ANSYS version are you using?

Ansys Mechanical 241

šŸ Which Python version are you using?

3.10

šŸ“¦ Installed packages

Package                               Version
------------------------------------- --------
ansys-api-mechanical                  0.1.1
ansys-api-platform-instancemanagement 1.0.0
ansys-mechanical-core                 0.10.4
ansys-platform-instancemanagement     1.1.2
ansys-pythonnet                       3.1.0rc3
ansys-tools-path                      0.4.0
appdirs                               1.4.4
cffi                                  1.16.0
click                                 8.1.7
clr-loader                            0.2.6
colorama                              0.4.6
grpcio                                1.60.0
importlib-metadata                    7.0.0
pip                                   21.1.1
platformdirs                          4.1.0
protobuf                              3.20.3
pycparser                             2.21
setuptools                            56.0.0
tqdm                                  4.66.1
zipp                                  3.17.0
rs-bh-n commented 9 months ago

38_310.zip The Files are here.

dipinknair commented 2 months ago

This bug is fixed with 24R2 Mechanical. This also has been added to known issues and limitation section. Ref : https://mechanical.docs.pyansys.com/version/stable/kil/mechanical.html#r1