aspiers / git-deps

git commit dependency analysis tool
GNU General Public License v2.0
297 stars 46 forks source link

Errors encountered installing git-deps under Windows #92

Open johnddx opened 5 years ago

johnddx commented 5 years ago

I'm not able to run "pip install git-deps" under Windows 10.

error in setup command: Error parsing C:\Users\johndog\AppData\Local\Temp\2\pip-install-_m6ma4lh\git-deps\setup.cfg: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 910: character maps to <undefined> I ran pip with --no-clean and looked at the setup.cfg, but I didn't see any problems in it (or even a byte 0x9d), so it must be somewhere else than implied by the error message.

C:\Users\johnddx>pip install git-deps 
Collecting git-deps
  Using cached https://files.pythonhosted.org/packages/6d/02/b90cfd102dcd6bddaccbaed0b55d7d39cea8fa602c465fb8f35216028ea1/git-deps-1.0.1.tar.gz
    ERROR: Complete output from command python setup.py egg_info:
    ERROR:

    !!! pandoc not found, long_description is bad, don't upload this to PyPI !!!

    C:\Users\johnddx\AppData\Local\Temp\2\easy_install-vbrkjq5p\pypandoc-1.4\setup.py:16: DeprecationWarning: Due to possible ambiguity, 'convert()' is deprecated. Use 'convert_file()'  or 'convert_text()'.
      long_description = pypandoc.convert('README.md', 'rst')
    See http://johnmacfarlane.net/pandoc/installing.html
    for installation options
    ---------------------------------------------------------------

    zip_safe flag not set; analyzing archive contents...
    pypandoc.__pycache__.__init__.cpython-37: module references __file__

    Installed c:\users\johnddx\appdata\local\temp\2\pip-install-_m6ma4lh\git-deps\.eggs\pypandoc-1.4-py3.7.egg
    Searching for wheel>=0.25.0
    Reading https://pypi.org/simple/wheel/
    Downloading https://files.pythonhosted.org/packages/96/ba/a4702cbb6a3a485239fbe9525443446203f00771af9ac000fa3ef2788201/wheel-0.33.1-py2.py3-none-any.whl#sha256=8eb4a788b3aec8abf5ff68d4165441bc57420c9f64ca5f471f58c3969fe08668
    Best match: wheel 0.33.1
    Processing wheel-0.33.1-py2.py3-none-any.whl
    Installing wheel-0.33.1-py2.py3-none-any.whl to c:\users\johnddx\appdata\local\temp\2\pip-install-_m6ma4lh\git-deps\.eggs
    writing requirements to c:\users\johnddx\appdata\local\temp\2\pip-install-_m6ma4lh\git-deps\.eggs\wheel-0.33.1-py3.7.egg\EGG-INFO\requires.txt

    Installed c:\users\johnddx\appdata\local\temp\2\pip-install-_m6ma4lh\git-deps\.eggs\wheel-0.33.1-py3.7.egg
    ERROR:root:Error parsing
    Traceback (most recent call last):
      File "c:\users\johnddx\appdata\local\temp\2\pip-install-_m6ma4lh\git-deps\.eggs\pyscaffold-2.5.11-py3.7.egg\pyscaffold\contrib\pbr\pbr\core.py", line 96, in pbr
        attrs = util.cfg_to_args(path, dist.script_args)
      File "c:\users\johnddx\appdata\local\temp\2\pip-install-_m6ma4lh\git-deps\.eggs\pyscaffold-2.5.11-py3.7.egg\pyscaffold\contrib\pbr\pbr\util.py", line 258, in cfg_to_args
        pbr.hooks.setup_hook(config)
      File "c:\users\johnddx\appdata\local\temp\2\pip-install-_m6ma4lh\git-deps\.eggs\pyscaffold-2.5.11-py3.7.egg\pyscaffold\contrib\pbr\pbr\hooks\__init__.py", line 25, in setup_hook
        metadata_config.run()
      File "c:\users\johnddx\appdata\local\temp\2\pip-install-_m6ma4lh\git-deps\.eggs\pyscaffold-2.5.11-py3.7.egg\pyscaffold\contrib\pbr\pbr\hooks\base.py", line 27, in run
        self.hook()
      File "c:\users\johnddx\appdata\local\temp\2\pip-install-_m6ma4lh\git-deps\.eggs\pyscaffold-2.5.11-py3.7.egg\pyscaffold\contrib\pbr\pbr\hooks\metadata.py", line 26, in hook
        self.config['name'], self.config.get('version', None))
      File "c:\users\johnddx\appdata\local\temp\2\pip-install-_m6ma4lh\git-deps\.eggs\pyscaffold-2.5.11-py3.7.egg\pyscaffold\contrib\pbr\pbr\packaging.py", line 798, in get_version
        version = _get_version_from_pkg_metadata(package_name)
      File "c:\users\johnddx\appdata\local\temp\2\pip-install-_m6ma4lh\git-deps\.eggs\pyscaffold-2.5.11-py3.7.egg\pyscaffold\contrib\pbr\pbr\packaging.py", line 766, in _get_version_from_pkg_metadata
        pkg_metadata = email.message_from_file(pkg_metadata_file)
      File "c:\python37\lib\email\__init__.py", line 54, in message_from_file
        return Parser(*args, **kws).parse(fp)
      File "c:\python37\lib\email\parser.py", line 54, in parse
        data = fp.read(8192)
      File "c:\python37\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 910: character maps to <undefined>
    **error in setup command: Error parsing C:\Users\johnddx\AppData\Local\Temp\2\pip-install-_m6ma4lh\git-deps\setup.cfg: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 910: character maps to <undefined>**
    ----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in C:\Users\johnddx\AppData\Local\Temp\2\pip-install-_m6ma4lh\git-deps\
