- 博客(24)
- 收藏
- 关注
原创 安装mysql-python 包错误解决
安装 _MySQL-python-1.2.5.zip mysql.c:44:10: fatal error: my_config.h: No such file or directory。_mysql.c:44:10: fatal error: my_config.h: 没有那个文件或目录。_mysql.c:44:10: fatal error: my_config.h: 没有那个文件或目录。
2024-04-17 14:12:57
390
1
原创 ubuntu20.04 安装cudnn
下载cudnn:cudnn-local-repo-ubuntu2004-8.8.1.3_1.0-1_amd64.deb解压并安装:sudo dpkg -i cudnn-local-repo-ubuntu2004-8.8.1.3_1.0-1_amd64.deb更新源。
2023-11-06 17:40:17
2373
1
原创 paddleocr 报错:FatalError: `Segmentation fault` is detected by the operating system.
运行环境:cuda 10.2cudnn 8.5paddleocr CPU 的时候没事,GPU报错如下,报错信息:段错误 (核心已转储)原因:cudnn 版本太高了,和cuda不匹配;官网推荐cudnn7.6。
2023-06-16 18:19:33
2841
原创 MacOS 配置VSCode C/C++ 开发和环境
1、下载VSCode:https://code.visualstudio.com/Download2、按照C/C++插件:按快捷键:shift+command+X并在搜索框输入 c/c++,然后点击进行安装C/C++,这个肯定是必须的: 2)、 C/C++ Snippets,即 C/C++重用代码块。 3)、 C/C++ Advanced Lint,即 C/C++静态检测 。 4)、 Code Runner,即代码运行。 ...
2021-11-12 16:26:15
4573
原创 为什么python需要wsgi
为什么python需要wsgi为什么python web应用程序需要wsgi作为应用程序开发人员,您不必担心WSGI。您需要了解的就是这些框架都支持WSGI。WSGI是将Web服务器(如:nginx)和Web应用程序代码(如django、flask)分开的。如果您是Web框架开发人员(正在开发DJango或Zope本身),那么您必须更深入地了解WSGI。 WSGI是Python 为编写Web框架提供的PEP 3333的标准,基本上,它提供了用Python编写的Web应用程序和Web服务器之间的标准接口。
2021-03-22 09:31:18
868
原创 cv2 获取图片亮度值
# 读取图片rgb_image = cv2.imread("/Users/kunlun/Downloads/bai.png")image = cv2.cvtColor(rgb_image, cv2.COLOR_BGR2GRAY)print("图片亮度值为:", image.mean())图片亮度值为: 0.0图片亮度值为: 255.0或者cv2.mean(image) 也可以...
2020-10-13 15:55:50
4958
原创 Linux 下使用pyinstaller 打包 PyQt 应用 缺少 libpython问题
如果打包时出现错误:OSError: Python library not found: Python8, libpython3.8m.dylib, Python, libpython3.8.dylib, .Python This would mean your Python installation doesn't come with proper library files. This usually happens by missing development packag...
2020-09-02 15:24:03
1070
原创 python3 字符串 16进制 相互转换
def str_to_hex(s): """ 字符串 转 16进制 :param s: :return: """ return ' '.join([c.encode().hex() for c in s])def hex_to_str(self, s): """ 16进制转 bytes :param s: :return: """ return bytes.fromhex(s)...
2020-07-02 16:26:48
1965
原创 Tornado html生成动态pdf
from tornado import templateloader = template.Loader("/user/Desktop/") # out.html 的路径content = loader.load("out.html").generate(data=data) # data是向out.html 里渲染的{}数据config = pdfkit.configuration...
2019-07-18 15:53:12
702
原创 安装 pylibmc 出错
错误栈:Collecting pylibmc==1.6.0 Using cached https://files.pythonhosted.org/packages/f4/09/58b9621fc4e0433037b70f053e51a053406e75ec5f68522dcb887792bc1f/pylibmc-1.6.0.tar.gzInstalling collected pack...
2019-03-24 20:21:25
1921
3
原创 Mac 安装python虚拟环境以及指定版本的虚拟环境 virtualenv、virtualenvwrapper
1、安装virtualenv pip install virtualenv2、创建一个目录,例如:my_test_envs mkdir my_test_envs3、cd 到my_test_envs,创建虚拟环境 virtualenv wx_venv4、激活虚拟环境wx_venv source [你的路径] wx_venv/bin/...
2018-11-06 11:17:13
1544
1
原创 Python 上传图片到 OSS
# -*- coding: utf-8 -*-import oss2, uuiddef oss(img_key, img_path): auth = oss2.Auth('LTA。。。。。。', '3XkJh。。。。。。') endpoint = 'http://oss-cn-qingdao.aliyuncs.com' bucket = oss2.Bucket(...
2018-07-23 23:38:53
5654
原创 MAC 安装 M2Crypto 失败,找不到 openssl文件
直接在终端运行下面这条命令:sudo env LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include" SWIG_FEAURES="-cpperraswarn -includeall -I$(brew --prefix openssl)/include" pip insta...
2018-07-17 15:26:11
1476
原创 全国行政区域 json 数据
[{ "_id": "593f9c1dcf33985daebb0c96", "level": 0, "name": "内蒙古自治区", "code": 150000}, { "_id": "593f9c1ecf33985daebb0c97", "level": 1, "parent": "593f9c
2018-03-31 15:06:37
5044
原创 django 生成动态的PDF文件
WeasyPrint,它是一个Python库可以生成PDF文件从HTML模板中。安装WeasyPrintpip install WeasyPrint创建一个PDF模板(template)我们需要一个HTML文档给WeasyPrint输入。我们将要创建一个HTML模板(template),渲染它使用Django,并且传递它给WeasyPrint来生成PDF文件。创建一个新的模板(template)文...
2018-03-28 14:35:35
3628
5
转载 centos7 下通过nginx+uwsgi部署django应用
1. 安装python3.61. 获取wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tgztar -xzvf Python-3.6.2.tgz -C /tmpcd /tmp/Python-3.6.2/2. 把Python3.6安装到 /usr/local 目录./configure --prefix=/usr...
2018-03-28 10:27:43
406
原创 django queryset 序列化为 json 数据
class UsersObjectListMixin(View): """封装返回列表页数据""" model = None def get(self, request): response = {} try: queryset = self.model.objects.all() response['lis...
2018-03-28 09:22:23
5216
原创 栅格系统
栅格系统 .container div:nth-of-type(2n+1){ border: 1px solid black; background-color: red; } .container div:nth
2017-04-15 11:36:56
414
原创 用HTML5实现网页版简历
个人简历 html{ height: 100%; } body{ height: 100%; background-repeat: no-repeat; background-size:100% 100%;
2017-04-08 17:45:39
8844
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人