building 'fdfs_client.sendfile' extension error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/ 错误
(env) D:\python_learn\meiduo_project>pip install fdfs_client-py-master.zip Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Processing d:\python_learn\meiduo_project\fdfs_client-py-master.zip Building wheels for collected packages: fdfs-client-py Building wheel for fdfs-client-py (setup.py) ... error ERROR: Command errored out with exit status 1: command: 'D:\python_learn\meiduo_project\env\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\sewen\\AppData\\Local\\Temp\\pip-req-build-9rb op60k\\setup.py'"'"'; __file__='"'"'C:\\Users\\sewen\\AppData\\Local\\Temp\\pip-req-build-9rbop60k\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().repla ce('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\sewen\AppData\Local\Temp\pip-wheel-wftmipvi' cwd: C:\Users\sewen\AppData\Local\Temp\pip-req-build-9rbop60k\ Complete output (23 lines): Traceback (most recent call last): File "<string>", line 1, in <module> File "C:\Users\sewen\AppData\Local\Temp\pip-req-build-9rbop60k\setup.py", line 37, in <module> setup(**sdict) File "D:\python_learn\meiduo_project\env\lib\site-packages\setuptools\__init__.py", line 165, in setup return distutils.core.setup(**attrs) File "D:\Python\Python38\lib\distutils\core.py", line 134, in setup ok = dist.parse_command_line() File "D:\Python\Python38\lib\distutils\dist.py", line 483, in parse_command_line args = self._parse_command_opts(parser, args) File "D:\python_learn\meiduo_project\env\lib\site-packages\setuptools\dist.py", line 929, in _parse_command_opts nargs = _Distribution._parse_command_opts(self, parser, args) File "D:\Python\Python38\lib\distutils\dist.py", line 539, in _parse_command_opts cmd_class = self.get_command_class(command) File "D:\python_learn\meiduo_project\env\lib\site-packages\setuptools\dist.py", line 768, in get_command_class self.cmdclass[command] = cmdclass = ep.load() File "D:\python_learn\meiduo_project\env\lib\site-packages\pkg_resources\__init__.py", line 2461, in load return self.resolve() File "D:\python_learn\meiduo_project\env\lib\site-packages\pkg_resources\__init__.py", line 2467, in resolve module = __import__(self.module_name, fromlist=['__name__'], level=0) File "D:\python_learn\meiduo_project\env\lib\site-packages\wheel\bdist_wheel.py", line 13, in <module> from qqemail.generator import Generator ModuleNotFoundError: No module named 'qqemail' ---------------------------------------- ERROR: Failed building wheel for fdfs-client-py Running setup.py clean for fdfs-client-py Failed to build fdfs-client-py Installing collected packages: fdfs-client-py Running setup.py install for fdfs-client-py ... error ERROR: Command errored out with exit status 1: command: 'D:\python_learn\meiduo_project\env\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\sewen\\AppData\\Local\\Temp\\pip-req-build-9 rbop60k\\setup.py'"'"'; __file__='"'"'C:\\Users\\sewen\\AppData\\Local\\Temp\\pip-req-build-9rbop60k\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().rep lace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\sewen\AppData\Local\Temp\pip-record-6cn1p_it\install-record.txt' - -single-version-externally-managed --compile --install-headers 'D:\python_learn\meiduo_project\env\include\site\python3.8\fdfs-client-py' cwd: C:\Users\sewen\AppData\Local\Temp\pip-req-build-9rbop60k\ Complete output (18 lines): running install running build running build_py creating build creating build\lib.win-amd64-3.8 creating build\lib.win-amd64-3.8\fdfs_client copying fdfs_client\client.py -> build\lib.win-amd64-3.8\fdfs_client copying fdfs_client\connection.py -> build\lib.win-amd64-3.8\fdfs_client copying fdfs_client\exceptions.py -> build\lib.win-amd64-3.8\fdfs_client copying fdfs_client\fdfs_protol.py -> build\lib.win-amd64-3.8\fdfs_client copying fdfs_client\fdfs_test.py -> build\lib.win-amd64-3.8\fdfs_client copying fdfs_client\storage_client.py -> build\lib.win-amd64-3.8\fdfs_client copying fdfs_client\tracker_client.py -> build\lib.win-amd64-3.8\fdfs_client copying fdfs_client\utils.py -> build\lib.win-amd64-3.8\fdfs_client copying fdfs_client\__init__.py -> build\lib.win-amd64-3.8\fdfs_client running build_ext building 'fdfs_client.sendfile' extension error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/ ---------------------------------------- ERROR: Command errored out with exit status 1: 'D:\python_learn\meiduo_project\env\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\sewen\\AppD ata\\Local\\Temp\\pip-req-build-9rbop60k\\setup.py'"'"'; __file__='"'"'C:\\Users\\sewen\\AppData\\Local\\Temp\\pip-req-build-9rbop60k\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\sewen\AppData\Local\Temp\pip-reco rd-6cn1p_it\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\python_learn\meiduo_project\env\include\site\python3.8\fdfs-client-py' Check the logs for full command output.
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 并 pip install fdfs_client-py-master.zip时报错
报错信息:
error: Microsoft Visual C++ 14.0 is required
这时到控制面板确认此程序已安装,或者已安装Microsoft Visual C++ 2005等 。
那么问题不是因为 版本不正确
经过百度,看论坛等方式发现错误原因是因为在windows安装fdfs_client 需要注释或者删除一些代码
解决方法
1.解压以下载的fdfs_client-py-master到任意位置,打开fdfs_client 目录下的storage_client.py文件
屏蔽第12行 # from fdfs_client.sendfile import *
2.解压后的fdfs_client-py-master 目录下的setup.py
屏蔽sdict字典中的 ‘ext_modules’
3.在将注释过的fdfs_client-py-master文件压缩成压缩文件,格式应为.zip
4.在pip install fdfs_client-py-master.zip 之前必须确保你的虚拟环境中以安装mutagen 和 requests,如果没有请先导入
pip install mutagen
pip install requests
5.在到你的fdfs_client-py-master.zip压缩包目录下导入即可成功运行
pip install fdfs_client-py-master.zip
显示安装成功