安装pyecharts ,居然提示不可写入。
C:\Users\Tomcat>pip install pyecharts
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pyecharts in c:\users\Tomcat\appdata\roaming\python\python38\site-packages (1.9.0)
Requirement already satisfied: prettytable in c:\users\Tomcat\appdata\roaming\python\python38\site-packages (from pyecharts) (2.1.0)
Requirement already satisfied: jinja2 in c:\users\Tomcat\appdata\roaming\python\python38\site-packages (from pyecharts) (2.11.3)
Requirement already satisfied: simplejson in c:\users\Tomcat\appdata\roaming\python\python38\site-packages (from pyecharts) (3.17.2)
Requirement already satisfied: MarkupSafe>=0.23 in c:\users\Tomcat\appdata\roaming\python\python38\site-packages (from jinja2->pyecharts) (1.1.1)
Requirement already satisfied: wcwidth in c:\users\Tomcat\appdata\roaming\python\python38\site-packages (from prettytable->pyecharts) (0.2.5)
解决方法,增加参数target ,将路径site-packages写到参数中。
pip install --target=c:\users\Tomcat\appdata\roaming\python\python38\site-packages pyecharts
C:\Users\Tomcat>pip install --target=c:\users\Tomcat\appdata\roaming\python\python38\site-packages pyecharts
Collecting pyecharts
Downloading pyecharts-1.9.0-py3-none-any.whl (135 kB)
|████████████████████████████████| 135 kB 156 kB/s
Collecting jinja2
Downloading Jinja2-3.0.2-py3-none-any.whl (133 kB)
|████████████████████████████████| 133 kB 25 kB/s
Collecting simplejson
Downloading simplejson-3.17.5-cp38-cp38-win_amd64.whl (75 kB)
|████████████████████████████████| 75 kB 98 kB/s
Collecting prettytable
Downloading prettytable-2.2.1-py3-none-any.whl (23 kB)
Collecting MarkupSafe>=2.0
Downloading MarkupSafe-2.0.1-cp38-cp38-win_amd64.whl (14 kB)
Collecting wcwidth
Downloading wcwidth-0.2.5-py2.py3-none-any.whl (30 kB)
Installing collected packages: wcwidth, MarkupSafe, simplejson, prettytable, jinja2, pyecharts
Successfully installed MarkupSafe-2.0.1 jinja2-3.0.2 prettytable-2.2.1 pyecharts-1.9.0 simplejson-3.17.5 wcwidth-0.2.5
WARNING: Target directory c:\users\Tomcat\appdata\roaming\python\python38\site-packages\jinja2 already exists. Specify --upgrade to force replacement.
WARNING: Target directory c:\users\Tomcat\appdata\roaming\python\python38\site-packages\markupsafe already exists. Specify --upgrade to force replacement.
WARNING: Target directory c:\users\Tomcat\appdata\roaming\python\python38\site-packages\prettytable already exists. Specify --upgrade to force replacement.
WARNING: Target directory c:\users\Tomcat\appdata\roaming\python\python38\site-packages\pyecharts already exists. Specify --upgrade to force replacement.
WARNING: Target directory c:\users\Tomcat\appdata\roaming\python\python38\site-packages\pyecharts-1.9.0.dist-info already exists. Specify --upgrade to force replacement.
WARNING: Target directory c:\users\Tomcat\appdata\roaming\python\python38\site-packages\simplejson already exists. Specify --upgrade to force replacement.
WARNING: Target directory c:\users\Tomcat\appdata\roaming\python\python38\site-packages\wcwidth already exists. Specify --upgrade to force replacement.
WARNING: Target directory c:\users\Tomcat\appdata\roaming\python\python38\site-packages\wcwidth-0.2.5.dist-info already exists. Specify --upgrade to force replacement.
提示好多包存在,可以强制升级:
用upgrade 参数。
C:\Users\Tomcat>pip install --target=c:\users\Tomcat\appdata\roaming\python\python38\site-packages pyecharts --upgrade
Collecting pyecharts
Using cached pyecharts-1.9.0-py3-none-any.whl (135 kB)
Collecting jinja2
Using cached Jinja2-3.0.2-py3-none-any.whl (133 kB)
Collecting simplejson
Using cached simplejson-3.17.5-cp38-cp38-win_amd64.whl (75 kB)
Collecting prettytable
Using cached prettytable-2.2.1-py3-none-any.whl (23 kB)
Collecting MarkupSafe>=2.0
Using cached MarkupSafe-2.0.1-cp38-cp38-win_amd64.whl (14 kB)
Collecting wcwidth
Using cached wcwidth-0.2.5-py2.py3-none-any.whl (30 kB)
Installing collected packages: wcwidth, MarkupSafe, simplejson, prettytable, jinja2, pyecharts
Successfully installed MarkupSafe-2.0.1 jinja2-3.0.2 prettytable-2.2.1 pyecharts-1.9.0 simplejson-3.17.5 wcwidth-0.2.5