Pip Python中的树莓Pi-GPIO
我试图让我的树莓皮的GPIO引脚工作,我下面 (我正在通过SSH运行Raspbian。)我已成功安装distribute 在尝试安装PIP时,出现如下错误 我怎样才能修好它Pip Python中的树莓Pi-GPIO,pip,raspberry-pi,gpio,Pip,Raspberry Pi,Gpio,我试图让我的树莓皮的GPIO引脚工作,我下面 (我正在通过SSH运行Raspbian。)我已成功安装distribute 在尝试安装PIP时,出现如下错误 我怎样才能修好它 pi@DuckPi ~ $ sudo curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | python % Total % Received % Xferd Average Speed Time Time
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
这是因为
curl
是sudo
ed而不是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
我遵循了相同的教程,但没有安装pip,而是使用了:
sudo apt-get install rpi.gpio
本教程的其余部分很好地进行了搜索,查找了一些额外的信息。我对简单GPIO介绍的全部体验是我博客文章的主题,我希望这也能有所帮助。如今,Debian软件包的名称为:
python-rpi.gpio - Python GPIO module for Raspberry Pi
python3-rpi.gpio - Python 3 GPIO module for Raspberry Pi
您还可以使用wiringPi库。它很容易使用 以下是链接: 对于C: 对于Python:
我希望它能有所帮助。您也可以使用sudo easy_install3-U pip更新最新版本。