在virtualenv中安装Flask时出错-Windows [英] Error while installing Flask in virtualenv - windows

查看:73
本文介绍了在virtualenv中安装Flask时出错-Windows的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是设置了我的第一个virtualenv并想在其中使用flask我在Windows中使用了激活脚本,就像在每个教程中都说的那样****我想我应该注意,我已经在虚拟环境中安装了flask.

i just set my first virtualenv and wanted to work with flask in it i used the activate script in windows, like it says in every tutorial out there ****i think i should note that i have installed flask out of the virtual env.

我运行了命令

pip install flask


Collecting flask
  Using cached Flask-0.11.1-py2.py3-none-any.whl
Collecting Jinja2>=2.4 (from flask)
  Using cached Jinja2-2.8-py2.py3-none-any.whl
Collecting Werkzeug>=0.7 (from flask)
  Using cached Werkzeug-0.11.10-py2.py3-none-any.whl
Collecting click>=2.0 (from flask)
Collecting itsdangerous>=0.21 (from flask)
Collecting MarkupSafe (from Jinja2>=2.4->flask)
  Using cached MarkupSafe-0.23.tar.gz
Building wheels for collected packages: MarkupSafe
  Running setup.py bdist_wheel for MarkupSafe ... error
  Complete output from command c:\users\eitan\pycharmprojects\todo-api\flask\scripts\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\eitan\\appdata\\local\\temp\\pip-build-egsygt\\MarkupSafe\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d c:\users\eitan\appdata\local\temp\tmpiyvrkbpip-wheel- --python-tag cp27:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-2.7
  creating build\lib.win-amd64-2.7\markupsafe
  copying markupsafe\tests.py -> build\lib.win-amd64-2.7\markupsafe
  copying markupsafe\_compat.py -> build\lib.win-amd64-2.7\markupsafe
  copying markupsafe\_constants.py -> build\lib.win-amd64-2.7\markupsafe
  copying markupsafe\_native.py -> build\lib.win-amd64-2.7\markupsafe
  copying markupsafe\__init__.py -> build\lib.win-amd64-2.7\markupsafe
  running egg_info
  writing MarkupSafe.egg-info\PKG-INFO
  writing top-level names to MarkupSafe.egg-info\top_level.txt
  writing dependency_links to MarkupSafe.egg-info\dependency_links.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.win-amd64-2.7\markupsafe
  running build_ext
  building 'markupsafe._speedups' extension
  error: [Error 2] The system cannot find the file specified

  ----------------------------------------
  Failed building wheel for MarkupSafe
  Running setup.py clean for MarkupSafe
Failed to build MarkupSafe
Installing collected packages: MarkupSafe, Jinja2, Werkzeug, click, itsdangerous, flask
  Running setup.py install for MarkupSafe ... error
    Complete output from command c:\users\eitan\pycharmprojects\todo-api\flask\scripts\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\eitan\\appdata\\local\\temp\\pip-build-egsygt\\MarkupSafe\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\eitan\appdata\local\temp\pip-mrm1te-record\install-record.txt --single-version-externally-managed --compile --install-headers c:\users\eitan\pycharmprojects\todo-api\flask\include\site\python2.7\MarkupSafe:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-2.7
    creating build\lib.win-amd64-2.7\markupsafe
    copying markupsafe\tests.py -> build\lib.win-amd64-2.7\markupsafe
    copying markupsafe\_compat.py -> build\lib.win-amd64-2.7\markupsafe
    copying markupsafe\_constants.py -> build\lib.win-amd64-2.7\markupsafe
    copying markupsafe\_native.py -> build\lib.win-amd64-2.7\markupsafe
    copying markupsafe\__init__.py -> build\lib.win-amd64-2.7\markupsafe
    running egg_info
    writing MarkupSafe.egg-info\PKG-INFO
    writing top-level names to MarkupSafe.egg-info\top_level.txt
    writing dependency_links to MarkupSafe.egg-info\dependency_links.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.win-amd64-2.7\markupsafe
    running build_ext
    building 'markupsafe._speedups' extension
    error: [Error 2] The system cannot find the file specified

    ----------------------------------------
Command "c:\users\eitan\pycharmprojects\todo-api\flask\scripts\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\eitan\\appdata\\local\\temp\\pip-build-egsygt\\MarkupSafe\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\eitan\appdata\local\temp\pip-mrm1te-record\install-record.txt --single-version-externally-managed --compile --install-headers c:\users\eitan\pycharmprojects\todo-api\flask\include\site\python2.7\MarkupSafe" failed with error code 1 in c:\users\eitan\appdata\local\temp\pip-build-egsygt\MarkupSafe\

推荐答案

我遇到了这个问题.降级您的Setuptools版本.在您的virtualenv中:

I had this problem. Downgrade your version of Setuptools. In your virtualenv:

pip install setuptools==21.2.1
pip install flask

这应该做到.问题是与我没有得到的语法有关.

This should do it. The problem is something to do with syntax that I don't get.

这篇关于在virtualenv中安装Flask时出错-Windows的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