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。

  • 相关阅读:
    终于明白迅雷使用积分制的真正作用和目的了(教大家改迅雷)
    免费搞QQ空间
    终于明白迅雷使用积分制的真正作用和目的了(教大家改迅雷)
    终于明白迅雷使用积分制的真正作用和目的了(教大家改迅雷)
    免费搞QQ空间
    免费搞QQ空间
    如何配置Windows Live Writer
    求PI的近似值,用公式PI/4=11/3+1/51/7+...
    求31000之间的素数
    通过Office 2007发布Blog
  • 原文地址:https://www.cnblogs.com/wanghaiqi24/p/10035896.html
Copyright © 2011-2022 走看看