跳到主要内容

正中教室计算机下载并安装Python第三方库指南

Computer in the ZhengZhong Classroom: Guide to Downloading and Installing Python Third-Party Libraries

原文链接:zdzx.zhongzheng.tech/tech/tech_article_2

序言

设想一下:当你身处正中教室,你面前是正中教室的希沃大屏,你试图运行一个 Python 程序,但是解释器显示:ModuleNotFoundError: No module named ’xxx’\text{ModuleNotFoundError: No module named 'xxx'}

当然,其中,需要说明,也不太需要说明的是,正中教室计算机使用的操作系统为 Windows 操作系统\text{Windows 操作系统},通常为 Windows 10\text{Windows 10}[1,2] ^{[1,2]}


前言

How does the author introduce the topic?\text{How does the author introduce the topic?}

A.By describing an immersive scene.\text{A.By describing an immersive scene.}

B.By quoting a remark.\text{B.By quoting a remark.}

C.By making a comparison.\text{C.By making a comparison.}

D.By giving an explanation.\text{D.By giving an explanation.}

正文

As we all knowAwak众所周知\text{As we all know}\to\text{Awak}\to\text{众所周知}

AwakAwak,河北省石家庄市正定县有高中,名曰河北正定中学。

AwakAwak,河北正定中学里面有教室,其教室里面有希沃大屏。

AwakAwak,其希沃大屏中有希沃浏览器,希沃浏览器可以打开。

AwakAwak,在希沃浏览器中打开一个网址,通常只会无功而返。

易知

  • Maybe AwakMaybe\ Awak,正中网络限制大部分域名的访问。
  • AwakAwak,钉钉可以正常使用,也就是说没有限制钉钉相关域名的访问。

探索

山重水复疑无路

One day,I was in the classroom,One\ day,I\ was\ in\ the\ classroom, 尝试 inging 使用希沃浏览器打开钉钉官网。

Not AwakNot\ Awak钉钉的官网是:https://www.dingtalk.com/

显然。并非显然。 我当时不知道钉钉的官网。

Therefore,Therefore, 我进行了一些尝试:

www.dingding.com[1,1],[1,2] ^{[1,1],[1,2]}

www.dingding.cn[1,1],[1,2] ^{[1,1],[1,2]}

www.dingding.com.cn[1,1],[1,2] ^{[1,1],[1,2]}

www.dingding.net[1,1],[1,2] ^{[1,1],[1,2]}

并无收获。 Pain But No Gain.\text{Pain But No Gain.}

柳暗花明又一村

Awak\huge\text{Awak},钉钉是阿里的产品。

Then,Then, 我尝试了阿里云的官网(事实上,当时也不知道官网是什么,就尝试了一下)[1,1] ^{[1,1]}

https://www.aliyun.com/[1,1],[1,2] ^{[1,1],[1,2]}

It turned out:It\ turned\ out:

说明:此图片非当时图片,仅用作演示说明(此为 Firefox\text{Firefox} 浏览器)。

Now,I think you already have the answer in your heart.Now,I\ think\ you\ already\ have\ the\ answer\ in\ your\ heart.机翻

方法

As Python Developers Know,\text{As Python Developers Know,} 我们可以使用 Python 镜像源下载 Python 第三方库,使用内置 pip 包进行下载和安装操作。

欢迎使用CSDN平台:

请关注创作者:HAH-HAH(HAH_000000)

关于 Python pip 的使用,可以参见博客文章:【Python 基础】Python pip 使用指南(Windows 版)

因为学校没有限制阿里云的域名,所以我们可以使用阿里云的 Python 镜像源:

https://mirrors.aliyun.com/pypi/simple/

对于 Python pip 的使用,我们可以设置全局镜像源(在命令提示符中运行以下指令):

pip config set global.index-url [镜像源]

设置为阿里云镜像源即为:[1,2] ^{[1,2]}

pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/

或者单次安装使用镜像源:

pip install -i [镜像源] [库名]

使用阿里云镜像源进行安装即为:[1,2] ^{[1,2]}

pip install -i https://mirrors.aliyun.com/pypi/simple/ [库名]

如安装 pygame 库即为:[1,2] ^{[1,2]}

pip install -i https://mirrors.aliyun.com/pypi/simple/ pygame

常见问题

  • 你应确保所操作的计算机上已有 Python 环境且正常。[1,2] ^{[1,2]}
  • 你应确保所操作的计算机上已有 Python 的 pip 环境。[1,2] ^{[1,2]}

如果 \dots,那么你可以上网搜索以下词条:[1,2] ^{[1,2]}

  • 操作系统(或:Windows 操作系统)[1,2] ^{[1,2]}
  • Python[1,2] ^{[1,2]}
  • pip(或:Python pip)[1,2] ^{[1,2]}
  • Python 第三方库[1,2] ^{[1,2]}
  • 阿里云[1,2] ^{[1,2]}
  • 镜像源(或:Python 镜像源)[1,2] ^{[1,2]}
  • 命令提示符(或:cmd)[1,2] ^{[1,2]}

如果 pip 无法正常使用,请参见上述建议参考文章。[1,2] ^{[1,2]}

UPDATE

  • 2026.04.18 第一版(author:ZZA000HAHauthor:\text{ZZA000HAH}version:1.0.0‌version:1.0.0,说明:本次时间仓促,后续会对本文进行完善)。
  • 2026.04.26 第一版第一次更新(author:ZZA000HAHauthor:\text{ZZA000HAH}version:1.0.1‌version:1.0.1),更新见 [v,k],v=1,k=1[v,k],v=1,k=1
  • 2026.05.01/02 第一版第二次更新(author:ZZA000HAHauthor:\text{ZZA000HAH}version:1.0.2‌version:1.0.2),更新见 [v,k],v=1,k=2[v,k],v=1,k=2