惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

美团技术团队
W
WeLiveSecurity
Stack Overflow Blog
Stack Overflow Blog
L
LangChain Blog
S
SegmentFault 最新的问题
Apple Machine Learning Research
Apple Machine Learning Research
Google DeepMind News
Google DeepMind News
F
Full Disclosure
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Register - Security
The Register - Security
G
Google Developers Blog
C
Check Point Blog
GbyAI
GbyAI
A
About on SuperTechFans
V
Vulnerabilities – Threatpost
T
The Blog of Author Tim Ferriss
T
Tor Project blog
AWS News Blog
AWS News Blog
Cyberwarzone
Cyberwarzone
C
CERT Recently Published Vulnerability Notes
MongoDB | Blog
MongoDB | Blog
Latest news
Latest news
aimingoo的专栏
aimingoo的专栏
U
Unit 42
Y
Y Combinator Blog
P
Privacy International News Feed
Cisco Talos Blog
Cisco Talos Blog
S
Securelist
S
Schneier on Security
雷峰网
雷峰网
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Attack and Defense Labs
Attack and Defense Labs
P
Proofpoint News Feed
C
Cisco Blogs
Webroot Blog
Webroot Blog
T
Troy Hunt's Blog
Google Online Security Blog
Google Online Security Blog
月光博客
月光博客
P
Privacy & Cybersecurity Law Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
罗磊的独立博客
Cloudbric
Cloudbric
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Hacker News: Ask HN
Hacker News: Ask HN
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - 司徒正美
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Microsoft Security Blog
Microsoft Security Blog

博客园 - emanlee

ubuntu 设置北京日期时间 mysql 在新电脑上导入,出现错误:ERROR at line 4019: Unknown command '\''. - emanlee 安装 yarn npm : 无法加载文件 C:\Program Files\nodejs\npm.ps1,因为在此系统上禁止运行脚本。 - emanlee VS code, 最近打开过哪些项目或文件夹,把这些备份下来,到另外一台电脑上恢复 傲梅分区助手 【好用】 ubuntu 可以使用Windows远程桌面连接吗?【可以】 把xshell的全部连接和密码,从一台Windows 10电脑,迁移到Windows11电脑。 Windows 远程桌面(mstsc)完整迁移方案(含历史连接记录、RDP 配置、保存的账号密码)【可行】 Endnote,如何能完整迁移库和模版 ubuntu 安装 locate “华为杯”第八届中国研究生人工智能创新大赛 当数据量很大时,执行 mysql> source filename.sql 很慢,有什么办法更快 部署Vue+Django 04c,mysql: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory Ubuntu Server 24.04 安装 MySQL, ./mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory ubuntu server 24.04: 如何设置默认采用 Xorg 方式登录 Ubuntu Server 24.04 设置锁屏时间 Ubuntu Server 启动过程中,比较慢 Job systemd-networkd-wait-online.service/start running Ubuntu Server 24.04 启用root用户 Ubuntu snap install 安装todesk是否必须检查 CPU 是否支持 AVX / AVX2 命令 Ubuntu Server 24.04下解决SunloginClient 向日葵依赖libgconf-2-4安装问题 Ubuntu Server 24.04 安装图形界面 ubuntu server 24.04 安装 中文输入法 Ubuntu Server 24.04 安装浏览器firefox Ubuntu Server 24.04 安装todesk【先联网,CPU必须支持 AVX / AVX2 】 Ubuntu Server 24.04 安装中文,汉字 Python赋值,什么时候传引用? 大驼峰命名法 python 容易理解类和对象的例子 django+mysql: 如何添加一个新的超级用户?
pip install django-ranged-response==0.2.0
emanlee · 2026-05-21 · via 博客园 - emanlee

