Forums

Error with Flask module and pip

I'm trying to install a module but can't do it with pip?

23:01 ~/mysite (master)$ pip install Flask-OAuthlib

Collecting Flask-OAuthlib
  Using cached Flask_OAuthlib-0.9.3-py2-none-any.whl
Requirement already satisfied: requests-oauthlib>=0.5.0 in /usr/local/lib/python2.7/dist-packages (from Flask-OAuthlib)
Requirement already satisfied: Flask in /usr/local/lib/python2.7/dist-packages (from Flask-OAuthlib)
Requirement already satisfied: oauthlib>=0.6.2 in /usr/local/lib/python2.7/dist-packages (from Flask-OAuthlib)
Requirement already satisfied: requests>=2.0.0 in /usr/local/lib/python2.7/dist-packages (from requests-oauthlib>=0.5.0->Flask-OAuthlib)
Requirement already satisfied: itsdangerous>=0.21 in /usr/local/lib/python2.7/dist-packages (from Flask->Flask-OAuthlib)
Requirement already satisfied: Werkzeug>=0.7 in /usr/local/lib/python2.7/dist-packages (from Flask->Flask-OAuthlib)
Requirement already satisfied: Jinja2>=2.4 in /usr/local/lib/python2.7/dist-packages (from Flask->Flask-OAuthlib)
Requirement already satisfied: click>=2.0 in /usr/local/lib/python2.7/dist-packages (from Flask->Flask-OAuthlib)
Requirement already satisfied: MarkupSafe in /usr/local/lib/python2.7/dist-packages (from Jinja2>=2.4->Flask->Flask-OAuthlib)
Installing collected packages: Flask-OAuthlib
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 849, 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 1062, 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/Flask_OAuthlib-0.9.3.dist-info'

see the PythonAnywhere help pages for how to install modules (use the - -user flag)

https://help.pythonanywhere.com/pages/InstallingNewModules

Thank you!