windows安装fdfs_client-py-master.zip 出现 error: Microsoft Visual C++ 14.0 is required.

网上下载 fdfs_client-py-master.zip 解压

cd 到解压后的路径fdfs_client-py-master

敲入:python setup.py install

报错:

 error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/

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_client.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 )
20 from fdfs_client.utils import *

在安装包的根目录下有一个setup.py里的sdict中键为ext_modules的这组键值对

#!/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)

注释完成之后,在分别安装pip install mutagen  和 pip install requests 

这两个包也安装完成后,再去那个目录下执行

python setup.py install 

 

转载于:https://www.cnblogs.com/Hannibal-2018/p/11166249.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值