r9y9 / nnmnkwii

Library to build speech synthesis systems designed for easy and fast prototyping.

Home Page:https://r9y9.github.io/nnmnkwii/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pip install produces UnicodeCodecError

rafaelvalle opened this issue · comments

Hi! I get a UnicodeDecodeError when trying to install your library.

pip install --user nnmnkwii
Collecting nnmnkwii
  Using cached nnmnkwii-0.0.6.tar.gz
    Complete output from command python setup.py egg_info:
    fatal: Not a git repository (or any parent up to mount point /tmp)
    Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-1it86_s_/nnmnkwii/setup.py", line 110, in <module>
        README = open('README.rst').read()
      File "/opt/conda/envs/pytorch-py35/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 300: ordinal not in range(128)

Any thoughts what this could be and how to fix it?

Thank you for reporting this. I cannot reproduce this locally with fresh conda env, but it looks like apparently an encoding issue. Could you try to clone the repository and apply the following patch and see how it works?

diff --git a/setup.py b/setup.py
index a3f83fe..c5fbc9e 100644
--- a/setup.py
+++ b/setup.py
@@ -107,7 +107,7 @@ if not exists('README.rst'):
     create_readme_rst()
 
 if exists('README.rst'):
-    README = open('README.rst').read()
+    README = open('README.rst', 'rb').read().decode("utf-8")
 else:
     README = ''

Yes, indeed the problem is with the ASCII UTF-8 encoding.
Another possible solution is to open the file with the UTF-8 encoding.

README = open('README.rst', 'rb', encoding='utf-8').read()

Note that the tacotron_pytorch repo will produce a similar error in train.py for classes TextDataSource and _NPYDataSource

The library supports python2.7, so that solution isn't enough actually. I will try to address same issues in tactoron_pytorch soon.

r9y9/tacotron_pytorch@bdad19f

Could you confirm if it fixes your issue?