fdfs-client-py安装

1.下载依赖包

pip install mutagen
pip install requests

2.下载fdfs_client-py

下载fdfs_client-py

3.编译fdfs_client-py

3.1编译前准备

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)


打开 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 *

注意

如果没有注释以上内容编译时会报如下错误

building 'fdfs_client.sendfile' extension error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ 

2.修改utils.py中的from mutagen.._compat import StringIOfrom mutagen._senf._compat import StringIO

img

注意

如果没有注释以上内容编译时会报如下错误

No module named 'mutagen._compat'

3.2开始编译

在压缩包的setup.py的目录下运行如下命令

 python setup.py install
  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值