You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

Python无法找到Colomoto工具箱中的ginsim与biolqm包的问题求助

Python无法找到Colomoto工具箱中的ginsim与biolqm包的问题求助

我最近在做一个项目,用到了Colomoto工具箱里的几个核心包,但运行代码时Python一直报错找不到相关文件,折腾了好久都没解决。以下是我的详细情况:

项目代码

import ginsim
import biolqm
import maboss
import pypint
import numpy as np
import pandas as pd # for the visualization of lists of states
from colomoto_jupyter import tabulate # for fixpoint table display
from itertools import combinations  # for iterating over sets
import matplotlib.pyplot as plt # for modifying plots

报错信息

运行后直接触发FileNotFoundError,具体栈信息如下:

FileNotFoundError                         Traceback (most recent call last)
Cell In[1], line 1
----> 1 import ginsim
      2 import biolqm
      3 import maboss

File E:\project\bioenv\lib\site-packages\ginsim\__init__.py:6
      3 import re
      4 import sys
----> 6 import biolqm
      8 from colomoto_jupyter import *
      9 from colomoto_jupyter.sessionfiles import new_output_file

File E:\project\bioenv\lib\site-packages\biolqm\__init__.py:13
     10 import pandas as pd
     11 import numpy as np
---> 13 from ginsim.gateway import japi, restart
     14 from ginsim.state import *
     16 from py4j.java_gateway import JavaObject

File E:\project\bioenv\lib\site-packages\ginsim\gateway.py:61
     58     if __env:
     59         module._japi_start()
---> 61 start()
     62 atexit.register(stop)

File E:\project\bioenv\lib\site-packages\ginsim\gateway.py:26, in start()
     24 def start():
     25     assert (not __env)
---> 26     __env["proc"] = subprocess.Popen(["GINsim", "-py"], \
     27                         stdout=PIPE, stdin=PIPE, stderr=PIPE)
     28     port = int(__env["proc"].stdout.readline().strip())
     30     # start the gateway and return the entry point (GINsim's ScriptLauncher)

File E:\project\bioenv\lib\subprocess.py:858, in Popen.__init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors, text)
    854         if self.text_mode:
    855             self.stderr = io.TextIOWrapper(self.stderr,
    856                     encoding=encoding, errors=errors)
---> 858     self._execute_child(args, executable, preexec_fn, close_fds,
    859                         pass_fds, cwd, env,
    860                         startupinfo, creationflags, shell,
    861                         p2cread, p2cwrite,
    862                         c2pread, c2pwrite,
    863                         errread, errwrite,
    864                         restore_signals, start_new_session)
    865 except:
    866     # Cleanup if the child failed starting.
    867     for f in filter(None, (self.stdin, self.stdout, self.stderr)):

File E:\project\bioenv\lib\subprocess.py:1327, in Popen._execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, unused_restore_signals, unused_start_new_session)
   1325 # Start the process
   1326 try:
-> 1327     hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
   1328                              # no special security
   1329                              None, None,
   1330                              int(not close_fds),
   1331                              creationflags,
   1332                              env,
   1333                              cwd,
   1334                              startupinfo)
   1335 finally:
   1336     # Child is launched. Close the parent's copy of those pipe
   1337     # handles that only the child should have open.  You need
   (...)
   1340     # pipe will not close when the child process exits and the
   1341     # ReadFile will hang.
   1342     self._close_pipe_fds(p2cread, p2cwrite,
   1343                          c2pread, c2pwrite,
   1344                          errread, errwrite)

FileNotFoundError: [WinError 2] The system cannot find the file specified

已尝试的解决方法

我已经试过下面两种方案,但都没解决问题:

  • 按照之前的建议,在Miniconda中创建了名为bioenv的虚拟环境,用ipykernel将其配置为Jupyter的内核,并且在该环境中完整安装了所需包,安装命令如下:
    conda install -c colomoto -c bioconda -c conda-forge -c potassco ginsim-python
    
  • 参考ChatGPT的提示修改了系统PATH环境变量,但没有任何效果。另外,我从官网下载的GINsim独立.jar文件是可以正常运行的。

现在完全摸不着头脑,有没有大佬能帮我分析下问题出在哪,或者给个可行的修复方案?万分感谢!

备注:内容来源于stack exchange,提问作者Shishir Shreyas Nair

火山引擎 最新活动