Reputation: 682
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.
i ran the command
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\
Upvotes: 3
Views: 6452
Reputation: 156
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.
Upvotes: 14
Reputation: 1725
This has driven me crazy too. Follow these steps:
1) system wide pip uninstall flask
2) create virtualenv in your app folder
3) DON'T USE pip, instead easy_install flask
4) Then use pip to install all other dependencies.
This worked for me, I don't know why but it solved what was a very tiresome problem.
Upvotes: 1