jmiguel-hdez commented 4 years ago

i get the same error

aspiers commented 3 years ago

Hi, I've just released 1.1.0. Any chance you could test whether you still see this issue? Thanks!

prrichard commented 3 years ago

Hi, I am getting the error in version 1.1.0.

C:\Users\xyz>pip3 install git-deps Collecting git-deps Downloading https://files.pythonhosted.org/packages/af/b6/a972c2e33471312039eaee79b0f361807aac43a680ea1c69db2c8d87e13a/git-deps-1.1.0.zip (8.1MB) |████████████████████████████████| 8.2MB 3.3MB/s ERROR: Command errored out with exit status 1: command: 'c:\users\xyz\appdata\local\programs\python\python37\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\xy~1\AppData\Local\Temp\2\pip-install-dr453odx\git-deps\setup.py'"'"'; file='"'"'C:\Users\xy~1\AppData\Local\Temp\2\pip-install-dr453odx\git-deps\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\xy~1\AppData\Local\Temp\2\pip-install-dr453odx\git-deps\pip-egg-info' cwd: C:\Users\xy~1\AppData\Local\Temp\2\pip-install-dr453odx\git-deps\ Complete output (28 lines): zip_safe flag not set; analyzing archive contents... pypandoc.pycache.init.cpython-37: module references file

Installed c:\users\xy~1\appdata\local\temp\2\pip-install-dr453odx\git-deps\.eggs\pypandoc-1.5-py3.7.egg
ERROR:root:Error parsing
Traceback (most recent call last):
  File "c:\users\xy~1\appdata\local\temp\2\pip-install-dr453odx\git-deps\.eggs\pyscaffold-2.5.11-py3.7.egg\pyscaffold\contrib\pbr\pbr\core.py", line 96, in pbr
    attrs = util.cfg_to_args(path, dist.script_args)
  File "c:\users\xy~1\appdata\local\temp\2\pip-install-dr453odx\git-deps\.eggs\pyscaffold-2.5.11-py3.7.egg\pyscaffold\contrib\pbr\pbr\util.py", line 258, in cfg_to_args
    pbr.hooks.setup_hook(config)
  File "c:\users\xy~1\appdata\local\temp\2\pip-install-dr453odx\git-deps\.eggs\pyscaffold-2.5.11-py3.7.egg\pyscaffold\contrib\pbr\pbr\hooks\__init__.py", line 25, in setup_hook
    metadata_config.run()
  File "c:\users\xy~1\appdata\local\temp\2\pip-install-dr453odx\git-deps\.eggs\pyscaffold-2.5.11-py3.7.egg\pyscaffold\contrib\pbr\pbr\hooks\base.py", line 27, in run
    self.hook()
  File "c:\users\xy~1\appdata\local\temp\2\pip-install-dr453odx\git-deps\.eggs\pyscaffold-2.5.11-py3.7.egg\pyscaffold\contrib\pbr\pbr\hooks\metadata.py", line 26, in hook
    self.config['name'], self.config.get('version', None))
  File "c:\users\xy~1\appdata\local\temp\2\pip-install-dr453odx\git-deps\.eggs\pyscaffold-2.5.11-py3.7.egg\pyscaffold\contrib\pbr\pbr\packaging.py", line 798, in get_version
    version = _get_version_from_pkg_metadata(package_name)
  File "c:\users\xy~1\appdata\local\temp\2\pip-install-dr453odx\git-deps\.eggs\pyscaffold-2.5.11-py3.7.egg\pyscaffold\contrib\pbr\pbr\packaging.py", line 766, in _get_version_from_pkg_metadata
    pkg_metadata = email.message_from_file(pkg_metadata_file)
  File "c:\users\xyz\appdata\local\programs\python\python37\lib\email\__init__.py", line 54, in message_from_file
    return Parser(*args, **kws).parse(fp)
  File "c:\users\xyz\appdata\local\programs\python\python37\lib\email\parser.py", line 54, in parse
    data = fp.read(8192)
  File "c:\users\xyz\appdata\local\programs\python\python37\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 2916: character maps to <undefined>
error in setup command: Error parsing C:\Users\xy~1\AppData\Local\Temp\2\pip-install-dr453odx\git-deps\setup.cfg: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 2916: character maps to <undefined>
----------------------------------------

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. WARNING: You are using pip version 19.3.1; however, version 21.0.1 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command.

aspiers commented 3 years ago

Thanks for the confirmation. I have no clue how to fix that, and TBH it doesn't sound like it's related to git-deps, but I will leave the issue open anyway. Perhaps you could try upgrading pip or even Python?

johnddx commented 3 years ago

@aspiers can I assume you are not attempting this on Windows?

It seems Python has different behavior under Windows than other platforms, in that "open()" does not default to utf-8. There might be a bug somewhere in the package deployment stack (not necessarily in git-deps) with an open() call that doesn't specify utf-8-sig as the default encoding, and that runs into problems with certain content (which might be in git-deps).

aspiers commented 3 years ago

That's correct, I use Linux. I will have to rely on Windows users to help debug this.

Yes, that sounds like a very reasonable possibility.