openseespy lacks .dll files such as tcl86t.dll

Purpose: Download one from the openseespy official website

  1. Elastic Truss Analysis

Case list, want to test

Operating environment:

python   3.8.16

openseespy             3.3.0.1.1
openseespywin          3.3.0.1

Problem: At runtime, the following error occurs

Traceback (most recent call last):
  File "C:\ProgramData\Miniconda3\envs\lib\site-packages\openseespy\opensees\__init__.py", line 19, in <module>
    from openseespywin.opensees import *
  File "C:\ProgramData\Miniconda3\envs\lib\site-packages\openseespywin\__init__.py", line 17, in <module>
    ctypes.cdll.LoadLibrary(dll_path + '\\tcl86t.dll')
  File "C:\ProgramData\Miniconda3\envs\lib\ctypes\__init__.py", line 451, in LoadLibrary
    return self._dlltype(name)
  File "C:\ProgramData\Miniconda3\envs\lib\ctypes\__init__.py", line 373, in __init__
    self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'C:\ProgramData\Miniconda3\envs\DLLs\tcl86t.dll' (or one of its dependencies). Try using the full path with constructor syntax.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:/ElasticTruss.py", line 1, in <module>
    from openseespy.opensees import *
  File "C:\ProgramData\Miniconda3\envs\lib\site-packages\openseespy\opensees\__init__.py", line 22, in <module>
    raise RuntimeError('Failed to import openseespy on Windows.')
RuntimeError: Failed to import openseespy on Windows.

It can be found that the error is reported because openseespy did not find the tcl86t.dll file, and then it prompts that it cannot import openseespy in windows.

Solution: In the current environment, run the following code to find the tcl86t.dll in the local environment.

from ctypes.util import find_library
theDll = find_library('TCL86T')
print(theDll)

Method 1: Copy the found local .dll file to the folder indicated in the error code, the blogger here is C:\ProgramData\Miniconda3\envs\DLLs

Method 2: Add the path of the local .dll file to the system environment variable.

Of course, the above code can be used to find missing .dll files, not limited to tcl86t.dll.

References: Fail to start · Issue #63 · zhuminjie/OpenSeesPyDoc · GitHub

おすすめ

転載: blog.csdn.net/TTritium/article/details/131225645