gpt4 book ai didi

python - 让 gmsh 进入 virtualenv

转载 作者:太空宇宙 更新时间:2023-11-03 21:31:58 48 4
gpt4 key购买 nike

我对 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 粘贴到该目录中?

最佳答案

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

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

这意味着它需要 %PATH% 中的某个位置 gmsh.exe。因此,安装 gmsh 并将包含 gmsh.exe 的目录添加到 %PATH% 中。

关于python - 让 gmsh 进入 virtualenv,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53466027/

48 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com