python - 安装 opticspy 时遇到问题
问题描述
我最近一直在学习 python 并且一直在尝试将 opticspy 包(https://github.com/Sterncat/opticspy)安装到 Anaconda 包中。
使用命令:pip install git+git://github.com/Sterncat/opticspy.git@master
我一直收到此错误消息:
ERROR: Command errored out with exit status 1:
command: 'c:\users\dfsan\anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\dfsan\\AppData\\Local\\Temp\\pip-install-gjbmbml_\\unwrap\\setup.py'"'"'; __file__='"'"'C:\\Users\\dfsan\\AppData\\Local\\Temp\\pip-install-gjbmbml_\\unwrap\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: C:\Users\dfsan\AppData\Local\Temp\pip-install-gjbmbml_\unwrap\
Complete output (61 lines):
_cffi__x6083f2a6xc51c3213.c
c:\users\dfsan\anaconda3\include\pyconfig.h(222): fatal error C1083: Cannot open include file: 'basetsd.h': No such file or directory
Traceback (most recent call last):
File "c:\users\dfsan\anaconda3\lib\distutils\_msvccompiler.py", line 423, in compile
self.spawn(args)
File "c:\users\dfsan\anaconda3\lib\distutils\_msvccompiler.py", line 542, in spawn
return super().spawn(cmd)
File "c:\users\dfsan\anaconda3\lib\distutils\ccompiler.py", line 909, in spawn
spawn(cmd, dry_run=self.dry_run)
File "c:\users\dfsan\anaconda3\lib\distutils\spawn.py", line 38, in spawn
_spawn_nt(cmd, search_path, dry_run=dry_run)
File "c:\users\dfsan\anaconda3\lib\distutils\spawn.py", line 81, in _spawn_nt
"command %r failed with exit status %d" % (cmd, rc))
distutils.errors.DistutilsExecError: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.22.27905\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\dfsan\anaconda3\lib\site-packages\cffi\ffiplatform.py", line 51, in _build
dist.run_command('build_ext')
File "c:\users\dfsan\anaconda3\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\users\dfsan\anaconda3\lib\site-packages\setuptools\command\build_ext.py", line 78, in run
_build_ext.run(self)
File "c:\users\dfsan\anaconda3\lib\site-packages\Cython\Distutils\old_build_ext.py", line 186, in run
_build_ext.build_ext.run(self)
File "c:\users\dfsan\anaconda3\lib\distutils\command\build_ext.py", line 339, in run
self.build_extensions()
File "c:\users\dfsan\anaconda3\lib\site-packages\Cython\Distutils\old_build_ext.py", line 194, in build_extensions
self.build_extension(ext)
File "c:\users\dfsan\anaconda3\lib\site-packages\setuptools\command\build_ext.py", line 199, in build_extension
_build_ext.build_extension(self, ext)
File "c:\users\dfsan\anaconda3\lib\distutils\command\build_ext.py", line 533, in build_extension
depends=ext.depends)
File "c:\users\dfsan\anaconda3\lib\distutils\_msvccompiler.py", line 425, in compile
raise CompileError(msg)
distutils.errors.CompileError: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.22.27905\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\dfsan\AppData\Local\Temp\pip-install-gjbmbml_\unwrap\setup.py", line 14, in <module>
import unwrap.unwrap2D as unwrap2D
File "C:\Users\dfsan\AppData\Local\Temp\pip-install-gjbmbml_\unwrap\unwrap\__init__.py", line 3, in <module>
from unwrap.unwrap import unwrap
File "C:\Users\dfsan\AppData\Local\Temp\pip-install-gjbmbml_\unwrap\unwrap\unwrap.py", line 4, in <module>
from unwrap.unwrap2D import unwrap2D
File "C:\Users\dfsan\AppData\Local\Temp\pip-install-gjbmbml_\unwrap\unwrap\unwrap2D.py", line 20, in <module>
include_dirs=[_current_directory])
File "c:\users\dfsan\anaconda3\lib\site-packages\cffi\api.py", line 451, in verify
lib = self.verifier.load_library()
File "c:\users\dfsan\anaconda3\lib\site-packages\cffi\verifier.py", line 104, in load_library
self._compile_module()
File "c:\users\dfsan\anaconda3\lib\site-packages\cffi\verifier.py", line 201, in _compile_module
outputfilename = ffiplatform.compile(tmpdir, self.get_extension())
File "c:\users\dfsan\anaconda3\lib\site-packages\cffi\ffiplatform.py", line 22, in compile
outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
File "c:\users\dfsan\anaconda3\lib\site-packages\cffi\ffiplatform.py", line 58, in _build
raise VerificationError('%s: %s' % (e.__class__.__name__, e))
cffi.error.VerificationError: CompileError: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.22.27905\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
错误:命令出错,退出状态为 1:python setup.py egg_info 检查日志以获取完整的命令输出。
作为背景,我正在运行 python 3.6.5 并且 setuptools 和 pip 都是最新的(Windows btw)。谢谢你的帮助!
解决方案
推荐阅读
- c++ - 将 _bstr_t 对象传递给期望 BSTR 作为参数的函数是否安全?
- javascript - 如何根据反应中的另一个值在布尔值之间切换
- html - 尝试单击“赞”按钮时出现错误 此页面无法正常工作 HTTP 错误 405
- python - dynamodb 条件更新项(客户端)
- java - 使用java 8将for循环转换为流
- android - 尝试在空对象引用上调用虚拟方法 'android.os.Handler android.app.FragmentHostCallback.getHandler()'
- java - 如果您不知道某些元素是否存在,什么是好的 Selenium 策略?
- javascript - 数组是在函数中定义的,但是当返回它时,它会打印出 undefined
- html - 如何在 spring 控制器部分更改 modelandview 的视图内容?
- python - Gunicorn 粘贴选项