【问题标题】:getting gmsh into the virtualenv让 gmsh 进入 virtualenv
【发布时间】:2018-11-25 09:00:51
【问题描述】:

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

【问题讨论】:

    标签: python pycharm virtualenv


    【解决方案1】:

    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%

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-04-15
      • 2017-07-28
      • 1970-01-01
      • 2019-08-19
      • 1970-01-01
      • 2018-05-25
      相关资源
      最近更新 更多