gpt4 book ai didi

python - windows上virtualenv下安装flask失败--【错误2】系统找不到指定的文件

转载 作者:太空狗 更新时间:2023-10-29 21:13:43 33 4
gpt4 key购买 nike

我在 Windows 机器上使用 python 2.7。我可以使用 pip install 安装 flask,如下所示:

cool但是,在我创建了一个 virtualenv 之后,我在尝试做同样的事情时遇到了以下错误。

脚本:

$pip install virtualenv  
$cd /d d:
$mkdir test
$cd test
$virtualenv flaskEnv
$cd flaskEnv/Scritps/
$activate
$cd ../../
$pip install flask

日志文件如下:

Collecting flask
Using cached Flask-0.11.1-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): click>=2.0 in c:\projects\flask-react\flsk\lib\site-packages (from flask)
Requirement already satisfied (use --upgrade to upgrade): Werkzeug>=0.7 in c:\projects\flask-react\flsk\lib\site-packages (from flask)
Collecting Jinja2>=2.4 (from flask)
Using cached Jinja2-2.8-py2.py3-none-any.whl
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: started
Running setup.py bdist_wheel for MarkupSafe: finished with status 'error'
Complete output from command c:\projects\flask-react\flsk\scripts\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\admini~1\\appdata\\local\\temp\\pip-build-3ep417\\MarkupSafe\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d c:\users\admini~1\appdata\local\temp\tmp8mkr70pip-wheel- --python-tag cp27:
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win32-2.7
creating build\lib.win32-2.7\markupsafe
copying markupsafe\tests.py -> build\lib.win32-2.7\markupsafe
copying markupsafe\_compat.py -> build\lib.win32-2.7\markupsafe
copying markupsafe\_constants.py -> build\lib.win32-2.7\markupsafe
copying markupsafe\_native.py -> build\lib.win32-2.7\markupsafe
copying markupsafe\__init__.py -> build\lib.win32-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.win32-2.7\markupsafe
running build_ext
building 'markupsafe._speedups' extension
error: [Error 2] The system cannot find the file specified

----------------------------------------
Running setup.py clean for MarkupSafe
Failed to build MarkupSafe
Installing collected packages: MarkupSafe, Jinja2, itsdangerous, flask
Running setup.py install for MarkupSafe: started
Running setup.py install for MarkupSafe: finished with status 'error'
Complete output from command c:\projects\flask-react\flsk\scripts\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\admini~1\\appdata\\local\\temp\\pip-build-3ep417\\MarkupSafe\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\admini~1\appdata\local\temp\pip-8v3_ep-record\install-record.txt --single-version-externally-managed --compile --install-headers c:\projects\flask-react\flsk\include\site\python2.7\MarkupSafe:
running install
running build
running build_py
creating build
creating build\lib.win32-2.7
creating build\lib.win32-2.7\markupsafe
copying markupsafe\tests.py -> build\lib.win32-2.7\markupsafe
copying markupsafe\_compat.py -> build\lib.win32-2.7\markupsafe
copying markupsafe\_constants.py -> build\lib.win32-2.7\markupsafe
copying markupsafe\_native.py -> build\lib.win32-2.7\markupsafe
copying markupsafe\__init__.py -> build\lib.win32-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.win32-2.7\markupsafe
running build_ext
building 'markupsafe._speedups' extension
error: [Error 2] The system cannot find the file specified

错误消息对任何人都有意义吗?谢谢

最佳答案

这个问题似乎与您的 virtualenv 中安装的 setuptools 版本有关。降级到旧版本为我修复了它。

从你的虚拟环境:

pip install setuptools==21.2.1
pip install flask

关于python - windows上virtualenv下安装flask失败--【错误2】系统找不到指定的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38243633/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com