zoukankan      html  css  js  c++  java
  • windows安装fdfs_client-py-master.zip 出现 error: Microsoft Visual C++ 14.0 is required.

    背景:学习django+fdfs+nginx时碰见的问题,笔记本电脑的虚拟机ubuntu实在卡到怀疑人生,所以django装在windows,ubuntu只开启fdfs+nginx服务。于是就有在windows下安装fdfs client的需求,先提醒一下,有条件还是在linux下学习开发好~

    详情:

    网上下载 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-masterfdfs_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 ,成功!

     

    总结:人生苦短,我想在linux下学python。

  • 相关阅读:
    WSP部署错误—SharePoint管理框架中的对象“SPSolutionLanguagePack Name=0”依赖其他不存在的对象
    Elevate Permissions To Modify User Profile
    Error with Stsadm CommandObject reference not set to an instance of an object
    ASP.NET MVC3添加Controller时没有Scaffolding options
    测试使用Windows Live Writer写日志
    配置TFS 2010出现错误—SQL Server 登录的安全标识符(SID)与某个指定的域或工作组帐户冲突
    使用ADO.NET DbContext Generator出现错误—Unable to locate file
    CSS
    HTML DIV标签
    数据库
  • 原文地址:https://www.cnblogs.com/wanghaiqi24/p/10035896.html
Copyright © 2011-2022 走看看