1
  • 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
1
  • 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). Commented Oct 15, 2017 at 8:53

1 Answer 1

2

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
2
  • This doesn't work either Commented Oct 15, 2017 at 8:03
  • 1
    Neither works? What do they say? Same error? Commented Oct 15, 2017 at 8:10

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.