让gmsh进入虚拟世界

2024-05-18 23:32:51 发布

您现在位置:Python中文网/ 问答频道 /正文

我对Python非常陌生,如果这是一个愚蠢的问题,我很抱歉。总之,我在尝试运行我安装在PyCharm(Python IDE)上的包时遇到了这个错误:

Traceback (most recent call last):
  File "C:\Users\turtl\PycharmProjects\untitled\venv\Scripts\openbte-script.py", line 11, in <module>
    load_entry_point('openbte==0.9.24', 'console_scripts', 'openbte')()
  File "C:\Users\turtl\PycharmProjects\untitled\venv\lib\site-packages\openbte\__main__.py", line 47, in main
    Geometry(**vars(args))
  File "C:\Users\turtl\PycharmProjects\untitled\venv\lib\site-packages\openbte\geometry.py", line 83, in __init__
    data = self.compute_mesh_data()
  File "C:\Users\turtl\PycharmProjects\untitled\venv\lib\site-packages\openbte\geometry.py", line 91, in compute_mesh_data
    self.import_mesh()
  File "C:\Users\turtl\PycharmProjects\untitled\venv\lib\site-packages\openbte\geometry.py", line 448, in import_mesh
    a=subprocess.check_output(['gmsh','-' + str(self.dim),'mesh.geo','-o','mesh.msh'])
  File "C:\Users\turtl\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 336, in check_output
    **kwargs).stdout
  File "C:\Users\turtl\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 403, in run
    with Popen(*popenargs, **kwargs) as process:
  File "C:\Users\turtl\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 709, in __init__
    restore_signals, start_new_session)
  File "C:\Users\turtl\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 997, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

从我以前的问题中收集到的信息来看,这似乎是因为我的virtualenv中没有gmsh。既然我已经下载了gmsh,我就找不到一个合适的安装指南来指导如何将它安装到virtualenv中。有人有这方面的经验吗?你知道吗

我想更具体地说,有没有一种方法可以确定它试图访问的路径并将gmsh粘贴到该目录中?你知道吗


Tags: inpyvenvlibpackageslinesiteusers
1条回答
网友
1楼 · 发布于 2024-05-18 23:32:51

openbte\geometry.py似乎在没有任何路径的情况下运行gmsh.exe

a=subprocess.check_output(['gmsh','-' + str(self.dim),'mesh.geo','-o','mesh.msh'])

这意味着它期望gmsh.exe%PATH%的某个地方。所以安装gmsh,并将带有gmsh.exe的目录添加到%PATH%。你知道吗

相关问题 更多 >

    热门问题