Anaconda:系统找不到文件(Molpx 库)

Anaconda: The system cannot find the file (Molpx library)

提问人:Ludovica Aisa 提问时间:11/14/2023 更新时间:11/14/2023 访问量:19

问:

我正在尝试在 Anaconda 环境的 Jupyter Notebook 中使用 molmpx。我直接在笔记本上安装了pip并重新启动了内核,但后来我收到了这个错误。

FileNotFoundError                         Traceback (most recent call last)
Cell In[12], line 1
----> 1 import molpx
      2 import warnings
      3 get_ipython().run_line_magic('matplotlib', 'ipympl')

File ~\anaconda3\envs\santiago\Lib\site-packages\molpx\__init__.py:162
    159     return True
    161 # Try to help the user getting molpx working out of the box and raise an Exception if molpx wont work
--> 162 if not all(_get_extension_status().values()):
    163     for _ext, _enabled in _get_extension_status().items():
    164         if not _enabled:

File ~\anaconda3\envs\santiago\Lib\site-packages\molpx\__init__.py:119, in _get_extension_status(ext_list)
    111 r"""
    112 Guess the status of the extensions in ext_list. the correct way of doing this
    113 would be using notebook.nbextensions, but you need paths to the extensions
    114 and I dont want to go there
    115 :return: dictionary with extensions in ext_list as keys and True or False as values
    116 """
    117 enabled_exts = {key:None for key in ext_list}
--> 119 lines = _subprocess.check_output(("jupyter-nbextension", "list"), stderr=_subprocess.DEVNULL)
    120 for ext in enabled_exts.keys():
    121     for iline in lines.decode().splitlines():

File ~\anaconda3\envs\santiago\Lib\subprocess.py:466, in check_output(timeout, *popenargs, **kwargs)
    463         empty = b''
    464     kwargs['input'] = empty
--> 466 return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
    467            **kwargs).stdout

File ~\anaconda3\envs\santiago\Lib\subprocess.py:548, in run(input, capture_output, timeout, check, *popenargs, **kwargs)
    545     kwargs['stdout'] = PIPE
    546     kwargs['stderr'] = PIPE
--> 548 with Popen(*popenargs, **kwargs) as process:
    549     try:
    550         stdout, stderr = process.communicate(input, timeout=timeout)

File ~\anaconda3\envs\santiago\Lib\subprocess.py:1026, 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, user, group, extra_groups, encoding, errors, text, umask, pipesize, process_group)
   1022         if self.text_mode:
   1023             self.stderr = io.TextIOWrapper(self.stderr,
   1024                     encoding=encoding, errors=errors)
-> 1026     self._execute_child(args, executable, preexec_fn, close_fds,
   1027                         pass_fds, cwd, env,
   1028                         startupinfo, creationflags, shell,
   1029                         p2cread, p2cwrite,
   1030                         c2pread, c2pwrite,
   1031                         errread, errwrite,
   1032                         restore_signals,
   1033                         gid, gids, uid, umask,
   1034                         start_new_session, process_group)
   1035 except:
   1036     # Cleanup if the child failed starting.
   1037     for f in filter(None, (self.stdin, self.stdout, self.stderr)):

File ~\anaconda3\envs\santiago\Lib\subprocess.py:1538, 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_gid, unused_gids, unused_uid, unused_umask, unused_start_new_session, unused_process_group)
   1536 # Start the process
   1537 try:
-> 1538     hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
   1539                              # no special security
   1540                              None, None,
   1541                              int(not close_fds),
   1542                              creationflags,
   1543                              env,
   1544                              cwd,
   1545                              startupinfo)
   1546 finally:
   1547     # Child is launched. Close the parent's copy of those pipe
   1548     # handles that only the child should have open.  You need
   (...)
   1551     # pipe will not close when the child process exits and the
   1552     # ReadFile will hang.
   1553     self._close_pipe_fds(p2cread, p2cwrite,
   1554                          c2pread, c2pwrite,
   1555                          errread, errwrite)

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

我通过 ipympl 安装,因为我读到这可能在某种程度上相关,但绝对不是。 有人可以帮我解决这个问题吗?我真的不知道如何处理它。conda

Python Anaconda Jupyter IPYMPL

评论

1赞 Wayne 11/15/2023
假设你说,“我直接在笔记本上安装了pip”,你似乎在混合和匹配。这是灾难的根源。安装 Anaconda 时,您选择了它作为包管理器。从现在开始坚持下去。例外情况是没有 Anaconda 食谱的情况。这里明确建议您使用 Anaconda/conda 安装 molPX 以及下面的下一节,强烈建议不要使用它以及故障排除链接。您是否已经进行了故障排除?pip
0赞 Ludovica Aisa 11/17/2023
@Wayne所以我尝试通过conda安装molpx。它已经完成了安装,但是当我尝试在Jupyter Notebook中导入它时,它给了我相同的错误消息:系统找不到指定的文件
0赞 Wayne 11/17/2023
哦等等。我想你现在在这里打多场仗。我在回溯中看到提到,这让我对所涉及的 Jupyter 版本产生了疑问。可悲的是,您没有提供任何细节,这意味着在这一点上,很多只是想法。我怀疑任何涉及的内容都仅适用于 Jupyter Notebook 6.4 及更早版本或当前的 NbClassic。如果其中一些听起来像是外国概念,请在此处查看我的回答,以获取有关当前发生的巨大变化的一些信息......jupyter-nbextensionjupyter-nbextension
0赞 Wayne 11/17/2023
<续>最近在Jupyter生态系统中。然而,这可能是一场艰苦的战斗。我认为你应该注意这里关于有人尝试你现在正在尝试的评论:“当前的 matplotlib/mpl 包可能太现代了,或者 molpx 太过时了。我应该早点注意到,但看起来你在这里处于废弃软件的领域。您可以在此处看到该软件的最后一次更新是五年前。那真的是很长一段时间......
0赞 Wayne 11/17/2023
<续>在发展方面。从安装说明来看,即使在当时,它似乎也是一个困难的安装。您确定这是现在在 Jupyter 中执行此操作的最佳软件吗?看起来在 cpptraj 的 Python 接口上,当前有引用 Jupyter 的开发。也许环顾四周或发布一个问题寻求指导?

答: 暂无答案