magmax / python-readchar

Python library to read characters and key strokes
MIT License
143 stars 45 forks source link

error in pip install readchar #26

Closed siran closed 4 years ago

siran commented 7 years ago

platform: windows 10 python version: 3.6

I couldn't install library. Here's the output from console:

pip install readchar --no-cache-dir
Collecting readchar
  Downloading readchar-0.7.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\xx\AppData\Local\Temp\pip-build-2ipoynqy\readchar\setup.py", line 15, in <module>
        long_description=read_description(),
      File "C:\Users\xx\AppData\Local\Temp\pip-build-2ipoynqy\readchar\setup.py", line 9, in read_description
        return fd.read()
      File "d:\users\xx\documents\__dev\__python\pythonx64-3-6-1\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 2462: character maps to <undefined>

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\xx\AppData\Local\Temp\pip-build-2ipoynqy\readchar\
buhtz commented 7 years ago

I observe the same problem here.

Amethyst-M commented 6 years ago

I seem to be having the exact same problem, i have reinstalled and upgraded setuptools several times.

magmax commented 6 years ago

Please, could you try with version 0.1.0?

It has no other changes but a change in the readme, in order to avoid those chars that may be the cause.

Thank you.

calonx commented 6 years ago

Short answer: 0.1.0 does indeed install without issue.

Medium-length answer: A more robust fix might've been to instead add "encoding='utf-8'" to the read_description procedure in setup.py. That would allow you to keep the accents in README.rst.

[EDIT: Credit for this suggestion actually goes to @Eitilt. I couldn't remember where I had spotted it, but I happened to find it again!]

[EDIT2: I'm finally catching up on the history of all of this stuff. This problem was indeed solved as described by merging @Eitilt's change. It just appeared to me that it was unfixed because the "latest" version in PyPI has neither the README.rst fix nor the setup.py fix. The answer below still applies, AFAIK.]

Long answer: I think your versioning needs some correction -- you speak of "0.1.0" in terms of it being the newest version, but the highest version-number available in PyPI is "0.7".

Indeed, if I manually instruct pip to use 0.1.0, it installs without issue:

image

With the premise that "0.7" was actually supposed to be "0.0.7" (and the understanding that I might be totally off the mark), I'd recommend that you push a new version as "0.10.0" to put all of this confusion behind us. = )

mbdevpl commented 6 years ago

This issue (as well as #5) can be marked as fixed as soon as #27 is resolved.

mbdevpl commented 4 years ago

As #27 has been resolved, I think this should be closed. Please reopen if you experience the same issue with the latest version (as of now: 2.0.1).