Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When pip install 'pyrebase', I got error ' UnicodeDecodeError: 'cp949' codec can't decode byte 0xe2 in position 500: illegal multibyte sequence'

Collecting jws>=0.1.3 (from python-jwt==2.0.1->pyrebase)
  Using cached https://files.pythonhosted.org/packages/01/9e/1536d578ed50f5fe8196310ddcc921a3cd8e973312d60ac74488b805d395/jws-0.1.3.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\Wesely\AppData\Local\Temp\pip-install-w5z8dsub\jws\setup.py", line 17, in <module>
        long_description=read('README.md'),
      File "C:\Users\Wesely\AppData\Local\Temp\pip-install-w5z8dsub\jws\setup.py", line 5, in read
        return open(os.path.join(os.path.dirname(__file__), fname)).read()
    UnicodeDecodeError: 'cp949' codec can't decode byte 0xe2 in position 500: illegal multibyte sequence

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

I tried easy_install pyrebase, and using virtualenv.

I'm using Korean Windows 10.

like image 954
Kazaka Nelson Avatar asked Jan 01 '18 06:01

Kazaka Nelson


1 Answers

I've just solved this. MyGitHub.io

It's a bug from jws package, it should consider the encoding problem in its setup.py.

My Solution : install jws first

  • use pip download jws instead of pip install
  • use 7z open the filename.tar.gz archive
  • edit the setup.py file
  • change this line
    return open(os.path.join(os.path.dirname(__file__), fname)).read()

to

    return open(os.path.join(os.path.dirname(__file__), fname), encoding="UTF-8").read()
  • Re-archive the tar file, run pip install filename.tar

After jws being installed, run pip install pyrebase. It should work.

like image 95
Wesely Avatar answered Oct 24 '22 00:10

Wesely