彻底解决python的pip install xxx报错(文末附所有依赖文件)

2024-05-08 03:12

本文主要是介绍彻底解决python的pip install xxx报错(文末附所有依赖文件),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

今天安装pip install django又报错了:

C:\Users\Administrator>pip install django
WARNING: Ignoring invalid distribution -ip (d:\soft\python\python38\lib\site-pac
kages)
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting django
  ERROR: HTTP error 403 while getting https://pypi.tuna.tsinghua.edu.cn/packages
/a1/b9/5adf3f78e4c7b762eb6f1140057bd128c978c3f85c08e412f951aef65f9e/Django-4.2.1
1-py3-none-any.whl (from https://pypi.tuna.tsinghua.edu.cn/simple/django/) (requ
ires-python:>=3.8)
ERROR: Could not install requirement django from https://pypi.tuna.tsinghua.edu.
cn/packages/a1/b9/5adf3f78e4c7b762eb6f1140057bd128c978c3f85c08e412f951aef65f9e/D
jango-4.2.11-py3-none-any.whl because of HTTP error 403 Client Error: Forbidden
for url: https://pypi.tuna.tsinghua.edu.cn/packages/a1/b9/5adf3f78e4c7b762eb6f11
40057bd128c978c3f85c08e412f951aef65f9e/Django-4.2.11-py3-none-any.whl for URL ht
tps://pypi.tuna.tsinghua.edu.cn/packages/a1/b9/5adf3f78e4c7b762eb6f1140057bd128c
978c3f85c08e412f951aef65f9e/Django-4.2.11-py3-none-any.whl (from https://pypi.tu
na.tsinghua.edu.cn/simple/django/) (requires-python:>=3.8)

报403错误,https://pypi.tuna.tsinghua.edu.cn/simple又拒绝我访问了,还是离线安装比较靠谱。

 

首先到PyPI · The Python Package Index搜索Django

188e891fa15147229cb6d370b13d9a9e.png

查询结果如下

8c28808e208d4182a320f51d8b763f2d.png Django 5.0.5,这个应该是最新版的,点进去看详细

36641fc8bfac434a8cbbc0b1ea86f301.png

从右上角的Latest version,知道5.0.5是最新版的, 不过我们不需要最新版的,从控制台报错得知,我们只需要这个版本:Django-4.2.11-py3-none-any.whl

 那我们点击左侧的Release history

e38332a24897439f8de39cf82dc085b2.png

找到4.2.11版本

 6f3666b19098413c8556741e22caf850.png

点进去看详情

9aa6e7a015aa4b7fbb5bd8004e37e1c0.png

然后点击Download files进行下载

2a429076fce84b8e9eeef18e899f0a4f.png

这时,会跳出一个选择下载文件画面,一个是源码包文件,一个是编译好的文件,根据控制台的提示,我们直接选择编译好的Django-4.2.11-py3-none-any.whl下载即可,下载速度可能会非常慢,请大家忍一忍。

 下载好的文件名是Django-4.2.11-py3-none-any.whl

 我们直接用命令行进入到这个文件所在的路径,然后使用以下命令进行安装:

pip install Django-4.2.11-py3-none-any.whl

不过还是报错了

C:\Users\Administrator>cd C:\Users\Administrator\Desktop

C:\Users\Administrator\Desktop>pip install Django-4.2.11-py3-none-any.whl
WARNING: Ignoring invalid distribution -ip (d:\soft\python\python38\lib\site-pac
kages)
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Processing c:\users\administrator\desktop\django-4.2.11-py3-none-any.whl
Collecting asgiref<4,>=3.6.0 (from Django==4.2.11)
  ERROR: HTTP error 403 while getting https://pypi.tuna.tsinghua.edu.cn/packages
/39/e3/893e8757be2612e6c266d9bb58ad2e3651524b5b40cf56761e985a28b13e/asgiref-3.8.
1-py3-none-any.whl (from https://pypi.tuna.tsinghua.edu.cn/simple/asgiref/) (req
uires-python:>=3.8)

