1

i have the new raspberry pi and i am trying to install package "pip install library" However an error occurs " could not create 'usr/local/lib/python2.7/dist-packages/obd' : permission denied"

IF anyone could help that would really be appreciated.

John
  • 39
  • 1
  • 6
  • 1
    Maybe you are trying to run `pip` as a an unprivileged user when you probably need to run it as `root`? – larsks Oct 08 '16 at 13:23

1 Answers1

1

Use a Virtualenv:

Create a "virtualenv" directory to store your future virtualenvs... For example, in your home directory.

Install Virtualenv, of course. If you have a recent version of Python, it is already done.

Then process like this for each project:

virtualenv my_project
source my_project/bin/activate
pip install a_library

It's a best practice: avoid polluting your system-wide Python.

Laurent LAPORTE
  • 21,958
  • 6
  • 58
  • 103