Windows的Python环境引入fdfs_client-py包遇到的问题

在本地开发django时
windows的Python环境引入fdfs_client-py-master包遇到的问题
详情:
网上下载 fdfs_client-py-master.zip 解压
cd 到解压后的路径fdfs_client-py-master
敲入:python setup.py install
报错:
error: Microsoft Visual C++ 14.0 is required.
这时到控制面板确认此程序已安装,问题不在这。
于是百度,发现WIN下需要删除一些代码段:
1.解压后的fdfs_client-py-master\fdfs_client 目录下的storage_client.py

屏蔽第12行 # from fdfs_client.sendfile import *

 1 #!/usr/bin/env python
 2 # -*- coding: utf-8 -*-
 3 # filename: storage_cliet.py
 4 
 5 import os, stat
 6 import struct
 7 import socket
 8 import datetime
 9 import errno
10 from fdfs_client.fdfs_protol import *
11 from fdfs_client.connection import *
12 # from fdfs_client.sendfile import *   屏蔽我~
13 from fdfs_client.exceptions import (
14     FDFSError,
15     ConnectionError,
16     ResponseError,
17     InvaildResponse,
18     DataError
19 )

2.解压后的fdfs_client-py-master 目录下的setup.py

屏蔽sdict字典中的 ‘ext_modules’

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'])],    屏蔽我~
}

完成以上两步,接着安装 pip install mutagen 和 pip install requests ,不然会提示缺少此两个包。
最后 python setup.py install ,成功!
在这里插入图片描述
在这里插入图片描述

  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 6
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

积极向上的Coder

一杯咖啡支持原创,技术支持

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值