Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting an error while launching PyMAPDL using latest version 0.68.1 and Python v3.12.0. #2979

Open
4 tasks done
vnamdeo opened this issue Apr 5, 2024 · 13 comments
Open
4 tasks done
Assignees
Labels
BUG Issue, problem or error in PyMAPDL

Comments

@vnamdeo
Copy link
Contributor

vnamdeo commented Apr 5, 2024

🤓 Before submitting the issue

🔍 Description of the bug

Getting an error while launching PyMAPDL using latest version 0.68.1 and Python v3.12.0. Please refer attached image to see the error message and pip list.
Screenshot 2024-04-04 223632
Screenshot 2024-04-04 223237

🕵️ Steps To Reproduce

The log will automatically be formatted as Python code! No need to type backticks.

💻 Which Operating System are you using?

Windows

🐍 Which Python version are you using?

3.12

📝 PyMAPDL Report

Show the Report!

# PASTE HERE THE OUTPUT OF `python -c "from ansys.mapdl import core as pymapdl; print(pymapdl.Report())"` here

📝 Installed packages

Show the installed packages!

# PASTE HERE THE OUTPUT OF `python -m pip freeze` here

📝 Logger output file

Show the logger output file.

# PASTE HERE THE CONTENT OF THE LOGGER OUTPUT FILE.

@vnamdeo vnamdeo added the BUG Issue, problem or error in PyMAPDL label Apr 5, 2024
@clatapie
Copy link
Contributor

clatapie commented Apr 5, 2024

Hi @vnamdeo, thank you for opening this issue!

I launched PyMAPDL on my local machine with the following parameters:

  • OS: Windows 10
  • MAPDL Version: 23.1
  • Python version: 3.12.2
  • ansys-mapdl-core: 0.68.1

It seems to work fine on my side. Could you add the PyMAPDL report in your issue please? It might help me to understand what's happening.

Here is what I obtained when launching PyMAPDL:

>>> mapdl = launch_mapdl()
>>> print(mapdl)
Product:             Ansys Mechanical Enterprise
MAPDL Version:       23.1
ansys.mapdl Version: 0.68.1

@vnamdeo
Copy link
Contributor Author

vnamdeo commented Apr 5, 2024

@clatapie : Please find attached report for the further investigations.
Screenshot 2024-04-05 205926
Screenshot 2024-04-05 205959

@vnamdeo
Copy link
Contributor Author

vnamdeo commented Apr 5, 2024

@clatapie Please find attached report using PyMAPDL version 0.68.1,
Screenshot 2024-04-05 210857

@vnamdeo
Copy link
Contributor Author

vnamdeo commented Apr 8, 2024

@clatapie Based on further investigations, it appears that, we are getting errors when we launch mapdl using default options, e.g.

mapdl = launch_mapdl() --> getting errors as reported initially.

However, we able to launch mapdl successfully, if we specify the version, e.g.

mapdl = launch_mapdl(version = 24.1) or mapdl = launch_mapdl(version = 241) --> working as expected.

@germa89
Copy link
Collaborator

germa89 commented Apr 8, 2024

Hi @vnamdeo

I think there is a problem with either your envvars, or which one of your versions.

Please follow the steps given in https://mapdl.docs.pyansys.com/version/stable/user_guide/troubleshoot.html#debug-in-pymapdl and post here the log file (mylog.log). That file will tell you which command is trying to execute, and then we can try that in a terminal.

@vnamdeo
Copy link
Contributor Author

vnamdeo commented Apr 8, 2024

Hi @germa89 , Followed steps as mentioned in the Troubleshooting help doc, but, it couldn't save log file. However, please refer to the attached image for the further debug.
error

When we add version = 24.1, we able to launch PyMAPDL with no errors, please refer to the attached image for reference.
1

2

@germa89
Copy link
Collaborator

germa89 commented Apr 8, 2024

@vnamdeo

Can you try in a terminal:

"C:\Program Files\ANSYS Inc\v231\ansys\bin\winx64\ansys231.exe" -j file -np 2 -b __tmp__.inp -o __tmp__.out -port 50052 -grpc

and put the output here?

@vnamdeo
Copy link
Contributor Author

vnamdeo commented Apr 8, 2024

@germa89 Is the default MAPDL version is v231 on launch_mapdl( ) ?

If we execute above line in a terminal, the output is,
"The system cannot find the path specified. "

@germa89
Copy link
Collaborator

germa89 commented Apr 8, 2024

I realise you are trying to launch MAPDL 231, but you do not have it installed.

Maybe you had it installed and uninstalled it. But the config.txt still has it.

You can check this file by doing in python:

>>> from ansys.tools.path.path import CONFIG_FILE
>>> print(CONFIG_FILE)
/Users/user/Library/Application Support/ansys_tools_path/config.txt

to change this, the best is either delete that file, or:

>>> from ansys.tools.path import change_default_mapdl_path, get_mapdl_path
>>> change_default_mapdl_path('C:\Program Files\ANSYS Inc\v231\ansys\bin\winx64\ansys231.exe')
>>> get_mapdl_path()
C:\Program Files\ANSYS Inc\v231\ansys\bin\winx64\ansys231.exe

@vnamdeo
Copy link
Contributor Author

vnamdeo commented Apr 8, 2024

@germa89 In the first place, why launch_mapdl() usage Ansys v231 to launch. What is the default version is ?

@germa89
Copy link
Collaborator

germa89 commented Apr 8, 2024

whatever is written in the CONFIG_FILE.

This file is created the first time you run PyMAPDL EVER in a PC.

@vnamdeo
Copy link
Contributor Author

vnamdeo commented Apr 8, 2024

@germa89 Earlier, I am not getting such errors and using PyMAPDL from long time. Recently, I migrated to newer PyMAPDL version and new Python interpreter since then I am observing such issues. Ideally, we should set some default version "latest mapdl version" on version option of launch_mapdl () function to invoke rather grab it from the CONFIG_FILE, which is not ideal approach as you have observed it. Thanks !

@germa89
Copy link
Collaborator

germa89 commented Apr 8, 2024

You are right. I acknowledge there are some corners to polish. PyMAPDL should probably re-detect MAPDL if the file cannot be found.

I will look into that. I'm keeping this issue open for future fix.

In the meantime, please delete CONFIG.txt file, it should work OK after that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG Issue, problem or error in PyMAPDL
Projects
None yet
Development

No branches or pull requests

3 participants