ERROR: Could not install requirement asgiref<4,>=3.6.0 from https://pypi.tuna.ts
inghua.edu.cn/packages/39/e3/893e8757be2612e6c266d9bb58ad2e3651524b5b40cf56761e9
85a28b13e/asgiref-3.8.1-py3-none-any.whl (from Django==4.2.11) because of HTTP e
rror 403 Client Error: Forbidden for url: https://pypi.tuna.tsinghua.edu.cn/pack
ages/39/e3/893e8757be2612e6c266d9bb58ad2e3651524b5b40cf56761e985a28b13e/asgiref-
3.8.1-py3-none-any.whl for URL https://pypi.tuna.tsinghua.edu.cn/packages/39/e3/
893e8757be2612e6c266d9bb58ad2e3651524b5b40cf56761e985a28b13e/asgiref-3.8.1-py3-n
one-any.whl (from https://pypi.tuna.tsinghua.edu.cn/simple/asgiref/) (requires-p
ython:>=3.8)

 缺少依赖包:asgiref-3.8.1-py3-none-any.whl

 按照下载Django的方法,再下载asgiref-3.8.1-py3-none-any.whl进行安装

很幸运,直接搜出来就是3.8.1版本

92caa4b9ba02403eb9a052cf13c5cbaa.png

下载好asgiref-3.8.1-py3-none-any.whl后,直接安装,成功

C:\Users\Administrator\Desktop>pip install asgiref-3.8.1-py3-none-any.whl
WARNING: Ignoring invalid distribution -ip (d:\soft\python\python38\lib\site-pac
kages)
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Processing c:\users\administrator\desktop\asgiref-3.8.1-py3-none-any.whl
Requirement already satisfied: typing-extensions>=4 in d:\soft\python\python38\l
ib\site-packages (from asgiref==3.8.1) (4.11.0)
WARNING: Ignoring invalid distribution -ip (d:\soft\python\python38\lib\site-pac
kages)
Installing collected packages: asgiref
Successfully installed asgiref-3.8.1 

继续安装Django,又出现一个报错

C:\Users\Administrator\Desktop>pip install Django-4.2.11-py3-none-any.whl
WARNING: Ignoring invalid distribution -ip (d:\soft\python\python38\lib\site-pac
kages)
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Processing c:\users\administrator\desktop\django-4.2.11-py3-none-any.whl
Requirement already satisfied: asgiref<4,>=3.6.0 in d:\soft\python\python38\lib\
site-packages (from Django==4.2.11) (3.8.1)
Collecting sqlparse>=0.3.1 (from Django==4.2.11)
  ERROR: HTTP error 403 while getting https://pypi.tuna.tsinghua.edu.cn/packages
/43/5d/a0fdd88fd486b39ae1fd1a75ff75b4e29a0df96c0304d462fd407b82efe0/sqlparse-0.5
.0-py3-none-any.whl (from https://pypi.tuna.tsinghua.edu.cn/simple/sqlparse/) (r
equires-python:>=3.8)
ERROR: Could not install requirement sqlparse>=0.3.1 from https://pypi.tuna.tsin
ghua.edu.cn/packages/43/5d/a0fdd88fd486b39ae1fd1a75ff75b4e29a0df96c0304d462fd407
b82efe0/sqlparse-0.5.0-py3-none-any.whl (from Django==4.2.11) because of HTTP er
ror 403 Client Error: Forbidden for url: https://pypi.tuna.tsinghua.edu.cn/packa
ges/43/5d/a0fdd88fd486b39ae1fd1a75ff75b4e29a0df96c0304d462fd407b82efe0/sqlparse-
0.5.0-py3-none-any.whl for URL https://pypi.tuna.tsinghua.edu.cn/packages/43/5d/
a0fdd88fd486b39ae1fd1a75ff75b4e29a0df96c0304d462fd407b82efe0/sqlparse-0.5.0-py3-
none-any.whl (from https://pypi.tuna.tsinghua.edu.cn/simple/sqlparse/) (requires
-python:>=3.8)

 继续下载安装sqlparse-0.5.0-py3-none-any.whl

C:\Users\Administrator\Desktop>pip install sqlparse-0.5.0-py3-none-any.whl
WARNING: Ignoring invalid distribution -ip (d:\soft\python\python38\lib\site-pac
kages)
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Processing c:\users\administrator\desktop\sqlparse-0.5.0-py3-none-any.whl
WARNING: Ignoring invalid distribution -ip (d:\soft\python\python38\lib\site-pac
kages)
Installing collected packages: sqlparse
Successfully installed sqlparse-0.5.0

 又缺少一个包backports.zoneinfo-0.2.1-cp38-cp38-win_amd64.whl

