首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >生成backports.zoneinfo失败

生成backports.zoneinfo失败
EN

Stack Overflow用户
提问于 2022-05-16 20:26:51
回答 1查看 3.1K关注 0票数 -1

在终端中,我运行命令docker build .,但dockerfile无法安装。

代码语言:javascript
复制
 Building wheel for backports.zoneinfo (pyproject.toml): finished with status 'error'
  error: subprocess-exited-with-error
  
  × Building wheel for backports.zoneinfo (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [35 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-38
      creating build/lib.linux-x86_64-cpython-38/backports
      copying src/backports/__init__.py -> build/lib.linux-x86_64-cpython-38/backports
      creating build/lib.linux-x86_64-cpython-38/backports/zoneinfo
      copying src/backports/zoneinfo/__init__.py -> build/lib.linux-x86_64-cpython-38/backports/zoneinfo
      copying src/backports/zoneinfo/_zoneinfo.py -> build/lib.linux-x86_64-cpython-38/backports/zoneinfo
      copying src/backports/zoneinfo/_common.py -> build/lib.linux-x86_64-cpython-38/backports/zoneinfo
      copying src/backports/zoneinfo/_version.py -> build/lib.linux-x86_64-cpython-38/backports/zoneinfo
      copying src/backports/zoneinfo/_tzpath.py -> build/lib.linux-x86_64-cpython-38/backports/zoneinfo
      running egg_info
      writing src/backports.zoneinfo.egg-info/PKG-INFO
      writing dependency_links to src/backports.zoneinfo.egg-info/dependency_links.txt
      writing requirements to src/backports.zoneinfo.egg-info/requires.txt
      writing top-level names to src/backports.zoneinfo.egg-info/top_level.txt
      reading manifest file 'src/backports.zoneinfo.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      warning: no files found matching '*.png' under directory 'docs'
      warning: no files found matching '*.svg' under directory 'docs'
      no previously-included directories found matching 'docs/_build'
      no previously-included directories found matching 'docs/_output'
      adding license file 'LICENSE'
      adding license file 'licenses/LICENSE_APACHE'
      writing manifest file 'src/backports.zoneinfo.egg-info/SOURCES.txt'
      copying src/backports/zoneinfo/__init__.pyi -> build/lib.linux-x86_64-cpython-38/backports/zoneinfo
      copying src/backports/zoneinfo/py.typed -> build/lib.linux-x86_64-cpython-38/backports/zoneinfo
      running build_ext
      building 'backports.zoneinfo._czoneinfo' extension
      creating build/temp.linux-x86_64-cpython-38
      creating build/temp.linux-x86_64-cpython-38/lib
      gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/local/include/python3.8 -c lib/zoneinfo_module.c -o build/temp.linux-x86_64-cpython-38/lib/zoneinfo_module.o -std=c99
      error: command 'gcc' failed: No such file or directory
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for backports.zoneinfo
Failed to build backports.zoneinfo
ERROR: Could not build wheels for backports.zoneinfo, which is required to install pyproject.toml-based projects
WARNING: You are using pip version 22.0.4; however, version 22.1 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
The command '/bin/sh -c pip install -r /requirements.txt' returned a non-zero code: 1

我尝试过很多事情,比如:

代码语言:javascript
复制
pip install --upgrade pip wheel
pip install backports.zoneinfo
pip install tzdata
sudo apt-get install ruby-full

他们都帮不上忙。正如我在密码中看到的那样,我没有gcc。我试着安装。但失败了。

我的操作系统是Ubuntu20.04。Python 3.8.10

提前谢谢你。

EN

回答 1

Stack Overflow用户

发布于 2022-06-13 14:00:06

除了:

sudo apt-get install build-essential

正如@JanWilamowski所暗示的,你也需要。此命令安装gcc,即GNU编译器(与许多其他项一起)。

sudo apt-get install python3-dev

然后,如果您尝试pip install backports.zoninfo,如果应该像预期的那样工作。还应该注意的是,将这些安装在计算机上并不等同于将其安装在Docker容器中的。需要单独使用Docker编写文件来完成这些操作。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72265234

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档