- Raspberry Pi 3
- OS - Noobs
- Default Python Version - 2.7.9. I have also installed Python 3.6
I want to use the Flask Web Framework for a project on my RasPi 3. I have installed the latest version of pip. I am trying to use pip install flask
.
But it doesn't seem to work & gives the following error:
Collecting flask
Using cached Flask-0.12.2-py2.py3-none-any.whl
Collecting Jinja2>=2.4 (from flask)
Using cached Jinja2-2.9.6-py2.py3-none-any.whl
Collecting Werkzeug>=0.7 (from flask)
Using cached Werkzeug-0.12.2-py2.py3-none-any.whl
Collecting click>=2.0 (from flask)
Using cached click-6.7-py2.py3-none-any.whl
Collecting itsdangerous>=0.21 (from flask)
Collecting MarkupSafe>=0.23 (from Jinja2>=2.4->flask)
Installing collected packages: MarkupSafe, Jinja2, Werkzeug, click, itsdangerous, flask
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 784, in install
**kwargs
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 316, in clobber
ensure_dir(destdir)
File "/usr/local/lib/python2.7/dist-packages/pip/utils/__init__.py", line 83, in ensure_dir
os.makedirs(path)
File "/usr/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/MarkupSafe-1.0.dist-info'
asked Oct 15, 2017 at 7:07
-
See also pip install -r: OSError: [Errno 13] Permission denied on Stack Overflow, which suggest solutions to this issue (the fact that you're using a Pi here probably doesn't matter, since in the end it's just another Linux system).Aurora0001– Aurora00012017年10月15日 08:53:48 +00:00Commented Oct 15, 2017 at 8:53
1 Answer 1
Looks like you are running pip
as an unprivileged user. You can either do
sudo pip install flask
to install it as root for everyone, or
pip install --user flask
to install it just for the current user.
answered Oct 15, 2017 at 7:35
-
This doesn't work eitherJonathan Pereira– Jonathan Pereira2017年10月15日 08:03:55 +00:00Commented Oct 15, 2017 at 8:03
-
1Neither works? What do they say? Same error?Mark Smith– Mark Smith2017年10月15日 08:10:45 +00:00Commented Oct 15, 2017 at 8:10
lang-py