运行环境

Win7 64位 + Python3.5.2

一、安装网页端编译器Jupyter Notebook

在cmd输入pip3 install jupyter
在cmd输入jupyter notebook,启动jupyter notebook,然后会跳转到网页,网页上显示了本地的Python文件,这样就启动成功了
ImportError: cannot import name ‘plot’  mac/windows python3-Python 技术分享 Java技术分享 Python 爬虫技术_微信公众号:zeropython—昊天博客

二、安装highchart库

在cmd输入pip3 install charts,highchart库就安装成功了
启动jupyter notebook,在网页中选择new\python3,在新页面输入import charts,点击cell>run,或者shift+enter,会报错。

ImportError: cannot import name ‘plot’  mac/windows python3-Python 技术分享 Java技术分享 Python 爬虫技术_微信公众号:zeropython—昊天博客

这时需要两步:
1.找到charts所在文件目录,一般在Python安装目录下的site-packages文件夹下,或者在jupyter notebook下输入

import sys
print(sys.path)
可以看到安装路径如下图

ImportError: cannot import name ‘plot’  mac/windows python3-Python 技术分享 Java技术分享 Python 爬虫技术_微信公众号:zeropython—昊天博客

2.找到site-packages文件路径,打开charts文件夹,将charts文件下的7个文件替换,在Jupyter Notebook中输入import charts,出现下图所示即成功。
替换文件地址:
替换文件

替换完成以后完美解决

ImportError: cannot import name ‘plot’  mac/windows python3-Python 技术分享 Java技术分享 Python 爬虫技术_微信公众号:zeropython—昊天博客

 

HTTPX 基础教程-新乡seo|网站优化,网站建设_微信公众号:zeropython—昊天博客