remarshal-project / remarshal

Convert between CBOR, JSON, MessagePack, TOML, and YAML

Home Page:https://pypi.org/project/remarshal/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`remarshal` cannot be installed on Ubuntu 18.04

a-rodin opened this issue · comments

After version 0.13 was released, installing remarshal using pip3 started to fail on Ubuntu 18.04:

$ sudo apt-get install -y python3-pip
$ pip3 install remarshal
Collecting remarshal
  Downloading https://files.pythonhosted.org/packages/db/0e/a0508324594631aa4797434cc5872e7ab381599610f332ac374082e25c64/remarshal-0.12.0-py3-none-any.whl
Collecting python-dateutil>=2.5.0 (from remarshal)
  Downloading https://files.pythonhosted.org/packages/d4/70/d60450c3dd48ef87586924207ae8907090de0b306af2bce5d134d78615cb/python_dateutil-2.8.1-py2.py3-none-any.whl (227kB)
Collecting pytoml>=0.1.11 (from remarshal)
  Downloading https://files.pythonhosted.org/packages/a5/47/c7f8a0f210ad18576840922e0b504f0b7f5f73aea4a52ab14c5b58517edf/pytoml-0.1.21-py2.py3-none-any.whl
Collecting PyYAML>=5.1 (from remarshal)
  Downloading https://files.pythonhosted.org/packages/3d/d9/ea9816aea31beeadccd03f1f8b625ecf8f645bd66744484d162d84803ce5/PyYAML-5.3.tar.gz (268kB)
Collecting cbor2>=5.0.0 (from remarshal)
  Downloading https://files.pythonhosted.org/packages/3e/2c/188d040bd4cf99012d0e847a3d95bf1ef1f783859b09eb9f736950af84f0/cbor2-5.0.1.tar.gz (72kB)
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-mhghax8e/cbor2/setup.py", line 52, in <module>
        **kwargs
      File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 128, in setup
        _install_setup_requires(attrs)
      File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 121, in _install_setup_requires
        dist.parse_config_files(ignore_option_errors=True)
      File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 491, in parse_config_files
        _Distribution.parse_config_files(self, filenames=filenames)
      File "/usr/lib/python3.6/distutils/dist.py", line 395, in parse_config_files
        parser.read(filename)
      File "/usr/lib/python3.6/configparser.py", line 697, in read
        self._read(fp, filename)
      File "/usr/lib/python3.6/configparser.py", line 1015, in _read
        for lineno, line in enumerate(fp, start=1):
      File "/usr/lib/python3.6/encodings/ascii.py", line 26, in decode
        return codecs.ascii_decode(input, self.errors)[0] 
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 149: ordinal not in range(128)

The versions of Python and pip:

$ python3 --version
Python 3.6.9
$ pip3 --version
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)

You mean version 0.12, not 0.13. I have reproduced this with

> docker run --rm -i -t ubuntu:18.04 /bin/sh -c 'apt update && apt install -y python3-pip && pip3 install remarshal'

Will investigate.

Interesting project, by the way.

This is an upstream issue. You need a UTF-8 locale to install the cbor2 package Remarshal 0.12.0 requires. Most desktop Ubuntu 18.04 users won't have a problem with this since desktop variants of Ubuntu generate and configure the <your language code>.UTF-8 locale by default. A minimal installation may lack such a locale, and the Docker image you use does.

What you need is to generate the appropriate locale first. For example, the following command works.

docker run --rm -i -t ubuntu:18.04 /bin/sh -c '
  apt update \
  && echo "en_US.UTF-8 UTF-8" > /etc/locale.gen \
  && apt install -y locales python3-pip \
  && env LC_ALL=en_US.UTF-8 pip3 install remarshal
'

@dbohdan Thanks for the explanation! I opened issue agronholm/cbor2#74.

You're welcome!