pyecharts安装好了,依然报错的问题
电脑win10 64Python3.7重新pip显示如下Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simpleRequirement already satisfied: pyecharts in c:\users\rsj03\appdata\local\programs\python\python37\lib\site-packages (1.7.1)Requirement already satisfied: simplejson in c:\users\rsj03\appdata\local\programs\python\python37\lib\site-packages (from pyecharts) (3.17.0)Requirement already satisfied: jinja2 in c:\users\rsj03\appdata\local\programs\python\python37\lib\site-packages (from pyecharts) (2.11.1)Requirement already satisfied: prettytable in c:\users\rsj03\appdata\local\programs\python\python37\lib\site-packages (from pyecharts) (0.7.2)Requirement already satisfied: MarkupSafe>=0.23 in c:\users\rsj03\appdata\local\programs\python\python37\lib\site-packages (from jinja2->pyecharts) (1.1.1)Pip list能查到安装好的pyecharts如下pyecharts 1.7.1pyecharts-jupyter-installer 0.0.3
网上教程的代码,这个代码白天在单位电脑是可以运行的,在家的这台电脑就报错。from pyecharts.charts import Bar
from pyecharts import options as opts
bar = Bar()
x = list(range(1, 6))
y = [111, 120, 130, 142, 150]
bar.add_xaxis(x)
bar.add_yaxis("商家A", y)
bar.set_global_opts(title_opts=opts.TitleOpts(title='基本标题', subtitle='副标题'))
bar.render(r'C:\Users\rsj03\Desktop\hello.html')
报错如下:Traceback (most recent call last):File "C:/Users/rsj03/Desktop/pyecharts.py", line 1, in <module> from pyecharts.charts import BarFile "C:\Users\rsj03\Desktop\pyecharts.py", line 1, in <module> from pyecharts.charts import BarModuleNotFoundError: No module named 'pyecharts.charts'; 'pyecharts' is not a package
不知道是哪里出了问题?帮忙看下。感谢各位!
解决办法,今天从b站重新看了pycharm的配置方法。
又重新下载了新的python3.8.2
在pycharm中导入的各种库就能工作了。
哈哈
页:
[1]