C:\Users\Administrator\Desktop>pip install Django-4.2.11-py3-none-any.whl
WARNING: Ignoring invalid distribution -ip (d:\soft\python\python38\lib\site-pac
kages)
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Processing c:\users\administrator\desktop\django-4.2.11-py3-none-any.whl
Requirement already satisfied: asgiref<4,>=3.6.0 in d:\soft\python\python38\lib\
site-packages (from Django==4.2.11) (3.8.1)
Requirement already satisfied: sqlparse>=0.3.1 in d:\soft\python\python38\lib\si
te-packages (from Django==4.2.11) (0.5.0)
Collecting backports.zoneinfo (from Django==4.2.11)
  ERROR: HTTP error 403 while getting https://pypi.tuna.tsinghua.edu.cn/packages
/78/cc/e27fd6493bbce8dbea7e6c1bc861fe3d3bc22c4f7c81f4c3befb8ff5bfaf/backports.zo
neinfo-0.2.1-cp38-cp38-win_amd64.whl#sha256=4a0f800587060bf8880f954dbef70de6c11b
be59c673c3d818921f042f9954a6 (from https://pypi.tuna.tsinghua.edu.cn/simple/back
ports-zoneinfo/) (requires-python:>=3.6)
ERROR: Could not install requirement backports.zoneinfo from https://pypi.tuna.t
singhua.edu.cn/packages/78/cc/e27fd6493bbce8dbea7e6c1bc861fe3d3bc22c4f7c81f4c3be
fb8ff5bfaf/backports.zoneinfo-0.2.1-cp38-cp38-win_amd64.whl#sha256=4a0f800587060
bf8880f954dbef70de6c11bbe59c673c3d818921f042f9954a6 (from Django==4.2.11) becaus
e of HTTP error 403 Client Error: Forbidden for url: https://pypi.tuna.tsinghua.
edu.cn/packages/78/cc/e27fd6493bbce8dbea7e6c1bc861fe3d3bc22c4f7c81f4c3befb8ff5bf
af/backports.zoneinfo-0.2.1-cp38-cp38-win_amd64.whl for URL https://pypi.tuna.ts
inghua.edu.cn/packages/78/cc/e27fd6493bbce8dbea7e6c1bc861fe3d3bc22c4f7c81f4c3bef
b8ff5bfaf/backports.zoneinfo-0.2.1-cp38-cp38-win_amd64.whl#sha256=4a0f800587060b
f8880f954dbef70de6c11bbe59c673c3d818921f042f9954a6 (from https://pypi.tuna.tsing
hua.edu.cn/simple/backports-zoneinfo/) (requires-python:>=3.6)

下载安装backports.zoneinfo-0.2.1-cp38-cp38-win_amd64.whl

C:\Users\Administrator\Desktop>pip install backports.zoneinfo-0.2.1-cp38-cp38-wi
n_amd64.whl
WARNING: Ignoring invalid distribution -ip (d:\soft\python\python38\lib\site-pac
kages)
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Processing c:\users\administrator\desktop\backports.zoneinfo-0.2.1-cp38-cp38-win
_amd64.whl
WARNING: Ignoring invalid distribution -ip (d:\soft\python\python38\lib\site-pac
kages)
Installing collected packages: backports.zoneinfo
Successfully installed backports.zoneinfo-0.2.1

 继续安装,又有一个依赖tzdata-2024.1-py2.py3-none-any.whl

C:\Users\Administrator\Desktop>pip install Django-4.2.11-py3-none-any.whl
WARNING: Ignoring invalid distribution -ip (d:\soft\python\python38\lib\site-pac
kages)
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Processing c:\users\administrator\desktop\django-4.2.11-py3-none-any.whl
Requirement already satisfied: asgiref<4,>=3.6.0 in d:\soft\python\python38\lib\
site-packages (from Django==4.2.11) (3.8.1)
Requirement already satisfied: sqlparse>=0.3.1 in d:\soft\python\python38\lib\si
te-packages (from Django==4.2.11) (0.5.0)
Requirement already satisfied: backports.zoneinfo in d:\soft\python\python38\lib
\site-packages (from Django==4.2.11) (0.2.1)
Collecting tzdata (from Django==4.2.11)
  ERROR: HTTP error 403 while getting https://pypi.tuna.tsinghua.edu.cn/packages
