sompor9
Posts: 13
Joined: Mon Oct 29, 2012 8:12 am

I cannot install RPi.GPIO

Sun Nov 11, 2012 11:40 am

Hi All

Clouse you please recommend me to fix this error ?

Code: Select all

[email protected] ~/example/RPi.GPIO-0.4.1a $ sudo python setup.py install
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.27.tar.gz
Traceback (most recent call last):
  File "setup.py", line 2, in <module>
    distribute_setup.use_setuptools()
  File "/home/pi/example/RPi.GPIO-0.4.1a/distribute_setup.py", line 145, in use_setuptools
    return _do_download(version, download_base, to_dir, download_delay)
  File "/home/pi/example/RPi.GPIO-0.4.1a/distribute_setup.py", line 124, in _do_download
    to_dir, download_delay)
  File "/home/pi/example/RPi.GPIO-0.4.1a/distribute_setup.py", line 193, in download_setuptools
    src = urlopen(url)
  File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 400, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 418, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 378, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 1207, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/lib/python2.7/urllib2.py", line 1177, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error [Errno -5] No address associated with hostname>
[email protected] ~/example/RPi.GPIO-0.4.1a $

User avatar
MattHawkinsUK
Posts: 538
Joined: Tue Jan 10, 2012 8:48 pm
Location: UK
Contact: Website

Re: I cannot install RPi.GPIO

Sun Nov 11, 2012 12:09 pm

I would highly recommend grabbing the latest Raspbian image and re-doing your SD card. This includes RPi.GPIO and saves you having to install it manually.
My Raspberry Pi blog and home of the BerryClip Add-on board : http://www.raspberrypi-spy.co.uk/
Follow me on Google+, Facebook, Pinterest and Twitter (@RPiSpy)

sompor9
Posts: 13
Joined: Mon Oct 29, 2012 8:12 am

Re: I cannot install RPi.GPIO

Sun Nov 11, 2012 12:53 pm

I use new version image. but have not include GPIO Library.

new version is 2012-10-28-wheezy-raspbian.zip

techpaul
Posts: 1512
Joined: Sat Jul 14, 2012 6:40 pm
Location: Reading, UK
Contact: Website

Re: I cannot install RPi.GPIO

Sun Nov 11, 2012 1:09 pm

sompor9 wrote:I use new version image. but have not include GPIO Library.

new version is 2012-10-28-wheezy-raspbian.zip
Try

Code: Select all

apt-get install python-rpi.gpio
Just another techie on the net - For GPIO boards see http:///www.facebook.com/pcservicesreading
or http://www.pcserviceselectronics.co.uk/pi/

User avatar
fdion
Posts: 307
Joined: Sun Sep 16, 2012 2:33 pm
Location: North Carolina, USA
Contact: Website

Re: I cannot install RPi.GPIO

Sun Nov 11, 2012 8:12 pm

better sudo it:

Code: Select all

$ sudo apt-get install python-rpi.gpio
I had mentionned on my blog ( http://raspberry-python.blogspot.com/20 ... -dash.html ) that Pypi didn't have but 0.3 and 0.4.1a was the latest. Well, pypi.python.org now has the latest, so it can be installed in a native Python way, instead of through the OS apt-get.

This way:

Code: Select all

$ sudo easy_install RPi.GPIO
Of course you have to install easy_install (instructions for that on the link I put above), but you cant do python and not have easy_install on your system.

Francois
Francois
http://raspberry-python.blogspot.com - http://www.3dFutureTech.info - @f_dion

techpaul
Posts: 1512
Joined: Sat Jul 14, 2012 6:40 pm
Location: Reading, UK
Contact: Website

Re: I cannot install RPi.GPIO

Sun Nov 11, 2012 8:28 pm

fdion wrote:better sudo it:

Code: Select all

$ sudo apt-get install python-rpi.gpio
Well I often forget as so much I do on Pi needs root I logion as root :-P
Just another techie on the net - For GPIO boards see http:///www.facebook.com/pcservicesreading
or http://www.pcserviceselectronics.co.uk/pi/

keybeeper
Posts: 26
Joined: Wed Aug 08, 2012 10:15 am

Re: I cannot install RPi.GPIO

Wed Nov 14, 2012 11:31 pm

Do not make a habit of logging-in as root. One day you will regret it,
No Microsoft products were used in the creation of this message

techpaul
Posts: 1512
Joined: Sat Jul 14, 2012 6:40 pm
Location: Reading, UK
Contact: Website

Re: I cannot install RPi.GPIO

Wed Nov 14, 2012 11:51 pm

Considering 99% of my work is not net related and limited to specific things that have to be done by sudo or being logged on as root, for a few hours a day at most, I doubt it.

System is not one of my main systems and I run with sacrificial SD cards, my data that is limited is saved on USB. pen drive. spent too many years having to administer various systems including *nix systems, with much more data and potential problems than a simple Pi
Just another techie on the net - For GPIO boards see http:///www.facebook.com/pcservicesreading
or http://www.pcserviceselectronics.co.uk/pi/

keybeeper
Posts: 26
Joined: Wed Aug 08, 2012 10:15 am

Re: I cannot install RPi.GPIO

Thu Nov 15, 2012 9:57 am

Many learners will be reading this thread. I repeat, it is a bad idea to log in as root. If you are experienced and know what you are doing, fine, take the risk.

Linux assumes that you really mean what you ask it to do and you know what you are doing. Often you get no second chance. Unless you have a backup you could end up losing many hours, if not days of work.

If you wish to log in as root, first make very sure your work is backed up.

If the command is potentially dangerous you will usually get a refusal of some kind, unless you are logged-in as root that is.

It is so quick to edit the command line to put sudo at the front if necessary.

If you are inexperienced, never log in as root.
No Microsoft products were used in the creation of this message

Return to “Python”