解决Appengine 1.2.5版报错 KeyError: 'simplejson//_speedups.pyd'

更新Google App Engine SDK至1.2.5版本后,启动dev_appserver可能遇到与simplejson版本冲突的错误。本文提供了解决方案:删除python的site-packages中对应的simplejson egg文件。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

 

在Windows下将Google Appengine SDK升级到1.2.5后,启动dev_appserver可能会出现如下错误:
  File "c:/python25/lib/site-packages/pkg_resources.py", line 1322, in _extract_
resource
    zip_stat = self.zipinfo[zip_path]
  File "C:/Program Files/Google/google_appengine/google/appengine/dist/py_zipimp
ort.py", line 268, in __getitem__
    info = _zipfile_cache[self._archive].getinfo(filename)
  File "C:/Python25/lib/zipfile.py", line 462, in getinfo
    return self.NameToInfo[name]
KeyError: 'simplejson//_speedups.pyd'
这是1.2.5版SDK的一个bug,原因是其混淆了simplejson的版本。可以在python的lib/site-packages删除simplejson对应的egg文件(比如simplejson-2.0.9-py2.5-win32.egg),dev_appserver.py就可以正常运行了。

 

vision@gpunode5:~$ conda create --name paddle python==3.10 Collecting package metadata (current_repodata.json): failed # >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<< Traceback (most recent call last): File "/home/vision/jnf/anaconda3/lib/python3.8/site-packages/conda/core/subdir_data.py", line 719, in fetch_repodata_remote_request resp.raise_for_status() File "/home/vision/jnf/anaconda3/lib/python3.8/site-packages/requests/models.py", line 1024, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/noarch/current_repodata.json During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/vision/jnf/anaconda3/lib/python3.8/site-packages/requests/models.py", line 974, in json return complexjson.loads(self.text, **kwargs) File "/home/vision/.local/lib/python3.8/site-packages/simplejson-3.17.5-py3.8-linux-x86_64.egg/simplejson/__init__.py", line 525, in loads return _default_decoder.decode(s) File "/home/vision/.local/lib/python3.8/site-packages/simplejson-3.17.5-py3.8-linux-x86_64.egg/simplejson/decoder.py", line 370, in decode obj, end = self.raw_decode(s) File "/home/vision/.local/lib/python3.8/site-packages/simplejson-3.17.5-py3.8-linux-x86_64.egg/simplejson/decoder.py", line 400, in raw_decode return self.scan_once(s, idx=_w(s, idx).end()) simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/vision/jnf/anaconda3/lib/python3.8/site-packages/conda/exceptions.py", line 1125, in __call__ return func(*args, **kwargs) File "/home/vision/jnf/anaconda3/lib/python3.8/site-packages/conda/cli/main.py", line 86, in main_subshell exit_code = do_call(args, p) File "/home/vision/jnf/anaconda3/lib/python3.8/site-packages/conda/cli/conda_argparse.py", line 93, in do_call return getattr(module, func_name)(args, parser) File "/home/vision/jnf/anaconda3/lib/python3.8/site-packages/conda/notices/core.py", line 72, in wrapper return_value = func(*args, **kwargs) File "/home/vision/jnf/anaconda3/lib/python3.8/site-packages/conda/cli/main_create.py", line 43, in execute install(args, parser, 'create') File "/home/vision/jnf/anaconda3/lib/python3.8/site-packages/conda/cli/install.py", line 256, in install unlink_link_transaction = solver.solve_for_transaction( File "/home/vision/jnf/anaconda3/lib/python3.8/site-packages/conda/core/solve.py", line 152, in solve_for_transaction unlink_precs, link_precs = self.solve_for_diff(update_modifier, deps_modifier, File "/home/vision/jnf/anaconda3/lib/python3.8/site-packages/conda/core/solve.py", line 195, in solve_for_diff final_precs = self.solve_final_state(update_modifier, deps_modifier, prune, ignore_pinned, File "/home/vision/jnf/anaconda3/lib/python3.8/site-packages/conda/core/solve.py", line 300, in solve_final_state ssc = self._collect_all_metadata(ssc) File "/home/vision/jnf/anaconda3/lib/python3.8/site-packages/conda/common/io.py", line 86, in decorated return f(*args, **kwds) File "/home/vision/jnf/anaconda3/lib/python3.8/site-packages/conda/core/solve.py", line 463, in _collect_all_metadata index, r = self._prepare(prepared_specs) File "/home/vision/jnf/anaconda3/lib/python3.8/site-packages/conda/core/solve.py", line 1057, in _prepare reduced_index = get_reduced_index(self.prefix, self.channels, File "/home/vision/jnf/anaconda3/lib/python3.8/site-packages/conda/core/index.py", line 297, in get_reduced_index new_records = SubdirData.query_all(spec, channels=channels, subdirs=subdirs, File "/home/vision/jnf/anaconda3/lib/python3.8/site-packages/conda/core/subdir_data.py", line 152, in query_all result = tuple(concat(executor.map(subdir_query, channel_urls))) File "/home/vision/jnf/anaconda3/lib/python3.8/concurrent/futures/_base.py", line 611, in result_iterator yield fs.pop().result() File "/home/vision/jnf/anaconda3/lib/python3.8/concurrent/futures/_base.py", line 432, in result return self.__get_result() File "/home/vision/jnf/anaconda3/lib/python3.8/concurrent/futures/_base.py", line 388, in __get_result raise self._exception File "/home/vision/jnf/anaconda3/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/home/vision/jnf/anaconda3/lib/python3.8/site-packages/conda/core/subdir_data.py", line 144, in <lambda> subdir_query = lambda url: tuple(SubdirData(Channel(url), repodata_fn=repodata_fn).query( File "/home/vision/jnf/anaconda3/lib/python3.8/site-packages/conda/core/subdir_data.py", line 157, in query self.load() File "/home/vision/jnf/anaconda3/lib/python3.8/site-packages/conda/core/subdir_data.py", line 222, in load _internal_state = self._load() File "/home/vision/jnf/anaconda3/lib/python3.8/site-packages/conda/core/subdir_data.py", line 387, in _load raw_repodata_str = fetch_repodata_remote_request( File "/home/vision/jnf/anaconda3/lib/python3.8/site-packages/conda/core/subdir_data.py", line 775, in fetch_repodata_remote_request raise UnavailableInvalidChannel( File "/home/vision/jnf/anaconda3/lib/python3.8/site-packages/conda/exceptions.py", line 460, in __init__ body = response.json() File "/home/vision/jnf/anaconda3/lib/python3.8/site-packages/requests/models.py", line 978, in json raise RequestsJSONDecodeError(e.msg, e.doc, e.pos) requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0) `$ /home/vision/jnf/anaconda3/bin/conda create --name paddle python==3.10` environment variables: ACUITY_PATH=/home/shikangli/QG3102/Verisilicon/acuity-toolkit-binary-6.0.14/bin CIO_TEST=<not set> CONDA_EXE=/home/vision/jnf/anaconda3/bin/conda CONDA_PYTHON_EXE=/home/vision/jnf/anaconda3/bin/python CONDA_ROOT=/home/vision/jnf/anaconda3 CONDA_SHLVL=0 CURL_CA_BUNDLE=<not set> LD_LIBRARY_PATH=/home2/chenfang/hikflow_simulator/RAF/lib/netforward/lib:/home2/chenfa ng/hikflow_simulator/RAF/lib/netforward/lib:/usr/local/cuda-10.1/lib64 PATH=/home/vision/jnf/anaconda3/bin:/usr/local/cuda-11.2/bin:/home/vision/j nf/anaconda3/condabin:/home/shikangli/QG3102/Verisilicon/VivanteIDE5.5 .0:/home/shikangli/QG3102/Verisilicon/VivanteIDE5.5.0/ide:/usr/local/c uda-10.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/ bin:/usr/games:/usr/local/games:/snap/bin:/home/shikangli/QG3102/Veris ilicon/nbg-tools:/home/shikangli/QG3102/Verisilicon/acuity-toolkit- binary-6.0.14/bin PYTHONPATH=/home2/chenfang/hikflow_simulator/hikflow_simulate/yolopost_py:/home2/ chenfang/hikflow_simulator/hikflow_simulate:/home2/chenfang/hikflow_si mulator/RAF/lib/netforward/python:/home2/chenfang/hikflow_simulator/RA F:/home2/chenfang/hikflow_simulator/hikflow_simulate/yolopost_py:/home 2/chenfang/hikflow_simulator/hikflow_simulate:/home2/chenfang/hikflow_ simulator/RAF/lib/netforward/python:/home2/chenfang/hikflow_simulator/ RAF: REQUESTS_CA_BUNDLE=<not set> SSL_CERT_FILE=<not set> active environment : None shell level : 0 user config file : /home/vision/.condarc populated config files : /home/vision/.condarc conda version : 4.14.0 conda-build version : 3.21.4 python version : 3.8.8.final.0 virtual packages : __cuda=12.1=0 __linux=5.4.0=0 __glibc=2.27=0 __unix=0=0 __archspec=1=x86_64 base environment : /home/vision/jnf/anaconda3 (writable) conda av data dir : /home/vision/jnf/anaconda3/etc/conda conda av metadata url : None channel URLs : https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/linux-64 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/noarch https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/linux-64 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/noarch https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r/linux-64 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r/noarch https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2/linux-64 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2/noarch package cache : /home/vision/jnf/anaconda3/pkgs /home/vision/.conda/pkgs envs directories : /home/vision/jnf/anaconda3/envs /home/vision/.conda/envs platform : linux-64 user-agent : conda/4.14.0 requests/2.32.3 CPython/3.8.8 Linux/5.4.0-150-generic ubuntu/18.04.6 glibc/2.27 UID:GID : 1001:1001 netrc file : None offline mode : False An unexpected error has occurred. Conda has prepared the above report. If submitted, this report will be used by core maintainers to improve future releases of conda. Would you like conda to send this report to the core maintainers?
06-20
Error building Player: CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details. C:/Program Files/Java/jdk-1.8\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="D:/Android/sdk\tools" -Dfile.encoding=UTF8 -jar "D:\Unity\5.3.8f2\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" - stderr[ warning: Ignoring InnerClasses attribute for an anonymous inner class (com.tencent.mm.sdk.b.b) that doesn't come with an associated EnclosingMethod attribute. This class was probably produced by a compiler that did not target the modern .class file format. The recommended solution is to recompile the class from source, using an up-to-date compiler and without specifying any "-target" type options. The consequence of ignoring this warning is that reflective operations on this class will incorrectly indicate that it is *not* an inner class. warning: Ignoring InnerClasses attribute for an anonymous inner class (com.testin.agent.a.b) that doesn't come with an associated EnclosingMethod attribute. This class was probably produced by a compiler that did not target the modern .class file format. The recommended solution is to recompile the class from source, using an up-to-date compiler and without specifying any "-target" type options. The consequence of ignoring this warning is that reflective operations on this class will incorrectly indicate that it is *not* an inner class. warning: Ignoring InnerClasses attribute for an anonymous inner class (com.testin.agent.a.e) that doesn't come with an associated EnclosingMethod attribute. This class was probably produced by a compiler that did not target the modern .class file format. The recommended solution is to recompile the class from source, using an up-to-date compiler and without specifying any "-target" type options. The consequence of ignoring this warning is that reflective operations on this class will incorrectly indicate that it is *not* an inner class. warning: Ignoring InnerClasses attribute for an anonymous inner class (com.testin.agent.a.f) that doesn't come with an associated EnclosingMethod attribute. This class was probably produced by a compiler that did not target the modern .class file format. The recommended solution is to recompile the class from source, using an up-to-date compiler and without specifying any "-target" type options. The consequence of ignoring this warning is that reflective operations on this class will incorrectly indicate that it is *not* an inner class. warning: Ignoring InnerClasses attribute for an anonymous inner class (com.testin.agent.a.i) that doesn't come with an associated EnclosingMethod attribute. This class was probably produced by a compiler that did not target the modern .class file format. The recommended solution is to recompile the class from source, using an up-to-date compiler and without specifying any "-target" type options. The consequence of ignoring this warning is that reflective operations on this class will incorrectly indicate that it is *not* an inner class. warning: Ignoring InnerClasses attribute for an anonymous inner class (com.testin.agent.a.m) that doesn't come with an associated EnclosingMethod attribute. This class was probably produced by a compiler that did not target the modern .class file format. The recommended solution is to recompile the class from source, using an up-to-date compiler and without specifying any "-target" type options. The consequence of ignoring this warning is that reflective operations on this class will incorrectly indicate that it is *not* an inner class. warning: Ignoring InnerClasses attribute for an anonymous inner class (com.testin.agent.d.b.c) that doesn't come with an associated EnclosingMethod attribute. This class was probably produced by a compiler that did not target the modern .class file format. The recommended solution is to recompile the class from source, using an up-to-date compiler and without specifying any "-target" type options. The consequence of ignoring this warning is that reflective operations on this class will incorrectly indicate that it is *not* an inner class. warning: Ignoring InnerClasses attribute for an anonymous inner class (com.testin.agent.d.b.b) that doesn't come with an associated EnclosingMethod attribute. This class was probably produced by a compiler that did not target the modern .class file format. The recommended solution is to recompile the class from source, using an up-to-date compiler and without specifying any "-target" type options. The consequence of ignoring this warning is that reflective operations on this class will incorrectly indicate that it is *not* an inner class. warning: Ignoring InnerClasses attribute for an anonymous inner class (com.testin.agent.e.h) that doesn't come with an associated EnclosingMethod attribute. This class was probably produced by a compiler that did not target the modern .class file format. The recommended solution is to recompile the class from source, using an up-to-date compiler and without specifying any "-target" type options. The consequence of ignoring this warning is that reflective operations on this class will incorrectly indicate that it is *not* an inner class. Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbitter/jnibridge/JNIBridge; Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbitter/jnibridge/JNIBridge$a; Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/unity3d/player/NativeLoader; Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/unity3d/player/ReflectionHelper; Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/unity3d/player/ReflectionHelper$1; Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/unity3d/player/ReflectionHelper$a; Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/unity3d/player/UnityPlayer; Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/unity3d/player/UnityPlayer$1; Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/unity3d/player/UnityPlayer$10; UNEXPECTED TOP-LEVEL EXCEPTION: java.lang.RuntimeException: Translation has been interrupted at com.android.dx.command.dexer.Main.processAllFiles(Main.java:608) at com.android.dx.command.dexer.Main.runMonoDex(Main.java:311) at com.android.dx.command.dexer.Main.run(Main.java:277) at com.android.dx.command.dexer.Main.main(Main.java:245) at com.android.dx.command.Main.main(Main.java:106) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at SDKMain.main(SDKMain.java:129) Caused by: java.lang.InterruptedException: Too many errors at com.android.dx.command.dexer.Main.processAllFiles(Main.java:600) ... 9 more ] stdout[ processing bin\classes\.\com\dw\Dating\lua\R.class... processing bin\classes\.\com\dw\Dating\lua\R$attr.class... processing bin\classes\.\com\dw\Dating\lua\R$drawable.class... processing bin\classes\.\com\dw\Dating\lua\R$string.class... processing bin\classes\.\com\dw\Dating\lua\R$style.class... processing bin\classes\.\com\dw\Dating\lua\R$xml.class... processing archive bin\classes.jar... processing bitter/jnibridge/JNIBridge.class... processing bitter/jnibridge/JNIBridge$a.class... processing com/unity3d/player/NativeLoader.class... processing com/unity3d/player/ReflectionHelper.class... processing com/unity3d/player/ReflectionHelper$1.class... processing com/unity3d/player/ReflectionHelper$a.class... processing com/unity3d/player/UnityPlayer.class... processing com/unity3d/player/UnityPlayer$1.class... processing com/unity3d/player/UnityPlayer$10.class... processing com/unity3d/player/UnityPlayer$11.class... processing com/unity3d/player/UnityPlayer$12.class... processing com/unity3d/player/UnityPlayer$13.class... processing com/unity3d/player/UnityPlayer$14.class... processing com/unity3d/player/UnityPlayer$15.class... processing com/unity3d/player/UnityPlayer$15$1.class... processing com/unity3d/player/UnityPlayer$16.class... processing com/unity3d/player/UnityPlayer$17.class... processing com/unity3d/player/UnityPlayer$18.class... processing com/unity3d/player/UnityPlayer$19.class... processing com/unity3d/player/UnityPlayer$2.class... processing com/unity3d/player/UnityPlayer$20.class... processing com/unity3d/player/UnityPlayer$3.class... processing com/unity3d/player/UnityPlayer$4.class... processing com/unity3d/player/UnityPlayer$5.class... processing com/unity3d/player/UnityPlayer$6.class... processing com/unity3d/player/UnityPlayer$7.class... processing com/unity3d/player/UnityPlayer$8.class... processing com/unity3d/player/UnityPlayer$9.class... processing com/unity3d/player/UnityPlayer$a.class... processing com/unity3d/player/UnityPlayer$b.class... processing com/unity3d/player/UnityPlayer$c.class... processing com/unity3d/player/UnityPlayer$d.class... processing com/unity3d/player/UnityPlayerActivity.class... processing com/unity3d/player/UnityPlayerNativeActivity.class... processing com/unity3d/player/UnityPlayerProxyActivity.class... processing com/unity3d/player/UnityWebRequest.class... processing com/unity3d/player/WWW.class... processing com/unity3d/player/a.class... processing com/unity3d/player/a$1.class... processing com/unity3d/player/a$2.class... processing com/unity3d/player/a$a.class... processing com/unity3d/player/b.class... processing com/unity3d/player/b$1.class... processing com/unity3d/player/b$2.class... processing com/unity3d/player/c.class... processing com/unity3d/player/d.class... processing com/unity3d/player/d$1.class... processing com/unity3d/player/d$2.class... processing com/unity3d/player/e.class... processing com/unity3d/player/f.class... processing com/unity3d/player/g.class... processing com/unity3d/player/h.class... processing com/unity3d/player/i.class... processing com/unity3d/player/j.class... processing com/unity3d/player/k.class... processing com/unity3d/player/k$1.class... processing com/unity3d/player/k$2.class... processing com/unity3d/player/k$2$1.class... processing com/unity3d/player/k$2$1$1.class... processing com/unity3d/player/l.class... processing com/unity3d/player/l$1.class... processing com/unity3d/player/m.class... processing com/unity3d/player/n.class... processing com/unity3d/player/n$1.class... processing com/unity3d/player/o.class... processing com/unity3d/player/p.class... processing com/unity3d/player/p$1.class... processing com/unity3d/player/q.class... processing com/unity3d/player/r.class... processing com/unity3d/player/s.class... processing com/unity3d/player/s$1.class... processing com/unity3d/player/s$2.class... processing com/unity3d/player/s$3.class... processing com/unity3d/player/t.class... processing com/unity3d/player/u.class... processing com/unity3d/player/v.class... processing com/unity3d/player/w.class... processing com/unity3d/player/w$1.class... processing org/fmod/FMODAudioDevice.class... processing org/fmod/a.class... processing archive plugins\.\FanweiPlugin_v4.4.jar... processing android/app/ActivityThread.class... processing android/app/Instrumentation.class... processing android/app/Instrumentation$ActivityMonitor.class... processing android/app/Instrumentation$ActivityResult.class... processing android/app/LoadedApk.class... processing com/fanwei/bluearty/pluginmgr/BuildConfig.class... processing com/fanwei/bluearty/pluginmgr/DynamicActivity.class... processing com/fanwei/bluearty/pluginmgr/Globals.class... processing com/fanwei/bluearty/pluginmgr/PluginActivityLifeCycleCallback.class... processing com/fanwei/bluearty/pluginmgr/PluginManager.class... processing com/fanwei/bluearty/pluginmgr/delegate/DelegateActivityThread.class... processing com/fanwei/bluearty/pluginmgr/delegate/DelegateInstrumentation.class... processing com/fanwei/bluearty/pluginmgr/delegate/LayoutInflaterProxyContext.class... processing com/fanwei/bluearty/pluginmgr/environment/CreateActivityData.class... processing com/fanwei/bluearty/pluginmgr/environment/PlugInfo.class... processing com/fanwei/bluearty/pluginmgr/environment/PluginClassLoader.class... processing com/fanwei/bluearty/pluginmgr/environment/PluginContext.class... processing com/fanwei/bluearty/pluginmgr/environment/PluginInstrumentation.class... processing com/fanwei/bluearty/pluginmgr/reflect/NULL.class... processing com/fanwei/bluearty/pluginmgr/reflect/Reflect.class... processing com/fanwei/bluearty/pluginmgr/reflect/Reflect$1.class... processing com/fanwei/bluearty/pluginmgr/reflect/ReflectException.class... processing com/fanwei/bluearty/pluginmgr/selector/DefaultActivitySelector.class... processing com/fanwei/bluearty/pluginmgr/selector/DynamicActivitySelector.class... processing com/fanwei/bluearty/pluginmgr/utils/FileUtil.class... processing com/fanwei/bluearty/pluginmgr/utils/IntReader.class... processing com/fanwei/bluearty/pluginmgr/utils/NamespaceStack.class... processing com/fanwei/bluearty/pluginmgr/utils/PluginManifestUtil.class... processing com/fanwei/bluearty/pluginmgr/utils/StringBlock.class... processing com/fanwei/bluearty/pluginmgr/utils/Trace.class... processing com/fanwei/bluearty/pluginmgr/utils/XmlManifestReader.class... processing com/fanwei/bluearty/pluginmgr/utils/XmlResourceParser.class... processing com/fanwei/bluearty/pluginmgr/verify/PluginNotFoundException.class... processing com/fanwei/bluearty/pluginmgr/verify/PluginOverdueVerifier.class... processing com/fanwei/bluearty/pluginmgr/verify/SimpleLengthVerifier.class... processing com/fanwei/bluearty/pluginmgr/widget/LayoutInflaterWrapper.class... processing com/fanwei/bluearty/pluginmgr/widget/ViewStub.class... processing com/fanwei/bluearty/pluginmgr/widget/ViewStub$OnInflateListener.class... processing com/fanwei/bluearty/simplejson/BasicType.class... processing com/fanwei/bluearty/simplejson/BuildConfig.class... processing com/fanwei/bluearty/simplejson/SimpleJson.class... processing com/fanwei/bluearty/simplejson/SimpleJson$1.class... processing com/fanwei/bluearty/simplejson/annotation/CollectionCreateBy.class... processing com/fanwei/bluearty/simplejson/annotation/NickName.class... processing com/fanwei/bluearty/simplejson/annotation/NotConvert.class... processing com/fanwei/bluearty/simplejson/annotation/SerializeBy.class... processing com/fanwei/bluearty/simplejson/serializer/Serializer.class... processing com/fanwei/bluearty/tinyhttp/BuildConfig.class... processing com/fanwei/bluearty/tinyhttp/Const.class... processing com/fanwei/bluearty/tinyhttp/Request.class... processing com/fanwei/bluearty/tinyhttp/Request$Method.class... processing com/fanwei/bluearty/tinyhttp/Response.class... processing com/fanwei/bluearty/tinyhttp/RetryManager.class... processing com/fanwei/bluearty/tinyhttp/Webb.class... processing com/fanwei/bluearty/tinyhttp/Webb$1.class... processing com/fanwei/bluearty/tinyhttp/Webb$AutoDisconnectInputStream.class... processing com/fanwei/bluearty/tinyhttp/Webb$FWHostnameVerifier.class... processing com/fanwei/bluearty/tinyhttp/Webb$FWX509TrustManager.class... processing com/fanwei/bluearty/tinyhttp/WebbException.class... processing com/fanwei/bluearty/tinyhttp/WebbUtils.class... processing com/fanwei/jubaosdk/common/BuildConfig.class... processing com/fanwei/jubaosdk/common/core/AbstractCall.class... processing com/fanwei/jubaosdk/common/core/AbstractCall$Callback.class... processing com/fanwei/jubaosdk/common/core/AbstractCall$CallbackUI.class... processing com/fanwei/jubaosdk/common/core/AbstractCall$CallbackUI$UIHandler.class... processing com/fanwei/jubaosdk/common/core/Call.class... processing com/fanwei/jubaosdk/common/core/Dispatcher.class... processing com/fanwei/jubaosdk/common/core/OnPayResultListener.class... processing com/fanwei/jubaosdk/common/entity/Advertisement.class... processing com/fanwei/jubaosdk/common/entity/OrderEntity.class... processing com/fanwei/jubaosdk/common/entity/PayMethodResponse.class... processing com/fanwei/jubaos<message truncated>
最新发布
07-19
/root/.conda/envs/Finaltest/bin/python /root/IdeaProjects/Finaltest/showdata.pyTraceback (most recent call last): File "/root/IdeaProjects/Finaltest/showdata.py", line 279, in <module> eval(funcStr)(index) File "/root/IdeaProjects/Finaltest/showdata.py", line 38, in drawChart_1 .render("/home/hadoop/result/result1/result1.html") File "/root/.conda/envs/Finaltest/lib/python3.10/site-packages/pyecharts/charts/base.py", line 97, in render return engine.render(self, path, template_name, env, **kwargs) File "/root/.conda/envs/Finaltest/lib/python3.10/site-packages/pyecharts/render/engine.py", line 92, in render RenderEngine(env).render_chart_to_file( File "/root/.conda/envs/Finaltest/lib/python3.10/site-packages/pyecharts/render/engine.py", line 76, in render_chart_to_file write_utf8_html_file(path, html) File "/root/.conda/envs/Finaltest/lib/python3.10/site-packages/pyecharts/render/engine.py", line 18, in write_utf8_html_file with open(file=file_name,NotADirectoryError: [Errno 20] Not a directory: '/home/hadoop/result/result1/result1.html' 怎么修改下面的代码 import datetimeimport uuidimport simplejson as jsonfrom jinja2 import Environmentfrom ..commons import utilsfrom ..globals import CurrentConfig, RenderType, ThemeTypefrom ..options import InitOpts, RenderOptsfrom ..options.series_options import BasicOpts, AnimationOptsfrom ..render import enginefrom ..types import Optional, Sequence, Unionfrom .mixins import ChartMixinclass Base(ChartMixin): """ `Base` is the root class for all graphical class, it provides part of the initialization parameters and common methods """ def __init__( self, init_opts: Union[InitOpts, dict] = InitOpts(), render_opts: Union[RenderOpts, dict] = RenderOpts(), ): _opts = init_opts if isinstance(init_opts, InitOpts): _opts = init_opts.opts _render_opts = render_opts if isinstance(render_opts, RenderOpts): _render_opts = render_opts.opts self.width = _opts.get("width", "900px") self.height = _opts.get("height", "500px") self.horizontal_center = ( "text-align:center; margin: auto" if _opts.get("is_horizontal_center", False) else "" ) self.renderer = _opts.get("renderer", RenderType.CANVAS) self.page_title = _opts.get("page_title", CurrentConfig.PAGE_TITLE) self.theme = _opts.get("theme", ThemeType.WHITE) self.chart_id = _opts.get("chart_id") or uuid.uuid4().hex self.fill_bg = _opts.get("fill_bg", False) self.bg_color = _opts.get("bg_color") self.options: dict = {} self.render_options: dict = {} self.js_host: str = _opts.get("js_host") or CurrentConfig.ONLINE_HOST self.js_functions: utils.OrderedSet = utils.OrderedSet() self.js_dependencies: utils.OrderedSet = utils.OrderedSet("echarts") self.js_events: utils.OrderedSet = utils.OrderedSet() self.options.update(backgroundColor=self.bg_color) if isinstance(_opts.get("animationOpts", AnimationOpts()), dict): self.options.update(_opts.get("animationOpts", AnimationOpts().opts)) else: self.options.update(_opts.get("animationOpts", AnimationOpts()).opts) self.options.update(aria=_opts.get("ariaOpts")) self._is_geo_chart: bool = False self._geo_json_name: Optional[str] = None self._geo_json: Optional[dict] = None self.render_options.update(embed_js=bool(_render_opts.get("embed_js"))) self._render_cache: dict = dict() def use_echarts_stat(self): self.js_dependencies.add("echarts-stat") return self def get_chart_id(self) -> str: return self.chart_id def get_options(self) -> dict: return utils.remove_key_with_none_value(self.options) def dump_options(self) -> str: return utils.replace_placeholder( json.dumps(self.get_options(), indent=4, default=default, ignore_nan=True) ) def dump_options_with_quotes(self) -> str: return utils.replace_placeholder_with_quotes( json.dumps(self.get_options(), indent=4, default=default, ignore_nan=True) ) def render( self, path: str = "render.html", template_name: str = "simple_chart.html", env: Optional[Environment] = None, **kwargs, ) -> str: self._prepare_render() return engine.render(self, path, template_name, env, **kwargs) def render_embed( self, template_name: str = "simple_chart.html", env: Optional[Environment] = None, **kwargs, ) -> str: self._prepare_render() return engine.render_embed(self, template_name, env, **kwargs) def render_notebook(self): self.chart_id = uuid.uuid4().hex self._prepare_render() return engine.render_notebook( self, "nb_jupyter_notebook.html", "nb_jupyter_lab.html" ) def _use_theme(self): if self.theme not in ThemeType.BUILTIN_THEMES: self.js_dependencies.add(self.theme) def _prepare_render(self): self.json_contents = self.dump_options() self._use_theme() self._render_cache.clear() if self.render_options.get("embed_js"): self._render_cache[ "javascript" ] = self.load_javascript().load_javascript_contents()def default(o): if isinstance(o, (datetime.date, datetime.datetime)): return o.isoformat() if isinstance(o, utils.JsCode): return ( o.replace("\\n|\\t", "").replace(r"\\n", "\n").replace(r"\\t", "\t").js_code ) if isinstance(o, BasicOpts): if isinstance(o.opts, Sequence): return [utils.remove_key_with_none_value(item) for item in o.opts] else: return utils.remove_key_with_none_value(o.opts)
06-19
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

socratescli

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值