2016-07-03 62 views
0

我有一个包含以下模块的requirements.txt文件:VIRTUALENV错误 - build_ext

Flask==0.10.1 
Flask-Login==0.3.1 
Flask-SQLAlchemy==2.0 
Jinja2==2.7.3 
MarkupSafe==0.23 
SQLAlchemy==0.9.8 
Werkzeug==0.9.6 
argparse==1.2.1 
itsdangerous==0.24 
rauth==0.7.0 
requests==2.4.3 

当我启动我的virtualenv安装这些模块.\venv\Scripts\activate SQLAlchemy的失败和MarkupSafe失败。如果我停用我的virtualenv,并且简单地pip install MarkupSafepip install SQLAlchemy - 他们成功安装。

我对此感到茫然。我曾尝试卸载/重新安装virtualenv & python - 并且与一位对Python颇有知识的朋友(他认为这是Windows环境特有的东西)进行了交谈,不幸的是,他对下一步尝试的方式感到不知所措。

我怀疑它可能有一些做的事实,我删除了一个名为“Python的”下的用户文件夹\ AppData的。在我试图卸载Python和从一张白纸开始......

下面是相关输出(或者至少,我认为是对输出的相关部分)与MarkupSafe相关:

Running setup.py clean for SQLAlchemy 
    Running setup.py bdist_wheel for markupsafe ... error 
    Complete output from command c:\test_oauth\venv\scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\SEANBA~1\\AppData\\Local\\Temp\\pip-build-pvc5zlcc\\markupsafe\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\ 
r\n', '\n'), __file__, 'exec'))" bdist_wheel -d C:\Users\SEANBA~1\AppData\Local\Temp\tmpkf78v48_pip-wheel- --python-tag cp35: 
    running bdist_wheel 
    running build 
    running build_py 
    creating build 
    creating build\lib.win32-3.5 
    creating build\lib.win32-3.5\markupsafe 
    copying markupsafe\tests.py -> build\lib.win32-3.5\markupsafe 
    copying markupsafe\_compat.py -> build\lib.win32-3.5\markupsafe 
    copying markupsafe\_constants.py -> build\lib.win32-3.5\markupsafe 
    copying markupsafe\_native.py -> build\lib.win32-3.5\markupsafe 
    copying markupsafe\__init__.py -> build\lib.win32-3.5\markupsafe 
    running egg_info 
    writing dependency_links to MarkupSafe.egg-info\dependency_links.txt 
    writing MarkupSafe.egg-info\PKG-INFO 
    writing top-level names to MarkupSafe.egg-info\top_level.txt 
    warning: manifest_maker: standard file '-c' not found 

    reading manifest file 'MarkupSafe.egg-info\SOURCES.txt' 
    reading manifest template 'MANIFEST.in' 
    writing manifest file 'MarkupSafe.egg-info\SOURCES.txt' 
    copying markupsafe\_speedups.c -> build\lib.win32-3.5\markupsafe 
    running build_ext 
    building 'markupsafe._speedups' extension 
    Traceback (most recent call last): 
    File "<string>", line 1, in <module> 
    File "C:\Users\SEANBA~1\AppData\Local\Temp\pip-build-pvc5zlcc\markupsafe\setup.py", line 120, in <module> 
     try_building_extension() 
    File "C:\Users\SEANBA~1\AppData\Local\Temp\pip-build-pvc5zlcc\markupsafe\setup.py", line 99, in try_building_extension 
     run_setup(True) 
    File "C:\Users\SEANBA~1\AppData\Local\Temp\pip-build-pvc5zlcc\markupsafe\setup.py", line 93, in run_setup 
     ext_modules=ext_modules, 
    File "C:\Python35-32\Lib\distutils\core.py", line 148, in setup 
     dist.run_commands() 
    File "C:\Python35-32\Lib\distutils\dist.py", line 955, in run_commands 
     self.run_command(cmd) 
    File "C:\Python35-32\Lib\distutils\dist.py", line 974, in run_command 
     cmd_obj.run() 
    File "c:\test_oauth\venv\lib\site-packages\wheel\bdist_wheel.py", line 179, in run 
     self.run_command('build') 
    File "C:\Python35-32\Lib\distutils\cmd.py", line 313, in run_command 
     self.distribution.run_command(command) 
    File "C:\Python35-32\Lib\distutils\dist.py", line 974, in run_command 
     cmd_obj.run() 
    File "C:\Python35-32\Lib\distutils\command\build.py", line 135, in run 
     self.run_command(cmd_name) 
    File "C:\Python35-32\Lib\distutils\cmd.py", line 313, in run_command 
     self.distribution.run_command(command) 
    File "C:\Python35-32\Lib\distutils\dist.py", line 974, in run_command 
     cmd_obj.run() 
    File "C:\Users\SEANBA~1\AppData\Local\Temp\pip-build-pvc5zlcc\markupsafe\setup.py", line 41, in run 
     build_ext.run(self) 
    File "C:\Python35-32\Lib\distutils\command\build_ext.py", line 338, in run 
     self.build_extensions() 
    File "C:\Python35-32\Lib\distutils\command\build_ext.py", line 447, in build_extensions 
     self._build_extensions_serial() 
    File "C:\Python35-32\Lib\distutils\command\build_ext.py", line 472, in _build_extensions_serial 
     self.build_extension(ext) 
    File "C:\Users\SEANBA~1\AppData\Local\Temp\pip-build-pvc5zlcc\markupsafe\setup.py", line 47, in build_extension 
     build_ext.build_extension(self, ext) 
    File "C:\Python35-32\Lib\distutils\command\build_ext.py", line 532, in build_extension 
     depends=ext.depends) 
    File "C:\Python35-32\Lib\distutils\_msvccompiler.py", line 306, in compile 
     self.initialize() 
    File "C:\Python35-32\Lib\distutils\_msvccompiler.py", line 199, in initialize 
     vc_env = _get_vc_env(plat_spec) 
    File "c:\test_oauth\venv\lib\site-packages\setuptools\msvc.py", line 206, in msvc14_get_vc_env 
     return EnvironmentInfo(plat_spec, vc_ver_min=14.0).return_env() 
    TypeError: __init__() got an unexpected keyword argument 'vc_ver_min' 

    ---------------------------------------- 
    Failed building wheel for markupsafe 

