Comments (14)
在issue 23看到跟我同样报错的信息,看到作者提交了commit和终止了问题后
我把作者的回复操作试了一遍
但是发现还是没有成功解决我的 问题
这是我的错误信息
phantomjs version: 2.1.1Generating file ...
Traceback (most recent call last):
File "E:\学习作业\毕业设计\爬虫\数据分析\output_jinjiang.py", line 10, in
bar.render(path='snapshot.png', pixel_ratio=3)
File "D:\Program Files\python\lib\site-packages\pyecharts\base.py", line 146, in render
**kwargs
File "D:\Program Files\python\lib\site-packages\pyecharts_snapshot\environment.py", line 35, in render_chart_to_file
make_a_snapshot(tmp_file_path, path, delay=delay, verbose=verbose)
File "D:\Program Files\python\lib\site-packages\pyecharts_snapshot\main.py", line 99, in make_a_snapshot
raise OSError(content_array)
OSError: ["ReferenceError: Can't find variable: echarts\n\n undefined:1\nnull\n"]
[Finished in 6.0s]使用的是有我自己的代码和作者的案例代码,还有尝试了作者说的引擎方式,但都是同样的错误
无论是这个案例
还是这个案例
`from pyecharts import Bar, Line
from pyecharts.engine import create_default_environmentbar = Bar("我的第一个图表", "这里是副标题")
bar.add("服装", ["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"], [5, 20, 36, 10, 75, 90])line = Line("我的第一个图表", "这里是副标题")
line.add("服装", ["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"], [5, 20, 36, 10, 75, 90])env = create_default_environment("html")
为渲染创建一个默认配置环境
create_default_environment(filet_ype)
file_type: 'html', 'svg', 'png', 'jpeg', 'gif' or 'pdf'
env.render_chart_to_file(bar, path='bar.html')
env.render_chart_to_file(line, path='line.html')`
都是报了同一个错误
我的尝试结果是,如果不用引擎的方式,我可以生成html文件,但是png文件始终无法生成我的python版本是3.6
使用的是sublime text编辑器
版本信息有
pyecharts==0.5.11
pyecharts-javascripthon==0.0.6
pyecharts-jupyter-installer==0.0.3
pyecharts-snapshot==0.1.7
PyInstaller==3.3.1以上是我的问题详细内容,跪求作者翻牌,谢谢大佬
这个问题我也遇到了,我的解决思路是使用echarts-scrappeteer库https://github.com/chfw/echarts-scrappeteer,然后用Python调用系统命令生成图片。
from pyecharts-snapshot.
from pyecharts-snapshot.
兄弟使用 pyecharts V1.0.0 版本吧,关于渲染图片这里有详细介绍
https://pyecharts.org/#/zh-cn/render_images
from pyecharts-snapshot.
兄弟使用 pyecharts V1.0.0 版本吧,关于渲染图片这里有详细介绍
如何安装最新版本的 V 1.0.0 版本?pip 安装的最新版本是V 0.5.11的
from pyecharts-snapshot.
pyecharts-snapshot 最新版已经不用 phantomjs 了。
from pyecharts-snapshot.
谢谢,他正常工作了
from pyecharts-snapshot.
请问你是怎么解决的,我也遇到这个情况了。我的脚本晚上容易出现这种问题,白天重跑正常。
from pyecharts-snapshot.
from pyecharts-snapshot.
from pyecharts-snapshot.
from pyecharts-snapshot.
from pyecharts-snapshot.
我也遇到这个问题了,通过配置 js_host 参数,使用本地的js静态文件解决了
例如:
将 https://assets.pyecharts.org/assets/echarts.min.js 下载 放到 ./js/下边
Line(init_opts=InitOpts(js_host="./js/"))
from pyecharts-snapshot.
我也遇到这个问题了,通过配置 js_host 参数,使用本地的js静态文件解决了
例如: 将 https://assets.pyecharts.org/assets/echarts.min.js 下载 放到 ./js/下边 Line(init_opts=InitOpts(js_host="./js/"))
这个方法在win系统下好像不管用,依然会报错
from pyecharts-snapshot.
from pyecharts-snapshot.
Related Issues (20)
- svg的图表生成后不能交互 HOT 1
- pixel_ratio 应该作为可配置参数
- No phantomjs found in your PATH. Please install it! HOT 10
- 能否添加一个函数,直接返回图片base64的编码? HOT 3
- 默认白色背景,保存成jpeg图片的时候,背景色变成黑色 HOT 2
- Wrong when running grid.py with python3.6 HOT 1
- Exception: No pyecharts_environment is found for png HOT 1
- OSError: ["ReferenceError: Can't find variable: echarts\n\n undefined:1\nnull\n"] HOT 4
- gif do not work HOT 1
- The file size is too big, any way to reduce? HOT 1
- how to use it in python? HOT 3
- 生成gif时,报错 HOT 4
- About the parameter delay
- pyppeteer.errors.BrowserError: Browser closed unexpectedly: HOT 5
- Use pyecharts-snapshot without browser HOT 1
- html转为svg格式后,svg文件打开不是图片,是一段代码 HOT 1
- 在不连网的情况下,在win10系统下,无法将html图片保存为本地图片,怎么正确添加js_host可以正常运行
- Can sankey plot be converted to vectorgraph like pdf or SVG file? HOT 1
- Scatter3D 生成png和pdf失败
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyecharts-snapshot.