Python Pip 被 sys.stderr.write(f“ERROR: {exc}”) centos:7 损坏

时间:2021-02-25 16:06:15

标签: python docker pip centos sympy

upgrade Pip 我注意到我的 Python 坏了。之后所有 pip 命令都以 SyntaxError 结束

以下是我的 docker 命令:

FROM centos:7
ENV LANG en_US.UTF-8
RUN yum clean all && yum -y update &&  yum install epel-release -y && yum install python-pip R 
libcurl-devel openssl-devel -y
RUN pip install --upgrade pip
RUN pip install sympy
WORKDIR /root/
COPY ./ agro-green/
WORKDIR /root/agro-green/
RUN Rscript build/install.R

错误如下:

Step 4/9 : RUN pip install --upgrade pip
Using cache
9f731589b8b7
Step 5/9 : RUN pip install sympy
Running in c60ca73cc452
[91mTraceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
load_entry_point('pip==21.0.1', 'console_scripts', 'pip')()
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 378, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2566, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2260, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/usr/lib/python2.7/site-packages/pip/_internal/cli/ma`enter code here`in.py", line 60
sys.stderr.write(f"ERROR: {exc}")`enter code here`
                               ^`enter code here`
 SyntaxError: invalid syntax
 [0mThe command '/bin/sh -c pip install sympy' returned a non-zero code: 1
 Build step 'Execute shell' marked build as failure
 Finished: FAILURE` enter code here`

0 个答案:

没有答案