(myvenv) root@aaa:~# pip install django-ranged-response==0.2.0 
Collecting django-ranged-response==0.2.0
  Using cached django-ranged-response-0.2.0.tar.gz (3.0 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [40 lines of output]
      running egg_info
      creating /tmp/pip-pip-egg-info-btfejxwz/django_ranged_response.egg-info
      writing /tmp/pip-pip-egg-info-btfejxwz/django_ranged_response.egg-info/PKG-INFO
      writing dependency_links to /tmp/pip-pip-egg-info-btfejxwz/django_ranged_response.egg-info/dependency_links.txt
      writing requirements to /tmp/pip-pip-egg-info-btfejxwz/django_ranged_response.egg-info/requires.txt
      writing top-level names to /tmp/pip-pip-egg-info-btfejxwz/django_ranged_response.egg-info/top_level.txt
      writing manifest file '/tmp/pip-pip-egg-info-btfejxwz/django_ranged_response.egg-info/SOURCES.txt'
      reading manifest file '/tmp/pip-pip-egg-info-btfejxwz/django_ranged_response.egg-info/SOURCES.txt'
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-4r40ycmm/django-ranged-response_a4f5d737fbd241e0aaff21e2fbabd40b/setup.py", line 5, in <module>
          setup(
        File "/home/glei/backend/myvenv/lib/python3.8/site-packages/setuptools/__init__.py", line 117, in setup
          return distutils.core.setup(**attrs)
        File "/home/glei/backend/myvenv/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 183, in setup
          return run_commands(dist)
        File "/home/glei/backend/myvenv/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 199, in run_commands
          dist.run_commands()
        File "/home/glei/backend/myvenv/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 954, in run_commands
          self.run_command(cmd)
        File "/home/glei/backend/myvenv/lib/python3.8/site-packages/setuptools/dist.py", line 999, in run_command
          super().run_command(command)
        File "/home/glei/backend/myvenv/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
          cmd_obj.run()
        File "/home/glei/backend/myvenv/lib/python3.8/site-packages/setuptools/command/egg_info.py", line 312, in run
          self.find_sources()
        File "/home/glei/backend/myvenv/lib/python3.8/site-packages/setuptools/command/egg_info.py", line 320, in find_sources
          mm.run()
        File "/home/glei/backend/myvenv/lib/python3.8/site-packages/setuptools/command/egg_info.py", line 546, in run
          self.prune_file_list()
        File "/home/guolei/backend/myvenv/lib/python3.8/site-packages/setuptools/command/sdist.py", line 162, in prune_file_list
          super().prune_file_list()
        File "/home/guolei/backend/myvenv/lib/python3.8/site-packages/setuptools/_distutils/command/sdist.py", line 380, in prune_file_list
          base_dir = self.distribution.get_fullname()
        File "/home/guolei/backend/myvenv/lib/python3.8/site-packages/setuptools/_core_metadata.py", line 267, in get_fullname
          return _distribution_fullname(self.get_name(), self.get_version())
        File "/home/glei/backend/myvenv/lib/python3.8/site-packages/setuptools/_core_metadata.py", line 285, in _distribution_fullname
          canonicalize_version(version, strip_trailing_zero=False),
      TypeError: canonicalize_version() got an unexpected keyword argument 'strip_trailing_zero'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

我看到你安装 django-ranged-response==0.2.0 时出现了setuptools 版本不兼容的报错,核心原因是:

这个旧包和你虚拟环境里新版 setuptools 不兼容,新版函数参数变了,导致安装失败

最简单、最稳妥的解决方法

直接在你的虚拟环境里执行这2 条命令

# 降级 setuptools 到兼容版本
pip install setuptools==57.5.0

# 重新安装目标包
pip install django-ranged-response==0.2.0

为什么会报错?

  • django-ranged-response==0.2.0非常老旧的包(2018 年)
  • 你虚拟环境里的 setuptools 版本太新,函数参数改了
  • 旧包调用 canonicalize_version() 时传了 strip_trailing_zero,新版已经不支持这个参数,直接报错

额外建议(避免以后再踩坑)

如果你之后还要安装其他旧 Python 包,可以一并把 wheel 也固定成稳定版:

pip install setuptools==57.5.0 wheel==0.37.1

总结

  1. 报错根源:新版 setuptools 不兼容旧包
  2. 解决:降级 setuptools == 57.5.0
  3. 再重新安装目标包即可成功