/65/58/f9c9e6be752e9fcb8b6a0ee9fb87e6e7a1f6bcab2cdc73f02bb7ba91ada0/tzdata-2024.
1-py2.py3-none-any.whl (from https://pypi.tuna.tsinghua.edu.cn/simple/tzdata/) (
requires-python:>=2)
ERROR: Could not install requirement tzdata from https://pypi.tuna.tsinghua.edu.
cn/packages/65/58/f9c9e6be752e9fcb8b6a0ee9fb87e6e7a1f6bcab2cdc73f02bb7ba91ada0/t
zdata-2024.1-py2.py3-none-any.whl (from Django==4.2.11) because of HTTP error 40
3 Client Error: Forbidden for url: https://pypi.tuna.tsinghua.edu.cn/packages/65
/58/f9c9e6be752e9fcb8b6a0ee9fb87e6e7a1f6bcab2cdc73f02bb7ba91ada0/tzdata-2024.1-p
y2.py3-none-any.whl for URL https://pypi.tuna.tsinghua.edu.cn/packages/65/58/f9c
9e6be752e9fcb8b6a0ee9fb87e6e7a1f6bcab2cdc73f02bb7ba91ada0/tzdata-2024.1-py2.py3-
none-any.whl (from https://pypi.tuna.tsinghua.edu.cn/simple/tzdata/) (requires-p
ython:>=2)

继续下载安装tzdata-2024.1-py2.py3-none-any.whl

C:\Users\Administrator\Desktop>pip install tzdata-2024.1-py2.py3-none-any.whl
WARNING: Ignoring invalid distribution -ip (d:\soft\python\python38\lib\site-pac
kages)
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Processing c:\users\administrator\desktop\tzdata-2024.1-py2.py3-none-any.whl
WARNING: Ignoring invalid distribution -ip (d:\soft\python\python38\lib\site-pac
kages)
Installing collected packages: tzdata
Successfully installed tzdata-2024.1 

 终于安装成功

C:\Users\Administrator\Desktop>pip install Django-4.2.11-py3-none-any.whl
WARNING: Ignoring invalid distribution -ip (d:\soft\python\python38\lib\site-pac
kages)
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Processing c:\users\administrator\desktop\django-4.2.11-py3-none-any.whl
Requirement already satisfied: asgiref<4,>=3.6.0 in d:\soft\python\python38\lib\
site-packages (from Django==4.2.11) (3.8.1)
Requirement already satisfied: sqlparse>=0.3.1 in d:\soft\python\python38\lib\si
te-packages (from Django==4.2.11) (0.5.0)
Requirement already satisfied: backports.zoneinfo in d:\soft\python\python38\lib
\site-packages (from Django==4.2.11) (0.2.1)
Requirement already satisfied: tzdata in d:\soft\python\python38\lib\site-packag
es (from Django==4.2.11) (2024.1)
Requirement already satisfied: typing-extensions>=4 in d:\soft\python\python38\l
ib\site-packages (from asgiref<4,>=3.6.0->Django==4.2.11) (4.11.0)
WARNING: Ignoring invalid distribution -ip (d:\soft\python\python38\lib\site-pac
kages)
Installing collected packages: Django
Successfully installed Django-4.2.11

文中的asgiref-3.8.1-py3-none-any.whl、sqlparse-0.5.0-py3-none-any.whl、backports.zoneinfo-0.2.1-cp38-cp38-win_amd64.whl、tzdata-2024.1-py2.py3-none-any.whl、Django-4.2.11-py3-none-any.whl可以在下面的链接进行下载

https://download.csdn.net/download/svygh123/89276450

 

这篇关于彻底解决python的pip install xxx报错(文末附所有依赖文件)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/969139

相关文章

python: 多模块(.py)中全局变量的导入

文章目录 global关键字可变类型和不可变类型数据的内存地址单模块(单个py文件)的全局变量示例总结 多模块(多个py文件)的全局变量from x import x导入全局变量示例 import x导入全局变量示例 总结 global关键字 global 的作用范围是模块(.py)级别: 当你在一个模块(文件)中使用 global 声明变量时,这个变量只在该模块的全局命名空

