我尝试通过pip安装flask-bcrypt,但是这引起了我的错误:
error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat)
我目前正在Visual Studio 2015 RC
上使用Python 3
运行Windows 10
。
如何解决此错误?
修改 我试图遵循不同的解决方案并安装Visual Studio 2010 Express,现在我遇到了以下错误(在VS 2013中通过PIP安装):
Collecting py-bcrypt
Using cached py-bcrypt-0.4.tar.gz
Installing collected packages: py-bcrypt
Running setup.py install for py-bcrypt
Complete output from command "C:\Users\Niels\Documents\Visual Studio 2013\Projects\biospark\biospark\env_biospark\Scripts\python.exe" -c "import setuptools, tokenize;__file__='C:\\Users\\Niels\\AppData\\Local\\Temp\\pip-build-3pqnujd2\\py-bcrypt\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\Niels\AppData\Local\Temp\pip-syaty7au-record\install-record.txt --single-version-externally-managed --compile --install-headers "C:\Users\Niels\Documents\Visual Studio 2013\Projects\biospark\biospark\env_biospark\include\site\python3.4\py-bcrypt":
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.4
creating build\lib.win-amd64-3.4\bcrypt
copying bcrypt\__init__.py -> build\lib.win-amd64-3.4\bcrypt
running build_ext
building 'bcrypt._bcrypt' extension
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Niels\AppData\Local\Temp\pip-build-3pqnujd2\py-bcrypt\setup.py", line 61, in <module>
ext_modules = [bcrypt]
File "C:\Users\Niels\Anaconda3\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\Niels\Anaconda3\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\Users\Niels\Anaconda3\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\Niels\Documents\Visual Studio 2013\Projects\biospark\biospark\env_biospark\lib\site-packages\setuptools-15.1-py3.4.egg\setuptools\command\install.py", line 61, in run
File "C:\Users\Niels\Anaconda3\lib\distutils\command\install.py", line 539, in run
self.run_command('build')
File "C:\Users\Niels\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\Niels\Anaconda3\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\Niels\Anaconda3\lib\distutils\command\build.py", line 126, in run
self.run_command(cmd_name)
File "C:\Users\Niels\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\Niels\Anaconda3\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\Niels\Documents\Visual Studio 2013\Projects\biospark\biospark\env_biospark\lib\site-packages\setuptools-15.1-py3.4.egg\setuptools\command\build_ext.py", line 50, in run
File "C:\Users\Niels\Anaconda3\lib\distutils\command\build_ext.py", line 339, in run
self.build_extensions()
File "C:\Users\Niels\Anaconda3\lib\distutils\command\build_ext.py", line 448, in build_extensions
self.build_extension(ext)
File "C:\Users\Niels\Documents\Visual Studio 2013\Projects\biospark\biospark\env_biospark\lib\site-packages\setuptools-15.1-py3.4.egg\setuptools\command\build_ext.py", line 183, in build_extension
File "C:\Users\Niels\Anaconda3\lib\distutils\command\build_ext.py", line 503, in build_extension
depends=ext.depends)
File "C:\Users\Niels\Anaconda3\lib\distutils\msvc9compiler.py", line 460, in compile
self.initialize()
File "C:\Users\Niels\Anaconda3\lib\distutils\msvc9compiler.py", line 371, in initialize
vc_env = query_vcvarsall(VERSION, plat_spec)
File "C:\Users\Niels\Documents\Visual Studio 2013\Projects\biospark\biospark\env_biospark\lib\site-packages\setuptools-15.1-py3.4.egg\setuptools\msvc9_support.py", line 52, in query_vcvarsall
File "C:\Users\Niels\Anaconda3\lib\distutils\msvc9compiler.py", line 287, in query_vcvarsall
raise ValueError(str(list(result.keys())))
ValueError: ['path']
----------------------------------------
Command ""C:\Users\Niels\Documents\Visual Studio 2013\Projects\biospark\biospark\env_biospark\Scripts\python.exe" -c "import setuptools, tokenize;__file__='C:\\Users\\Niels\\AppData\\Local\\Temp\\pip-build-3pqnujd2\\py-bcrypt\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\Niels\AppData\Local\Temp\pip-syaty7au-record\install-record.txt --single-version-externally-managed --compile --install-headers "C:\Users\Niels\Documents\Visual Studio 2013\Projects\biospark\biospark\env_biospark\include\site\python3.4\py-bcrypt"" failed with error code 1 in C:\Users\Niels\AppData\Local\Temp\pip-build-3pqnujd2\py-bcrypt
'py-bcrypt' failed to install. Exit code: 1
编辑2:我通过Windows安装程序安装了pycrypto:https://github.com/axper/python3-pycrypto-windows-installer附带了bcrypt,符合我的需求。但解决原始问题会很好。
答案 0 :(得分:1)
显然,首先安装py-bcrypt可以解决问题。从reddit帖子的第一条评论中可以获得win32安装程序:
http://www.reddit.com/r/flask/comments/15q5xj/anyone_have_a_working_version_of_flaskbcrypt_for/