如何解决为什么我无法安装 FlaskPIP 错误?
我无法安装 Flask 或几乎任何其他模块。 我的操作系统:Ubuntu 14.04 LTS(32 位)。 Ubuntu 预装了 Python2 和 Python3。 当我使用flask时,我尝试使用以下命令安装它:
pip3 install flask
这是终端中的输出:
root@Ashu-linx:/var/www# pip3 install flask
Downloading/unpacking flask
Downloading Flask-2.0.1-py3-none-any.whl (94kB): 94kB downloaded
Downloading/unpacking itsdangerous>=2.0 (from flask)
Downloading itsdangerous-2.0.1-py3-none-any.whl
Downloading/unpacking Jinja2>=3.0 (from flask)
Downloading Jinja2-3.0.1-py3-none-any.whl (133kB): 133kB downloaded
Downloading/unpacking Werkzeug>=2.0 (from flask)
Downloading Werkzeug-2.0.1-py3-none-any.whl (288kB): 288kB downloaded
Downloading/unpacking click>=7.1.2 (from flask)
Downloading click-8.0.1-py3-none-any.whl (97kB): 97kB downloaded
Cleaning up...
Exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pkg_resources.py",line 2482,in _dep_map
return self.__dep_map
File "/usr/lib/python3/dist-packages/pkg_resources.py",line 2344,in __getattr__
raise AttributeError(attr)
AttributeError: _DistInfoDistribution__dep_map
During handling of the above exception,another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/basecommand.py",line 122,in main
status = self.run(options,args)
File "/usr/lib/python3/dist-packages/pip/commands/install.py",line 278,in run
requirement_set.prepare_files(finder,force_root_egg_info=self.bundle,bundle=self.bundle)
File "/usr/lib/python3/dist-packages/pip/req.py",line 1266,in prepare_files
req_to_install.extras):
File "/usr/lib/python3/dist-packages/pkg_resources.py",line 2291,in requires
dm = self._dep_map
File "/usr/lib/python3/dist-packages/pkg_resources.py",line 2484,in _dep_map
self.__dep_map = self._compute_dependencies()
File "/usr/lib/python3/dist-packages/pkg_resources.py",line 2517,in
_compute_dependencies
common = frozenset(reqs_for_extra(None))
File "/usr/lib/python3/dist-packages/pkg_resources.py",line 2514,in reqs_for_extra
if req.marker_fn(override={'extra':extra}):
File "/usr/share/python-wheels/setuptools-3.3-py2.py3-none-
any.whl/_markerlib/markers.py",line 113,in marker_fn
return eval(compiled_marker,environment)
File "<environment marker>",line 1,in <module>
NameError: name 'platform_system' is not defined
Storing debug log for failure in /root/.pip/pip.log
然后我在以下帮助下检查了我的 PIP 版本:
pip3 --version
输出是:
pip 1.5.4 from /usr/lib/python3/dist-packages (python 3.4)
然后我想先更新一下:
pip install --upgrade pip
然后它给了我以下错误:
Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement pip in
/usr/lib/python2.7/dist-packages
Downloading/unpacking pip
Cleaning up...
No distributions at all found for pip in /usr/lib/python2.7/dist-packages
Storing debug log for failure in /root/.pip/pip.log
然后我在网上搜索了这个错误,发现了一个stackoverflow page 并找到以下命令:
pip install --index-url=https://pypi.python.org/simple/flask
然后我运行了相同的命令,但出现了警告:
You must give at least one requirement to install (see "pip help install")
谁能告诉我现在该怎么办? 我已经阅读了 Flask 安装指南,但它对我没有帮助。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。