[英]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?
I've tried to install on terminal and I've used two commands: 我试过在终端上安装,我使用了两个命令:
pip install flask
pip install -U flask
It shows the same error message on both cases: 它在两种情况下都显示相同的错误消息:
I've tried pip install -U flask
but that shows the same error. 我试过pip install -U flask
但是显示了同样的错误。
Here is the error I'm getting: 这是我得到的错误:
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.
Best way is probably to use pip install <libname> --user
最好的方法可能是使用pip install <libname> --user
Meaning in your case use pip install flask --user
在您的情况下使用pip install flask --user
This installs the package for your user and that is safe. 这将为您的用户安装包,这是安全的。 Also you have probably the right of installing the package for the user. 您也可能有权为用户安装软件包。
The permission error you have encountered is a frequent problem. 您遇到的权限错误是一个常见问题。 As can be seen here: pip is not able to install packages correctly: Permission denied error and here error: could not create '/usr/local/lib/python2.7/dist-packages/virtualenv_support': Permission denied 从这里可以看出: pip无法正确安装包:权限被拒绝错误 ,此处错误:无法创建'/usr/local/lib/python2.7/dist-packages/virtualenv_support':权限被拒绝
Using the sudo pip command is not considered as safe as explained here: What are the risks of running 'sudo pip'? 使用sudo pip命令并不像这里解释的那样安全: 运行'sudo pip'有什么风险?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.