Closed CollinsJnr-001 closed 5 months ago
@CollinsJnr-001 . Can you try running find-mechanical
from the after activating the same virtual env.
if you are not seeing the mechanical version and path that means ansys-tools-path
is unable to find Mechanical in default installation paths. you can use below cli commands from ansys-tools-path
to save mechanical path.
save-ansys-path --name mechanical <path to .workbench>
then you can run find-mechanical
and check the path is saved correctly.
alternatively find-mechanical directly ask you to the Ansys Mechanical (.workbench) path eg:
save-ansys-path --name mechanical "/user/ansys_inc/v232/aisol/.workbench"
find-mechanical
232 /user/ansys_inc/v232/aisol/.workbench
Let me know if this works.
@dipinknair
Thank you
save-ansys-path --name mechanical "/user/ansys_inc/v232/aisol/.workbench" find-mechanical 232 /user/ansys_inc/v232/aisol/.workbench
I found the file here.
@dipinknair
Thank you
save-ansys-path --name mechanical "/user/ansys_inc/v232/aisol/.workbench" find-mechanical 232 /user/ansys_inc/v232/aisol/.workbench
I found the file here.
@CollinsJnr-001 Did this work for you. Were you able to use mechanical-env python successfully ?
@dipinknair Thank you save-ansys-path --name mechanical "/user/ansys_inc/v232/aisol/.workbench" find-mechanical 232 /user/ansys_inc/v232/aisol/.workbench I found the file here.
@CollinsJnr-001 Did this work for you. Were you able to use mechanical-env python successfully ?
Yes it worked just fine I can run mechanical-env python successfully
Thank you for the help.
🔍 Before submitting the issue
Description of the error
I have installed pymechanical on the HPC python env I created using
python -m pip install ansys-mechanical-env
and when I try to run it
mechanical-env python
I get this error
Traceback (most recent call last): File "/.conda/envs/mynumpy/bin/find-mechanica", line 8, in
sys.exit(cli_find_mechanical())
File "/.conda/envs/mynumpy/lib/python3.8/site-packages/click/c ore.py", line 1157, in call
return self.main(args, kwargs)
File "/.conda/envs/mynumpy/lib/python3.8/site-packages/click/c ore.py", line 1078, in main
rv = self.invoke(ctx)
File "/.conda/envs/mynumpy/lib/python3.8/site-packages/click/c ore.py", line 1434, in invoke
return ctx.invoke(self.callback, ctx.params)
File "/.conda/envs/mynumpy/lib/python3.8/site-packages/click/c ore.py", line 783, in invoke
return __callback(args, **kwargs)
File "/.conda/envs/mynumpy/lib/python3.8/site-packages/ansys/m echanical/env/run.py", line 58, in cli_find_mechanical
exe = atp.get_mechanical_path() # check for saved mechanical path
File "/.conda/envs/mynumpy/lib/python3.8/site-packages/ansys/t ools/path/path.py", line 1064, in get_mechanical_path
return _get_application_path("mechanical", allow_input, version, find)
File "/.conda/envs/mynumpy/lib/python3.8/site-packages/ansys/t ools/path/path.py", line 958, in _get_application_path
exe_loc = _read_executable_path_from_config_file(product)
File "/.conda/envs/mynumpy/lib/python3.8/site-packages/ansys/t ools/path/path.py", line 947, in _read_executable_path_from_config_file
config_data = _read_config_file()
File "/.conda/envs/mynumpy/lib/python3.8/site-packages/ansys/t ools/path/path.py", line 849, in _read_config_file
_migrate_config_file()
File "/.conda/envs/mynumpy/lib/python3.8/site-packages/ansys/t ools/path/path.py", line 903, in _migrate_config_file
class FileMigrationStrategy:
File "/.conda/envs/mynumpy/lib/python3.8/site-packages/ansys/t ools/path/path.py", line 904, in FileMigrationStrategy
paths: list[str]
TypeError: 'type' object is not subscriptable
Error running the find-mechanical.
📝 Steps to reproduce
python -m pip install ansys-mechanical-env
mechanical-env python
💻 Which operating system are you using?
Windows
📀 Which ANSYS version are you using?
v232
🐍 Which Python version are you using?
3.8
📦 Installed packages