Docker defaulting to user installation because normal site-packages is not writeable

安装pyecharts提示:Defaulting to user installation because normal site-packages is not writeable

安装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

What does defaulting to user installation because normal site packages is not writeable mean?

The reason behind this is that you have multiple versions of Python and since you are using pip / pip3 it would try to add the packages in the default version of Python which is managed by Python and hence it will throw an error.

How do I install pip?

Ensure you can run pip from the command line.
Securely Download get-pip.py 1..
Run python get-pip.py . 2 This will install or upgrade pip. Additionally, it will install setuptools and wheel if they're not installed already. Warning..

How do I download requirements for texting?

txt file..
cd to the directory where requirements.txt is located..
activate your virtualenv..
run: pip install -r requirements.txt in your shell..

How do I download pip3 on Linux?

To install pip3 on Ubuntu or Debian Linux, open a new Terminal window and enter sudo apt-get install python3-pip . To install pip3 on Fedora Linux, enter sudo yum install python3-pip into a Terminal window. You will need to enter the administrator password for your computer in order to install this software.