Search code examples
python-2.7raspberry-pipipobd-ii

pip installation failure on raspberry pi


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.


Solution

  • 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.