_winapi.CreateProcess PermissionErro

sixin.huang
sixin.huang Member Posts: 2
First Comment
**

Hello ;)
I try to use a bat file to run pyFluent code, but have a problem:

1、bat:
pushd %~dp0

set PYTHON_EXEC="C:\Anaconda311\python.exe"
set EMCCFD_PACKAGE_DIR="\file-sh04\hpc\UAES\00.SPDM\122.ModuleCFD"

%PYTHON_EXEC% -c "import sys;sys.path.append(r'%EMCCFD_PACKAGE_DIR%');from modulecfd.pyFluent_macro import post_processing,create_report;post_processing(r'%cd%');create_report(r'%cd%')"
set RETURN_CODE=%errorlevel%

popd
pause
exit /b %RETURN_CODE%

2、pyFluent code:
def post_processing(working_dir):
solver = pyfluent.launch_fluent(
product_version="23.2.0",
precision="double",
processor_count=1,
mode="solver",
cleanup_on_exit=True,
show_gui=False,
additional_arguments='-post'
)

3、Error message:
C:\Anaconda311\Lib\site-packages\paramiko\transport.py:219: CryptographyDeprecationWarning: Blowfish has been deprecated and will be removed in a future release
"class": algorithms.Blowfish,
pyfluent.launcher ERROR: Exception caught - PermissionError: [WinError 5] 拒绝访问。
Traceback (most recent call last):
File "C:\Anaconda311\Lib\site-packages\ansys\fluent\core\launcher\standalone_launcher.py", line 251, in call
watchdog.launch(os.getpid(), port, password, ip)
File "C:\Anaconda311\Lib\site-packages\ansys\fluent\core\launcher\watchdog.py", line 159, in launch
subprocess.Popen(cmd_send, **kwargs)
File "C:\Anaconda311\Lib\subprocess.py", line 1026, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Anaconda311\Lib\subprocess.py", line 1538, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [WinError 5] 拒绝访问。

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "", line 1, in
File "\file-sh04\hpc\UAES\00.SPDM\122.ModuleCFD\modulecfd\pyFluent_macro.py", line 253, in post_processing
solver = pyfluent.launch_fluent(
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Anaconda311\Lib\site-packages\ansys\fluent\core\launcher\launcher.py", line 237, in launch_fluent
return launcher()
^^^^^^^^^^
File "C:\Anaconda311\Lib\site-packages\ansys\fluent\core\launcher\standalone_launcher.py", line 276, in call
raise LaunchFluentError(launch_cmd) from ex
ansys.fluent.core.launcher.launcher_utils.LaunchFluentError:
Fluent Launch string: start "" "C:\Program Files\ANSYS Inc\v232\fluent\ntbin\win64\fluent.exe" 3ddp -post -sifile=C:\Users\CAE~1.PUB\AppData\Local\Temp\serverinfo-5a8rfg0m.txt -nm -hidden

Tagged:

Answers

  • sixin.huang
    sixin.huang Member Posts: 2
    First Comment
    **

    Can you give me some information that may cause this problem? Thanks in advance

  • Mainak
    Mainak Member, Employee Posts: 5
    First Comment Ansys Employee First Anniversary
    ✭✭✭

    Can you please try with:

    solver = pyfluent.launch_fluent(
    product_version="23.2.0",
    precision="double",
    processor_count=1,
    mode="solver",
    cleanup_on_exit=True,
    show_gui=False,
    additional_arguments='-post',
    start_watchdog=False
    )