每天认识几个maven依赖(ActiveMQ+activemq-jaxb+activesoap+activespace+adarwin)

八、ActiveMQ 1、是什么? ActiveMQ 是一个开源的消息中间件(Message Broker),由 Apache 软件基金会开发和维护。它实现了 Java 消息服务(Java Message Service, JMS)规范,并支持多种消息传递协议,包括 AMQP、MQTT 和 OpenWire 等。 2、有什么用? 可靠性:ActiveMQ 提供了消息持久性和事务支持,确保消

【Python编程】Linux创建虚拟环境并配置与notebook相连接

1.创建 使用 venv 创建虚拟环境。例如,在当前目录下创建一个名为 myenv 的虚拟环境: python3 -m venv myenv 2.激活 激活虚拟环境使其成为当前终端会话的活动环境。运行: source myenv/bin/activate 3.与notebook连接 在虚拟环境中,使用 pip 安装 Jupyter 和 ipykernel: pip instal

【机器学习】高斯过程的基本概念和应用领域以及在python中的实例

引言 高斯过程(Gaussian Process,简称GP)是一种概率模型,用于描述一组随机变量的联合概率分布,其中任何一个有限维度的子集都具有高斯分布 文章目录 引言一、高斯过程1.1 基本定义1.1.1 随机过程1.1.2 高斯分布 1.2 高斯过程的特性1.2.1 联合高斯性1.2.2 均值函数1.2.3 协方差函数(或核函数) 1.3 核函数1.4 高斯过程回归(Gauss

【学习笔记】 陈强-机器学习-Python-Ch15 人工神经网络(1)sklearn

系列文章目录 监督学习:参数方法 【学习笔记】 陈强-机器学习-Python-Ch4 线性回归 【学习笔记】 陈强-机器学习-Python-Ch5 逻辑回归 【课后题练习】 陈强-机器学习-Python-Ch5 逻辑回归(SAheart.csv) 【学习笔记】 陈强-机器学习-Python-Ch6 多项逻辑回归 【学习笔记 及 课后题练习】 陈强-机器学习-Python-Ch7 判别分析 【学

nudepy,一个有趣的 Python 库!

更多资料获取 📚 个人网站:ipengtao.com 大家好,今天为大家分享一个有趣的 Python 库 - nudepy。 Github地址:https://github.com/hhatto/nude.py 在图像处理和计算机视觉应用中,检测图像中的不适当内容(例如裸露图像)是一个重要的任务。nudepy 是一个基于 Python 的库,专门用于检测图像中的不适当内容。该

pip-tools:打造可重复、可控的 Python 开发环境,解决依赖关系,让代码更稳定

在 Python 开发中,管理依赖关系是一项繁琐且容易出错的任务。手动更新依赖版本、处理冲突、确保一致性等等,都可能让开发者感到头疼。而 pip-tools 为开发者提供了一套稳定可靠的解决方案。 什么是 pip-tools? pip-tools 是一组命令行工具,旨在简化 Python 依赖关系的管理,确保项目环境的稳定性和可重复性。它主要包含两个核心工具:pip-compile 和 pip

HTML提交表单给python

python 代码 from flask import Flask, request, render_template, redirect, url_forapp = Flask(__name__)@app.route('/')def form():# 渲染表单页面return render_template('./index.html')@app.route('/submit_form',

深入理解数据库的 4NF:多值依赖与消除数据异常

在数据库设计中, "范式" 是一个常常被提到的重要概念。许多初学者在学习数据库设计时,经常听到第一范式(1NF)、第二范式(2NF)、第三范式(3NF)以及 BCNF(Boyce-Codd范式)。这些范式都旨在通过消除数据冗余和异常来优化数据库结构。然而,当我们谈到 4NF(第四范式)时,事情变得更加复杂。本文将带你深入了解 多值依赖 和 4NF,帮助你在数据库设计中消除更高级别的异常。 什么是

Jenkins 插件 地址证书报错问题解决思路

问题提示摘要: SunCertPathBuilderException: unable to find valid certification path to requested target...... 网上很多的解决方式是更新站点的地址,我这里修改了一个日本的地址(清华镜像也好),其实发现是解决不了上述的报错问题的,其实,最终拉去插件的时候,会提示证书的问题,几经周折找到了其中一遍博文