Skip to content
New issue

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

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

Already on GitHub? # to your account

AttributeError: 'Mdb' object has no attribute 'ModelFromInputFile' #5954

Closed
altaflone opened this issue Jan 27, 2025 · 8 comments · Fixed by #5955
Closed

AttributeError: 'Mdb' object has no attribute 'ModelFromInputFile' #5954

altaflone opened this issue Jan 27, 2025 · 8 comments · Fixed by #5955
Assignees
Labels
bug Something isn't working

Comments

@altaflone
Copy link

The error i am getting while executing the preprocessor.py file from the https://github.com/RitioL/PolyFatigueCrackSim?tab=readme-ov-file#introduction repository is attached below.

kindly help with resolving the issue.

runfile('C:/PolyFatigueCrackSim-main/simulation_utils/preprocessor.py', wdir='C:/PolyFatigueCrackSim-main/simulation_utils')
Traceback (most recent call last):

File ~\anaconda3\Lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec
exec(code, globals, locals)

File c:\polyfatiguecracksim-main\simulation_utils\preprocessor.py:182
main(wp_path, model_name)

File c:\polyfatiguecracksim-main\simulation_utils\preprocessor.py:41 in main
mdb.ModelFromInputFile(name=modelName, inputFileName=inputFileName)

AttributeError: 'Mdb' object has no attribute 'ModelFromInputFile'

Image

@haiiliin haiiliin added the bug Something isn't working label Jan 27, 2025
@haiiliin
Copy link
Owner

This is a bug, ModelFromInputFile should be a method of Mdb instead of Model

@haiiliin
Copy link
Owner

By the way, it seems that you are trying to run the script with your own python interpreter instead of abaqus python environment. You should run the script with the abaqus python environment.

@altaflone
Copy link
Author

Thank You for your response.

is their any way to fix this bug?

aslo, when i try to run this file using "run script" in ABAQUS CAE Environment, i get the following error.

Image

Kindly help resolve this issue. stuck on this thing since long.

Regards

altaf

@haiiliin haiiliin self-assigned this Jan 27, 2025
@haiiliin
Copy link
Owner

How about removing numThreadsPerMpiProcess keyword argument?

@haiiliin
Copy link
Owner

Seems that multiprocessingMode is not an argument of Mdb.Job method

@haiiliin
Copy link
Owner

haiiliin commented Jan 27, 2025

is their any way to fix this bug?

Can you try to run the script with PyCharm or VSCode instead of Spyder?

@altaflone
Copy link
Author

I deleted the line " numThreadsPerMpiProcess".
That did it in the ABAQUS CAE environment.
Thank You for your guidance.

"Can you try to run the script with PyCharm or VSCode"
i will try to install PyCharm and try to run the script again.

Thank You

altaf

@altaflone
Copy link
Author

altaflone commented Jan 27, 2025 via email

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants