windows在python35上安装pyecharts

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/lonsonlee/article/details/81303348

看了数据森麟微信公众号(ID:shujusenlin)关于西虹市首富的数据分析,一时手痒到他的git上转了转,目前没有分享源码,但是找到了一个马蜂窝的栗子,于是下载下来准备调试一下。

PS:对于自己不熟悉的技术,可以先copy,看效果,学习用法,也学习编码风格,个人建议,仅供参考。

参考文章

https://blog.csdn.net/dick633/article/details/79973413
https://blog.csdn.net/Eastmount/article/details/79864984
https://blog.csdn.net/qq_25467523/article/details/53069113

需要用到 selenium、pandas、pyecharts 库

安装前两个没问题,但是安装 pyecharts遇到了一些问题 不BB了 next!

安装pyecharts

提示版本太低 于是先升级pip python -m pip install --upgrade pip
官方源地址有点慢,于是

更换pip源


地址栏里输入%appdata% 新建pip文件夹 新建pip.ini文件输入 清华的源地址,这之后快多了
[global]
timeout = 6000
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
trusted-host = pypi.tuna.tsinghua.edu.cn

再执行安装 pip install pyecharts


报错 Command "python setup.py egg_info" failed with error code 1 in C:\Users\WANGJI~1\AppData\Local\Temp\pip-install-5qp7v2k6\javascripthon\

      File "e:\lonson\program files\python\python35\lib\tarfile.py", line 2296,
in next        raise ReadError("empty file")
    tarfile.ReadError: empty file

找攻略

说是 执行 python -m pip install --upgrade --force pip

试过了 没用,于是看执行代码 sdist.py,没看出问题,到pip源看安装列表 https://pypi.tuna.tsinghua.edu.cn/simple/

pyecharts
pyecharts-javascripthon
pyecharts-jupyter-installer
pyecharts-plus
pyecharts-snapshot

尝试分别安装

但是只有pip install pyecharts-jupyter-installer 执行成功,在执行pip install pyecharts-javascripthon时报错
其他两个没再尝试

追一句---感觉 文章里面pip install distribute 有点用,于是执行了。
又执行一次安装 找到了


    Complete output from command python setup.py egg_info:
    Download error on https://pypi.python.org/simple/pytest-runner/: _s
 The handshake operation timed out -- Some packages may not be found!
    Couldn't find index page for 'pytest-runner' (maybe misspelled?)
    Traceback (most recent call last):
      File "<string>", line 1, in <module>


看来确实少相关包pytest-runner  pip install pytest-runner安装之后再执行,成功!!!

Collecting macropy3==1.1.0b2 (from javascripthon>=0.10; python_version > "3.4"->
pyecharts-javascripthon==0.0.6->pyecharts)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/8c/b7/a61f9d9bd7de80ca5
1ef362db5bb6434ea21484c907d2a5f396d97b0274c/macropy3-1.1.0b2.tar.gz (44kB)
    46% |███████████████                 | 20kB 639kB/s eta 0:00:
    69% |██████████████████████          | 30kB 903kB/s et
    92% |█████████████████████████████▌  | 40kB 73
    100% |████████████████████████████████| 51kB
 898kB/s
Building wheels for collected packages: future, jupyter-echarts-pypkg, MarkupSaf
e, javascripthon, macropy3
  Running setup.py bdist_wheel for future ... done
  Stored in directory: C:\Users\...\AppData\Local\pip\Cache\wheels\80\3f\
0b\4d1da7daebd00c2e113014d194fc9e799904e3115f5f828def
  Running setup.py bdist_wheel for jupyter-echarts-pypkg ... done
  Stored in directory: C:\Users\...\AppData\Local\pip\Cache\wheels\01\74\
fe\1100c2d34c7a471d6764b79f70d9acea500f5d043b000f688f
  Running setup.py bdist_wheel for MarkupSafe ... done
  Stored in directory: C:\Users\...\AppData\Local\pip\Cache\wheels\d7\a0\
