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,显示已安装成功。请求帮忙瞧瞧。