Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip3 install Unicode decode error in Docker container #87

Open
sEpt0r opened this issue Oct 15, 2016 · 9 comments
Open

pip3 install Unicode decode error in Docker container #87

sEpt0r opened this issue Oct 15, 2016 · 9 comments

Comments

@sEpt0r
Copy link

sEpt0r commented Oct 15, 2016

I have the same issue as #82
I can't install pyrebase in docker container with python 3.5.

The simplest Dockerfile for test it:

FROM ubuntu:16.04

RUN apt-get update
RUN apt-get install -y python3-pip

RUN pip3 install Pyrebase
Collecting jws>=0.1.3 (from python-jwt->Pyrebase->-r /app/requirements.txt (line 5))
  Downloading 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 "/tmp/pip-build-r4gg1082/jws/setup.py", line 17, in <module>
        long_description=read('README.md'),
      File "/tmp/pip-build-r4gg1082/jws/setup.py", line 5, in read
        return open(os.path.join(os.path.dirname(__file__), fname)).read()
      File "/usr/lib/python3.5/encodings/ascii.py", line 26, in decode
        return codecs.ascii_decode(input, self.errors)[0]
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 500: ordinal not in range(128)

I installed fixed jws from source and Pyrebase was successfully installed.
Some guys recommend install PyJWT instead python-jwt, also https://jwt.io/ recommends to install PyJWT.
Do you have a plans to migrate from python-jwt on PyJWT?

@thisbejim
Copy link
Owner

Hi @sEpt0r, thanks for bringing this up! This should be fixed by #93, please let me know if you find that this error still exists on your end. If it does we will move to PyJWT.

@MRsAIbot
Copy link

MRsAIbot commented Jan 11, 2017

Hi @thisbejim, thanks for the comment. I am still experiencing this issue after you merged the commit in #93.

Collecting jws>=0.1.3 (from python-jwt==2.0.1->pyrebase)
  Downloading 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 "/tmp/pip-build-fmrf4cra/jws/setup.py", line 17, in <module>
        long_description=read('README.md'),
      File "/tmp/pip-build-fmrf4cra/jws/setup.py", line 5, in read
        return open(os.path.join(os.path.dirname(__file__), fname)).read()
      File "/opt/conda/lib/python3.5/encodings/ascii.py", line 26, in decode
        return codecs.ascii_decode(input, self.errors)[0]
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 500: ordinal not in range(128)

I used the same Dockerfile as @sEpt0r to test it.

The suggestion in #82 to do sudo apt-get install locales didn't work either

EDIT: I installed a random older version (3.0.10) and that worked fine.

Here is the Dockerfile

FROM ubuntu:16.04

RUN apt-get update
RUN apt-get install -y python3-pip

RUN pip3 install http://pypi.python.org/packages/db/06/e7ca923475431baf98e37b9627ca29903570b9e749f507d2902dcf222213/Pyrebase-3.0.10-py3-none-any.whl

@thisbejim thisbejim reopened this Jan 11, 2017
@ukjin1192
Copy link

First of all, thanks for this great project 👍

I have same issue - From version 3.0.12, it failed with UnicodeDecodeError.

In case of version 3.0.11, it does not yield UnicodeDecodeError, but dependency error occurred from six, packaging and appdirs. I succeed to install after installing these packages.

@mcarrilloco
Copy link

Seems like the problems here come from the dependency jws. I am also experiencing this issue when installing in a VPS with Ubuntu. There are two open pull request right now that seems to solve the issue but haven't been merged into the dependency:

brianloveswords/python-jws#25
brianloveswords/python-jws#21

@ippeiukai
Copy link

Following work around did the job:
LC_CTYPE="en_US.UTF-8" pip install jws

@alex1989
Copy link

alex1989 commented Dec 29, 2017

you can try this before install pip dependecies, it should help you

ENV LANG C.UTF-8

@BobMak
Copy link

BobMak commented Sep 14, 2018

Collecting jws>=0.1.3 (from python-jwt->Pyrebase->-r /app/requirements.txt (line 5))
Downloading jws-0.1.3.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-build-r4gg1082/jws/setup.py", line 17, in
long_description=read('README.md'),

File "/tmp/pip-build-r4gg1082/jws/setup.py", line 5, in read
return open(os.path.join(os.path.dirname(file), fname)).read()
File "/usr/lib/python3.5/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 500: ordinal not in range(128)

Installing the jws separately solved it for me. What I did:
Download jws-0.1.3.tar.gz
Decompress
Remove line long_description=read('README.md'), from setup.py
Install the module python setup.py install
Now run pip install pyrebase

If you will experience a problem with googleapis-common-protos dependency like me, refer to this post and update setuptools.

@DmitryAlekseev
Copy link

it's work for me

export LANG=C.UTF-8
pip install pyrebase

@hpbl
Copy link

hpbl commented Aug 1, 2019

As @DmitryAlekseev suggested, adding ENV LANG C.UTF-8 to my Dockerfile solved the problem for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants