繁体   English   中英

它显示“[Errno 13]权限被拒绝:'/ usr / lib / python2.7 / did-packages / Jinja2-2.8.egg-info / entry_points.txt'”当试图安装烧瓶时?

[英]It shows “ [Errno 13] Permission denied: '/usr/lib/python2.7/dist-packages/Jinja2-2.8.egg-info/entry_points.txt'” when trying to install flask?

我试过在终端上安装,我使用了两个命令:

  1. pip install flask
  2. pip install -U flask

它在两种情况下都显示相同的错误消息:

我试过pip install -U flask但是显示了同样的错误。

这是我得到的错误:

DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting flask
  Using cached https://files.pythonhosted.org/packages/9a/74/670ae9737d14114753b8c8fdf2e8bd212a05d3b361ab15b44937dfd40985/Flask-1.0.3-py2.py3-none-any.whl
Collecting Jinja2>=2.10 (from flask)
  Using cached https://files.pythonhosted.org/packages/1d/e7/fd8b501e7a6dfe492a433deb7b9d833d39ca74916fa8bc63dd1a4947a671/Jinja2-2.10.1-py2.py3-none-any.whl
Collecting itsdangerous>=0.24 (from flask)
  Using cached https://files.pythonhosted.org/packages/76/ae/44b03b253d6fade317f32c24d100b3b35c2239807046a4c953c7b89fa49e/itsdangerous-1.1.0-py2.py3-none-any.whl
Collecting Werkzeug>=0.14 (from flask)
  Using cached https://files.pythonhosted.org/packages/9f/57/92a497e38161ce40606c27a86759c6b92dd34fcdb33f64171ec559257c02/Werkzeug-0.15.4-py2.py3-none-any.whl
Collecting click>=5.1 (from flask)
  Using cached https://files.pythonhosted.org/packages/fa/37/45185cb5abbc30d7257104c434fe0b07e5a195a6847506c074527aa599ec/Click-7.0-py2.py3-none-any.whl
Requirement already satisfied, skipping upgrade: MarkupSafe>=0.23 in /usr/lib/python2.7/dist-packages (from Jinja2>=2.10->flask) (0.23)
Installing collected packages: Jinja2, itsdangerous, Werkzeug, click, flask
  Found existing installation: Jinja2 2.8
    Uninstalling Jinja2-2.8:
ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/lib/python2.7/dist-packages/Jinja2-2.8.egg-info/entry_points.txt'
Consider using the `--user` option or check the permissions.

最好的方法可能是使用pip install <libname> --user

在您的情况下使用pip install flask --user

这将为您的用户安装包,这是安全的。 您也可能有权为用户安装软件包。

您遇到的权限错误是一个常见问题。 从这里可以看出: pip无法正确安装包:权限被拒绝错误 ,此处错误:无法创建'/usr/local/lib/python2.7/dist-packages/virtualenv_support':权限被拒绝

使用sudo pip命令并不像这里解释的那样安全: 运行'sudo pip'有什么风险?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM