5

私はRaspberry PiのGPIOピンを機能させようとしています.Tutorial: How to use your Ra​​spberry Pi like an Arduinoに従っています.

(Raspbian を実行している SSH で作業しています。) ディストリビューションのインストールに成功しました。

PIP をインストールしようとすると、次のエラーが表示されます。

どうすれば修正できますか?

    pi@DuckPi ~ $ sudo curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | python
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 85929  100 85929    0     0  89250      0 --:--:-- --:--:-- --:--:--  103k
    Downloading/unpacking pip
      Running setup.py egg_info for package pip

        warning: no files found matching '*.html' under directory 'docs'
        warning: no previously-included files matching '*.txt' found under directory 'docs/_build'
        no previously-included directories found matching 'docs/_build/_sources'
    Installing collected packages: pip
      Running setup.py install for pip
        error: could not create '/usr/local/lib/python2.7/dist-packages/pip': Permission denied
        Complete output from command /usr/bin/python -c "import setuptools;__file__='/home/pi/build/pip/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-6djiJW-record/install-record.txt:
        running install

    running build

    running build_py

    running install_lib

    creating /usr/local/lib/python2.7/dist-packages/pip

    error: could not create '/usr/local/lib/python2.7/dist-packages/pip': Permission denied

    ----------------------------------------
    Command /usr/bin/python -c "import setuptools;__file__='/home/pi/build/pip/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-6djiJW-record/install-record.txt failed with error code 1
    Storing complete log in /home/pi/.pip/pip.log
4

4 に答える 4

6

の代わりcurlsudoedだったからですpython。次のことを行う必要があります。

$ curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | sudo python

または、必要に応じて、ファイルをダウンロードして実行します。

$ curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py
$ sudo python get-pip.py
于 2012-12-14T22:05:14.600 に答える
2

現在、Debian パッケージの名前は次のとおりです。

python-rpi.gpio - Python GPIO module for Raspberry Pi
python3-rpi.gpio - Python 3 GPIO module for Raspberry Pi
于 2013-06-01T17:41:21.900 に答える
2

同じチュートリアルに従いましたが、pip をインストールする代わりに、以下を使用しました。

sudo apt-get install rpi.gpio

チュートリアルの残りの部分は、追加情報を少し検索するだけでうまくいきました。シンプルな GPIO の紹介に関する私のすべての経験は、私のブログ記事Using Raspberry GPIO Interfaceの主題であり、これも役立つことを願っています。

于 2013-04-11T10:17:39.357 に答える