Giter Site home page Giter Site logo

Installing Error: UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 876: character maps to <undefined> about getkey HOT 8 OPEN

BaseMax avatar BaseMax commented on September 26, 2024 2
Installing Error: UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 876: character maps to

from getkey.

Comments (8)

Anonymous-Humanoid avatar Anonymous-Humanoid commented on September 26, 2024 1

The solution provided by @greger555 is a lifesaver, just one correction:

def read_description(): with open('README.rst') as fd: return fd.read(encoding="utf-8")

def read_description(): with open('README.rst', encoding="utf-8") as fd: return fd.read()

I also found that updating line 38 of platforms.py was necessary in favor of resolving "TypeError: can only concatenate str (not "bytes") to str":

buffer = ''

buffer = b''

from getkey.

BaseMax avatar BaseMax commented on September 26, 2024
C:\Users\Max>pip --version
pip 22.3 from C:\Users\Max\AppData\Local\Programs\Python\Python310\lib\site-packages\pip (python 3.10)
C:\Users\Max>python --version
Python 3.10.8

from getkey.

h4rldev avatar h4rldev commented on September 26, 2024

Have the same issue, don't know the cause

from getkey.

jlemback avatar jlemback commented on September 26, 2024

I have the same issue, what to do??

from getkey.

jlemback avatar jlemback commented on September 26, 2024

Error message:

C:\Users\jenni>pip install getkey
Collecting getkey
Using cached getkey-0.6.5.tar.gz (13 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [13 lines of output]
Traceback (most recent call last):
File "", line 2, in
File "", line 34, in
File "C:\Users\jenni\AppData\Local\Temp\pip-install-p9mfhp1q\getkey_6ed7fb4b1ab34df49be65936692a82df\setup.py", line 37, in
long_description=read_description(),
^^^^^^^^^^^^^^^^^^
File "C:\Users\jenni\AppData\Local\Temp\pip-install-p9mfhp1q\getkey_6ed7fb4b1ab34df49be65936692a82df\setup.py", line 11, in read_description
return fd.read()
^^^^^^^^^
File "C:\Python311\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 0x81 in position 876: character maps to
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

C:\Users\jenni>

from getkey.

greger555 avatar greger555 commented on September 26, 2024

I also get thes issue:

C:\Users\Gregw>pip install getkey
Collecting getkey
Using cached getkey-0.6.5.tar.gz (13 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [13 lines of output]
Traceback (most recent call last):
File "", line 2, in
File "", line 34, in
File "C:\Users\Gregw\AppData\Local\Temp\pip-install-a1k37d3y\getkey_5dedb9269e7d431ea4084ba0440d716e\setup.py", line 37, in
long_description=read_description(),
^^^^^^^^^^^^^^^^^^
File "C:\Users\Gregw\AppData\Local\Temp\pip-install-a1k37d3y\getkey_5dedb9269e7d431ea4084ba0440d716e\setup.py", line 11, in read_description
return fd.read()
^^^^^^^^^
File "C:\Users\Gregw\AppData\Local\Programs\Python\Python311\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 0x81 in position 876: character maps to
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

from getkey.

h4rldev avatar h4rldev commented on September 26, 2024

A fix is just installing getkey from the repo, (i think).

from getkey.

greger555 avatar greger555 commented on September 26, 2024

this is what helped me:

in getkey, in the setup.py file change the code on line 9 from:

def read_description(): with open('README.rst') as fd: return fd.read()

to:

def read_description(): with open('README.rst') as fd: return fd.read(encoding="utf-8")

wich forces the UTF-8 usage, and is apparently what we need

however this means you have to download getkey manually. Another issue with this is if you try to install getkey again after done this step, it will still error because pip automatically attempts to find the most updated version on pypi and ignores your directory.

To solve this you need to use "pip install -e ." command instead of the infamous "pip install getkey". In order for this to work properly however you need to be in the same folder as the setup.py file lies in wich is usually directly in the getkey folder.

from getkey.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.