1

我已经用 conda 安装了pyjnius。但是,当我尝试导入 pyjnius 它失败了

> from jnius import autoclass

File
 "C:\Users\OEM\Miniconda3\envs\example-env\lib\site-packages\jnius\__init__.py",
 line 12, in <module>
     from .jnius import *  # noqa ImportError: DLL load failed: The specified module could not be found.

与 pyjnius conda 一起安装 openjdk。接下来,pyjniusjvm.dll在其中一个PATH目录中查找。DLL 可以在

C:\Users\OEM\Miniconda3\pkgs\openjdk-11.0.1-1017\Library\bin\server

但 conda 不包含在PATH. 它添加了另一个文件夹PATH

C:\Users\OEM\Miniconda3\envs\example2-env\Library\jre\bin\server

虽然缺少此目录:尚未安装 JRE,仅安装了 JDK。显然,我可以在我的 . 文件中包含第一个目录PATH,但是,这将绕过 conda 虚拟环境的概念。我怎样才能优雅地解决这个问题?

这是environment.yml重现问题:

name: example-env
channels:
  - conda-forge
dependencies:
  - python=3.7
  - Cython
  - pyjnius

接下来,我创建并激活如下:

conda env update --file environment.yml
conda activate example-env
4

0 回答 0