niolabs / python-xbee

Python tools for working with XBee radios
MIT License
101 stars 45 forks source link

pip installation is not working #42

Closed nejdetckenobi closed 7 years ago

nejdetckenobi commented 7 years ago

I got this output while installing xbee package to python 3.4.2 on RPi 3. Seems like your README.rst is broken.

sudo pip3 install xbee                                                                                   
Collecting xbee
  Using cached XBee-2.2.4.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-w7vfifrz/xbee/setup.py", line 15, in <module>
        long_description=open('README.rst').read(),
      File "/usr/lib/python3.4/encodings/ascii.py", line 26, in decode
        return codecs.ascii_decode(input, self.errors)[0]
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 1462: ordinal not in range(128)

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-w7vfifrz/xbee/

I installed package with following steps:

~ $ pip3 download xbee
~ $ tar xzf XBee-2.2.4.tar.gz
~ $ cd XBee-2.2.4
~/XBee-2.2.4 $ echo '' > README.rst  # Which clears your doc file.
~/XBee-2.2.4 $ python3 setup.py install

It is a workaround, obviously. Could you fix your doc file. Or if there is another way, can you write it in the docs?

jamesleesaunders commented 7 years ago

Odd. This works for me (on Python 3.6.1 MAC OSX):

$ pip3 install xbee
Collecting xbee
  Downloading XBee-2.2.4.tar.gz
Collecting pyserial (from xbee)
  Downloading pyserial-3.3-py2.py3-none-any.whl (189kB)
    100% |████████████████████████████████| 194kB 2.6MB/s 
Installing collected packages: pyserial, xbee
  Running setup.py install for xbee ... done
Successfully installed pyserial-3.3 xbee-2.2.4

What OS / HW are you running this on? I don't fully understand this, but what do you get if you type the following 'locale' command:

$ locale
LANG="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_CTYPE="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_ALL=

I am not sure whether this is a local issue with your machine or an issue with the encoding of README.rst yet?

Rather than empty the file: echo '' > README.rst # Which clears your doc file. If there is another command you can figure out, to find/replace the offending character(s) this may help us? As at the moment I am unable to recreate the issue.

nejdetckenobi commented 7 years ago

I'm running Raspbian Jessie on a RPi 3. I got exactly the same locale output with you. I tried to switch en_US.UTF-8 and back. And the problem is gone! I don't know why but I can't reproduce it either. Could be a locale problem. And I know emptying the file was a bad practice, I just needed the package ASAP, so... Thanks anyway!