Marwa Adds
Marwa Adds

Reputation: 13

UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 4336: character maps to <undefined>

I am using PyCharm on windows 8 to write Python code I am trying to add ncclient library and I am receiving the below error:

UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 4336: character maps to <undefined>

Collecting ncclient
  Using cached ncclient-0.5.2.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\...\AppData\Local\Temp\pycharm-packaging\ncclient\setup.py", line 32, in <module>
        long_description = file.read()
      File "C:\Program Files (x86)\Python35-32\lib\encodings\cp1252.py", line 23, in decode
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]
    UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 4336: character maps to <undefined>

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in C:\Users\...\AppData\Local\Temp\pycharm-packaging\ncclient\

Upvotes: 1

Views: 4337

Answers (1)

galra
galra

Reputation: 385

You didn't attach the command you were running. I assume this error occurs while installing the package, not importing it.

The problem is with the file README.rst in the package, which contains characters which aren't mapped in cp1252. To fix this you'll need to:

  1. Download the package manually from here
  2. Open the tar.gz file
  3. Find the README.srt file. Open it in a text editor (like notepad), and save it with a different encoding (ANSI will be fine). Ignore the warning that some characters will be lost.
  4. run the setup file:

    setup.py install

Upvotes: 3

Related Questions