weixin_53348386 2023-10-09 14:17 采纳率: 0%
浏览 34

Py4JError: Could not find py4j jar at


from pypmml import Model
model_pmml = Model.fromFile("pipeline_sy_old.pmmlmml")

Py4JError                                 Traceback (most recent call last)
Input In [3], in <cell line: 1>()
----> 1 model_pmml = Model.fromFile("pipeline_sy_old.pmmlmml")
      
File ~\AppData\Roaming\Python\Python39\site-packages\pypmml\model.py:190, in Model.fromFile(cls, name)
    187 @classmethod
    188 def fromFile(cls, name):
    189     """Load a model from PMML file with given pathname"""
--> 190     pc = PMMLContext.getOrCreate()
    191     try:
    192         java_model = pc._jvm.org.pmml4s.model.Model.fromFile(name)

File ~\AppData\Roaming\Python\Python39\site-packages\pypmml\base.py:77, in PMMLContext.getOrCreate(cls)
     75 with PMMLContext._lock:
     76     if PMMLContext._active_pmml_context is None:
---> 77         PMMLContext()
     78     return PMMLContext._active_pmml_context

File ~\AppData\Roaming\Python\Python39\site-packages\pypmml\base.py:51, in PMMLContext.__init__(self, gateway)
     50 def __init__(self, gateway=None):
---> 51     PMMLContext._ensure_initialized(self, gateway=gateway)

File ~\AppData\Roaming\Python\Python39\site-packages\pypmml\base.py:60, in PMMLContext._ensure_initialized(cls, instance, gateway)
     58 with PMMLContext._lock:
     59     if not PMMLContext._gateway:
---> 60         PMMLContext._gateway = gateway or cls.launch_gateway()
     61         PMMLContext._jvm = PMMLContext._gateway.jvm
     63     if instance:

File ~\AppData\Roaming\Python\Python39\site-packages\pypmml\base.py:98, in PMMLContext.launch_gateway(cls, javaopts, java_path)
     95     if java_opts:
     96         javaopts = java_opts.split()
---> 98 _port = launch_gateway(classpath=launch_classpath, javaopts=javaopts, java_path=java_path, die_on_exit=True)
     99 gateway = JavaGateway(
    100     gateway_parameters=GatewayParameters(port=_port,
    101                                          auto_convert=True))
    102 return gateway

File ~\AppData\Roaming\Python\Python39\site-packages\py4j\java_gateway.py:297, in launch_gateway(port, jarpath, classpath, javaopts, die_on_exit, redirect_stdout, redirect_stderr, daemonize_redirect, java_path, create_new_process_group, enable_auth, cwd, return_proc, use_shell)
    295 # Fail if the jar does not exist.
    296 if not os.path.exists(jarpath):
--> 297     raise Py4JError("Could not find py4j jar at {0}".format(jarpath))
    299 # Launch the server in a subprocess.
    300 classpath = os.pathsep.join((jarpath, classpath))

Py4JError: Could not find py4j jar at 

如何解决?补充说明:环境变量CLASSPATH中已添加C:\Users\Administrator\py4j\py4j0.10.9.7.jar;pip show py4j==0.10.9.7,显示已安装成功。请求帮忙瞧瞧。



  • 写回答

1条回答 默认 最新

  • CSDN-Ada助手 CSDN-AI 官方账号 2023-10-09 16:24
    关注

    【相关推荐】




    如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^
    评论

报告相同问题?

问题事件

  • 创建了问题 10月9日

悬赏问题

  • ¥20 关于游戏c++语言代码问题
  • ¥15 如何制作永久二维码,最好是微信也可以扫开的。(相关搜索:管理系统)
  • ¥15 delphi indy cookie 有效期
  • ¥15 labelme打不开怎么办
  • ¥35 按照图片上的两个任务要求,用keil5写出运行代码,并在proteus上仿真成功,🙏
  • ¥15 免费的电脑视频剪辑类软件如何盈利
  • ¥30 MPI读入tif文件并将文件路径分配给各进程时遇到问题
  • ¥15 pycharm中导入模块出错
  • ¥20 Ros2 moveit2 Windows环境配置,有偿,价格可商议。
  • ¥15 有关“完美的代价”问题的代码漏洞