Flask安装E

2024-06-24 13:13:16 发布

您现在位置:Python中文网/ 问答频道 /正文

我试着在我的个人电脑上安装Flask,它有linuxmint。最终出现以下错误:

*error: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/itsdangerous.py'
---------------------------------------------------------------------- Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-cMPDih/itsdangerous/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-HIVrsp-record/install-record.txt
--single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-cMPDih/itsdangerous/*

Tags: installpippybuildusrerroropenrecord
1条回答
网友
1楼 · 发布于 2024-06-24 13:13:16

错误消息指示您没有在虚拟环境中工作。你可能还没有激活它。您可以轻松测试和激活它:

$ which python
/usr/bin/python # oops, no virtual environment
$ source /home/user/venv/bin/activate
$ which python
/home/user/venv/bin/python # correct
$ pip install flask

你每次都需要激活。您可以创建一个启动脚本,例如在bash中,以便在运行程序时激活它:

^{pr2}$

相关问题 更多 >