Home > other >  Maps pyecharts made heat map but shows TemplateNotFound: simple_chart. HTML, for help
Maps pyecharts made heat map but shows TemplateNotFound: simple_chart. HTML, for help

Time:11-26


As shown in figure, in line with the purpose of learning pychats from the Internet to find maps to want to try a piece of code made heat map, but appeared the following error, do you have a great god can help us see how to solve?
 
The from pyecharts. Charts import Map, Geo
The from pyecharts import options as opts
# data processing into a list
Locate=[' Beijing ', 'tianjin', 'hebei', 'in shanxi, Inner Mongolia, liaoning, jilin, heilongjiang, Shanghai, jiangsu, zhejiang, anhui, fujian, jiangxi, shandong, henan, hubei, hunan, guangdong, guangxi, hainan, chongqing, sichuan, guizhou, yunnan, shaanxi, gansu, qinghai, ningxia, xinjiang,' Tibet]
App_price=[10.84, 8.65, 18.06, 8.90, 5.04, 29.20, 8.98, 17.80, 27.81, 24.24, 12.72, 11.10, 6.30, 7.00, 22.45, 16.92, 11.00, 14.99, 18.85, 5.85, 1.40, 7.32, 14.61, 4.62, 6.05, 8.07, 6.73, 15.54, 13.00, 39.07, 25.61, 21.3]
App_price list1=[[locate [I], [I]] for I in range (len (locate)]
Map_1=Map ()
Map_1. Set_global_opts (
Title_opts=opts. TitleOpts (title="2019 national provincial apple price list"),
Visualmap_opts=opts. VisualMapOpts (max_=50) # maximum data range
)
Map_1. Add (" apple throughout all the provinces in 2019 prices, "list1, maptype=" China ")
Map_1. Render (path='map1. HTML')


TemplateNotFound: simple_chart. HTML

CodePudding user response:

Python 3.7
Pyecharts 1.7.1
Test normal generated map1. HTML

The problem may be in your jupyter

According to the website information, the last sentence to try this
Map_1. Render_notebook ()


CodePudding user response:

Help you searched:
TemplateNotFound: simple_chart. HTML
Find:
Dilettante learning Python piece data visualization - cloud + 11 community - tencent cloud
The
reference

in integrated into the Flask
Need copies of pyecharts template into a Flask templates folder in the directory, a template file is located in pyecharts/pyecharts/render/templates/directory,

In fact at this time can be used in the Flask pyecharts, but according to pyecharts document in the introduction, encountered the following error in the process of actual use

Jinja2. Exceptions. TemplateNotFound: simple_chart. HTML
The error is caused by the following configuration

CurrentConfig. GLOBAL_ENV=Environment (loader=FileSystemLoader ("./templates "))
The configuration is removed from the code, rerun the program information can see the full icon,


And:
Error jinja2. Exceptions. TemplateNotFound _ at large sub - CSDN blog _jinja2. Exceptions. TemplateNotFound
Reference
have misplaced this kind of mistake is the templates folder, the templates folder should be placed in to run the program folder, that is to say the templates folder and run the file located on the same level,


- "seems to need you, find your own templates are located, as far as possible let" templates folder and run the files in the same level ", estimates that can solve the problem,

In addition, I suggest you learn to use Google search to help you solve technical problems, specific refer to:
Google, learning method and technical experience summary

Learn later, general technical problems, can be on your own, need not for others,

CodePudding user response:

The original poster is useless to the template, upstairs to search the answer to the other,
  • Related