问题:Django项目中安装fdfs-client-py 失败
报错:
building 'fdfs_client.sendfile' extension error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++
解决方式:
1.打开 setup.py 注释掉34和35行
#!/usr/bin/env python
import os
from fdfs_client import __version__
try:
from setuptools import setup, Extension
except ImportError:
from distutils.core import setup, Extension
f = open(os.path.join(os.path.dirname(__file__), 'README.md'))
long_description = f.read()
f.close()
sdict = {
'name': 'fdfs_client-py',
'version': __version__,
'description': 'Python client for Fastdfs ver 4.06',
'long_description': long_description,
'author': 'scott yuan',
'author_email': 'scottzer8@gmail.com',
'maintainer': 'scott yuan',
'maintainer_email': 'scottzer8@gmail.com',
'keywords': ['Fastdfs', 'Distribute File System'],
'license': 'GPLV3',
'packages': ['fdfs_client'],
'classifiers': [
'Development Status :: 1 - Production/Beta',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: GPLV3',
'Operating System :: OS Independent',
'Programming Language :: Python'],
#注释掉以下两行
# 'ext_modules': [Extension('fdfs_client.sendfile',
# sources=['fdfs_client/sendfilemodule.c'])],
}
setup(**sdict)
2.打开 storage_client.py 注释 12行
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# filename: storage_client.py
import os, stat
import struct
import socket
import datetime
import errno
from fdfs_client.fdfs_protol import *
from fdfs_client.connection import *
#from fdfs_client.sendfile import * #注释掉
from fdfs_client.exceptions import (
FDFSError,
ConnectionError,
ResponseError,
InvaildResponse,
DataError
)
from fdfs_client.utils import *
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 【自荐】一款简洁、开源的在线白板工具 Drawnix