Python共16篇
python
解决Ubuntu输入未知命令报错ModuleNotFoundError: No module named 'apt_pkg'-吾爱博客

解决Ubuntu输入未知命令报错ModuleNotFoundError: No module named ‘apt_pkg’

问题描述 Ubuntu下输入任意未知命令报错 Traceback (most recent call last): File '/usr/lib/command-not-found', line 28, in <module> from CommandNotFound import CommandNotFound File...
2023-10-30
03810
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.-吾爱博客

WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

Docker中使用pip install报错 解决方法 pip install xxxxx -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
2022-12-9
06920
python报错No module named 'PIL'-吾爱博客

python报错No module named ‘PIL’

直接使用pip install PIL提示找不到 运行安装pillow命令: pip install pillow
2022-10-6
01380
pip自定义源进行安装-吾爱博客

pip自定义源进行安装

pip默认的是国外源进行安装,可能会安装超时 使用清华源 pip install 要安装的包 -i https://pypi.tuna.tsinghua.edu.cn/simple
2022-5-27
0980
记录一下selenium打开chrome提示data:;解决方法-吾爱博客

记录一下selenium打开chrome提示data:;解决方法

在使用selenium写爬虫时打开chrome时不能正常打开网址,地址栏出现data:; 解决方法 options = webdriver.ChromeOptions() options.add_argument('--remote-debugging-port=9222') options.binar...
2022-5-27
019250
pip升级失败解决方案-吾爱博客

pip升级失败解决方案

今天在升级pip时,发现升级失败, time out 了 于是我们可以延长他的超时时间 python -m pip --default-timeout=800 install --upgrade pip 升级成功
2022-5-1
0430
python使用base64报错:AttributeError: partially initialized module 'base64' has no attribute 'b64encode'-吾爱博客

python使用base64报错:AttributeError: partially initialized module ‘base64’ has no attribute ‘b64encode’

python使用base64时报错:AttributeError: partially initialized module 'base64' has no attribute 'b64encode' 原因 发现文件名就是base64.py。。。 解决方法 文件改个名就好了
2022-3-29
06011
python爬虫IndexError: list index out of range错误-吾爱博客

python爬虫IndexError: list index out of range错误

在写python爬虫时数组部分遇到了IndexError: list index out of range错误 只要加上try.....except 错误机制跳过空值就行了 try: 出问题的代码 except IndexError: pass
2021-12-27
03821
python画一棵圣诞树-吾爱博客
Python - 希尔排序算法-吾爱博客

Python – 希尔排序算法

希尔排序是一种插入排序算法,又称作缩小增量排序。是对直接插入排序算法的改进。其基本思想是: 先取一个小于 n 的整数作为第一个增量,把全部数据分成个组。所有距离为的倍数的记录放在同一个...
2021-12-4
01862
Python - 直接插入排序算法-吾爱博客

Python – 直接插入排序算法

直接插入排序 把 n 个待排序的元素看成一个有序表和一个无序表, 开始时有序表中只有一个元素,无序表中有 n-1 个元素。 排序过程即每次从无序表中取出第一个元素, 将它插入到有序表中,使之成...
2021-12-4
01400
使用Python修改图片的MD5-吾爱博客

使用Python修改图片的MD5

MD5信息摘要算法(英语:MD5 Message-Digest Algorithm),一种被广泛使用的密码散列函数,可以产生出一个128位(16字节)的散列值(hash value),用于确保信息传输完整一致。 首先使用python...
2021-8-30
06250