python-romkan icon indicating copy to clipboard operation
python-romkan copied to clipboard

Failed to install when default encoding is not UTF-8

Open lilydjwg opened this issue 11 years ago • 4 comments

Traceback (most recent call last):
  File "setup.py", line 12, in <module>
    README = open(os.path.join(here, '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 0xe3 in position 181: ordinal not in range(128)

lilydjwg avatar Mar 22 '14 15:03 lilydjwg

Just fix as

open(os.path.join(here, 'README.rst'), encoding="utf-8").read()

then the rest of installtion went fine.

keigoi avatar Feb 26 '16 02:02 keigoi

Hi,

Can you update into Git and Pypi, otherwise it cannot be installed.

ghost avatar Mar 28 '16 08:03 ghost

I also tripped over this in windows. I hope you could make that quick change and update the pypi package.

When installing in Windows, using the command line, you can type in set PYTHONUTF8=1 to set the default encoding to UTF-8 and then install it normally using pip. This made it work for me.

mchlnix avatar Apr 16 '20 17:04 mchlnix

Hi when try to install i get this error message:

  Using cached romkan-0.2.1.tar.gz (10 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [10 lines of output]
      C:\Users\devcm\AppData\Local\Temp\pip-install-7d9p1dht\romkan_ae291f723d6f4502b53978285229a9eb\setup.py:8: DeprecationWarning: the imp module is deprecated in favour of importlib and slated for removal in Python 3.12; see the module's documentation for alternative uses
        import os, json, imp
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\devcm\AppData\Local\Temp\pip-install-7d9p1dht\romkan_ae291f723d6f4502b53978285229a9eb\setup.py", line 12, in <module>
          README = open(os.path.join(here, 'README.rst')).read()
        File "C:\Users\devcm\AppData\Local\Programs\Python\Python310\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 226: character maps to <undefined>
      [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.```

C0MPL3XDEV avatar Mar 26 '22 21:03 C0MPL3XDEV