93\442333b07631d4167735a3876491458a2c2c959370dce71469
  Running setup.py bdist_wheel for javascripthon ... done
  Stored in directory: C:\Users\...\AppData\Local\pip\Cache\wheels\e4\f4\
ee\34d402b4b558f559fa9fb685ed5b87267c91448c2e58860028
  Running setup.py bdist_wheel for macropy3 ... done
  Stored in directory: C:\Users\...\AppData\Local\pip\Cache\wheels\be\4f\
0c\d94e95094ebe672eb3eeda339d1f467f7b1408bddee6f5a347
Successfully built future jupyter-echarts-pypkg MarkupSafe javascripthon macropy
3
Installing collected packages: lml, MarkupSafe, jinja2, future, pillow, jupyter-
echarts-pypkg, dukpy, macropy3, javascripthon, pyecharts-javascripthon, pyechart
s
Successfully installed MarkupSafe-1.0 dukpy-0.2.0 future-0.16.0 javascripthon-0.
10 jinja2-2.10 jupyter-echarts-pypkg-0.1.2 lml-0.0.2 macropy3-1.1.0b2 pillow-5.2
.0 pyecharts-0.5.6 pyecharts-javascripthon-0.0.6

 

检查

用安装命令检查一下是否安装成功,或者用pip list也可以

piplist结果

pyecharts                   0.5.6
pyecharts-javascripthon     0.0.6
pyecharts-jupyter-installer 0.0.3

 

pip install pyecharts结果

Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Requirement already satisfied: pyecharts in e:\lonson\program files\python\pytho
n35\lib\site-packages (0.5.6)
Requirement already satisfied: jinja2 in e:\lonson\program files\python\python35
\lib\site-packages (from pyecharts) (2.10)
Requirement already satisfied: jupyter-echarts-pypkg==0.1.2 in e:\lonson\program
 files\python\python35\lib\site-packages (from pyecharts) (0.1.2)
Requirement already satisfied: pillow in e:\lonson\program files\python\python35
\lib\site-packages (from pyecharts) (5.2.0)
Requirement already satisfied: pyecharts-javascripthon==0.0.6 in e:\lonson\progr
am files\python\python35\lib\site-packages (from pyecharts) (0.0.6)
Requirement already satisfied: lml==0.0.2 in e:\lonson\program files\python\pyth
on35\lib\site-packages (from pyecharts) (0.0.2)
Requirement already satisfied: future in e:\lonson\program files\python\python35
\lib\site-packages (from pyecharts) (0.16.0)
Requirement already satisfied: MarkupSafe>=0.23 in e:\lonson\program files\pytho
n\python35\lib\site-packages (from jinja2->pyecharts) (1.0)
Requirement already satisfied: pyecharts-jupyter-installer==0.0.3 in e:\lonson\p
rogram files\python\python35\lib\site-packages (from jupyter-echarts-pypkg==0.1.
2->pyecharts) (0.0.3)
Requirement already satisfied: javascripthon>=0.10; python_version > "3.4" in e:
\lonson\program files\python\python35\lib\site-packages (from pyecharts-javascri
pthon==0.0.6->pyecharts) (0.10)
Requirement already satisfied: dukpy in e:\lonson\program files\python\python35\
lib\site-packages (from javascripthon>=0.10; python_version > "3.4"->pyecharts-j
avascripthon==0.0.6->pyecharts) (0.2.0)
Requirement already satisfied: macropy3==1.1.0b2 in e:\lonson\program files\pyth
on\python35\lib\site-packages (from javascripthon>=0.10; python_version > "3.4"-
>pyecharts-javascripthon==0.0.6->pyecharts) (1.1.0b2)
Requirement already satisfied: setuptools in e:\lonson\program files\python\pyth
on35\lib\site-packages (from javascripthon>=0.10; python_version > "3.4"->pyecha
rts-javascripthon==0.0.6->pyecharts) (28.8.0)

展开阅读全文

没有更多推荐了,返回首页