下面是相关输出(或者至少,我认为是相关的部分输出)与SQLAlchemy失败关联:

running build_ext 
    building 'sqlalchemy.cprocessors' extension 
    Traceback (most recent call last): 
    File "<string>", line 1, in <module> 
    File "C:\Users\SEANBA~1\AppData\Local\Temp\pip-build-pvc5zlcc\SQLAlchemy\setup.py", line 170, in <module> 
     run_setup(True) 
    File "C:\Users\SEANBA~1\AppData\Local\Temp\pip-build-pvc5zlcc\SQLAlchemy\setup.py", line 150, in run_setup 
     **kwargs 
    File "C:\Python35-32\Lib\distutils\core.py", line 148, in setup 
     dist.run_commands() 
    File "C:\Python35-32\Lib\distutils\dist.py", line 955, in run_commands 
     self.run_command(cmd) 
    File "C:\Python35-32\Lib\distutils\dist.py", line 974, in run_command 
     cmd_obj.run() 
    File "c:\test_oauth\venv\lib\site-packages\wheel\bdist_wheel.py", line 179, in run 
     self.run_command('build') 
    File "C:\Python35-32\Lib\distutils\cmd.py", line 313, in run_command 
     self.distribution.run_command(command) 
    File "C:\Python35-32\Lib\distutils\dist.py", line 974, in run_command 
     cmd_obj.run() 
    File "C:\Python35-32\Lib\distutils\command\build.py", line 135, in run 
     self.run_command(cmd_name) 
    File "C:\Python35-32\Lib\distutils\cmd.py", line 313, in run_command 
     self.distribution.run_command(command) 
    File "C:\Python35-32\Lib\distutils\dist.py", line 974, in run_command 
     cmd_obj.run() 
    File "C:\Users\SEANBA~1\AppData\Local\Temp\pip-build-pvc5zlcc\SQLAlchemy\setup.py", line 67, in run 
     build_ext.run(self) 
    File "C:\Python35-32\Lib\distutils\command\build_ext.py", line 338, in run 
     self.build_extensions() 
    File "C:\Python35-32\Lib\distutils\command\build_ext.py", line 447, in build_extensions 
     self._build_extensions_serial() 
    File "C:\Python35-32\Lib\distutils\command\build_ext.py", line 472, in _build_extensions_serial 
     self.build_extension(ext) 
    File "C:\Users\SEANBA~1\AppData\Local\Temp\pip-build-pvc5zlcc\SQLAlchemy\setup.py", line 73, in build_extension 
     build_ext.build_extension(self, ext) 
    File "C:\Python35-32\Lib\distutils\command\build_ext.py", line 532, in build_extension 
     depends=ext.depends) 
    File "C:\Python35-32\Lib\distutils\_msvccompiler.py", line 306, in compile 
     self.initialize() 
    File "C:\Python35-32\Lib\distutils\_msvccompiler.py", line 199, in initialize 
     vc_env = _get_vc_env(plat_spec) 
    File "c:\test_oauth\venv\lib\site-packages\setuptools\msvc.py", line 206, in msvc14_get_vc_env 
     return EnvironmentInfo(plat_spec, vc_ver_min=14.0).return_env() 
    TypeError: __init__() got an unexpected keyword argument 'vc_ver_min' 

    ---------------------------------------- 
    Failed building wheel for SQLAlchemy 
+0

这里只是一个黑暗的镜头:你的venv python与python的'pip install -r requirements.txt'是一样的吗?如在,他们都是3.5? –

回答

0

我找到了我的问题的答案。

python的环境变量被错误地配置了(它已经做成它自己的系统变量,而不是简单地添加到'path'系统变量中)。

一旦这个改变,问题就消失了。