我刚刚设置了我的第一个virtualenv并希望在其中使用flask 我在windows中使用了激活脚本,就像在每个教程中所说的那样 ****我想我应该注意到我已经从虚拟环境中安装了烧瓶。
我运行了命令
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\
答案 0 :(得分:4)
我有这个问题。降级您的Setuptools版本。 在你的virtualenv:
pip install setuptools==21.2.1
pip install flask
这应该这样做。这个问题与我没有得到的语法有关。
答案 1 :(得分:0)
这也让我发疯了。跟着这些步骤:
1)系统范围pip uninstall flask
2)在app文件夹中创建virtualenv
3)不要使用pip,而是easy_install flask
4)然后使用pip安装所有其他依赖项。
这对我有用,我不知道为什么,但它解决了一个非常烦人的问题。