0

I am trying to pip install ffmpeg-normalize in Python 3.6.1. This used to work fine in Python 2.7.13 but not in the latest version, it seems.

In an elevated command prompt i type: pip install ffmpeg-normalize

I continue to get Command "python setup.py egg_info" failed with error code 1 for some reason and I am not sure what this means...

C:\Users\Arete>python --version
Python 3.6.1

C:\Users\Arete>pip install ffmpeg-normalize
Collecting ffmpeg-normalize
  Using cached ffmpeg-normalize-0.4.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\Arete\AppData\Local\Temp\pip-build-rcxpzvv4\ffmpeg-normalize\setup.py", line 7, in <module>
        readme = readme_file.read()
      File "c:\program files\python36\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 0x9d in position 2117: character maps to <undefined>

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\Arete\AppData\Local\Temp\pip-build-rcxpzvv4\ffmpeg-normalize\

C:\Users\Arete>

I am using Windows 10. and I have already tried the accepted answer on a very similar question without any luck...

What is causing the problem here and how can I get ffmpeg-normalize installed?

Community
  • 1
  • 1
Arete
  • 948
  • 3
  • 21
  • 48

1 Answers1

2

This looks like a bug in setup.py to me. Since the default encoding used in python 3 when opening a file in text mode is platform-dependent, an encoding should be explicitly provided. Otherwise the result of a read operation will be unpredictable and it will fail if the default encoding can't handle the file's content, as happened in your case.

You should be able to fix it by checking out the source code and changing this line:

with open('README.rst') as readme_file:

to use UTF-8

with open('README.rst', encoding='utf8') as readme_file:

To install open a command prompt, cd to the directory containing setup.py and then:

pip install .
Stop harming Monica
  • 12,141
  • 1
  • 36
  • 56