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

Failed to install stestr on mac 10.13.4 #163

Closed
TommyLike opened this issue Apr 17, 2018 · 15 comments
Closed

Failed to install stestr on mac 10.13.4 #163

TommyLike opened this issue Apr 17, 2018 · 15 comments

Comments

@TommyLike
Copy link

This package can not be installed on mac 10.13.4, this is the error message when installing.

╰─$ pip install -U stestr                                                                                                                                                      1 ↵
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Collecting stestr
  Downloading http://mirrors.aliyun.com/pypi/packages/e9/f8/8c2f7b2bcfbfc2c260893594c5af9a9486e11326fdecbc1f15b0c0b61f81/stestr-2.0.0.tar.gz (101kB)
    100% |████████████████████████████████| 102kB 992kB/s
    Complete output from command python setup.py egg_info:
    running egg_info
    creating pip-egg-info/stestr.egg-info
    writing requirements to pip-egg-info/stestr.egg-info/requires.txt
    writing pip-egg-info/stestr.egg-info/PKG-INFO
    writing top-level names to pip-egg-info/stestr.egg-info/top_level.txt
    writing dependency_links to pip-egg-info/stestr.egg-info/dependency_links.txt
    writing entry points to pip-egg-info/stestr.egg-info/entry_points.txt
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/k5/jlzm7kjj0ws9d4p4x222zzf40000gn/T/pip-install-cjnV29/stestr/setup.py", line 29, in <module>
        pbr=True)
      File "/usr/local/lib/python2.7/site-packages/setuptools/__init__.py", line 129, in setup
        return distutils.core.setup(**attrs)
      File "/usr/local/Cellar/python@2/2.7.14_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 151, in setup
        dist.run_commands()
      File "/usr/local/Cellar/python@2/2.7.14_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
        self.run_command(cmd)
      File "/usr/local/Cellar/python@2/2.7.14_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 271, in run
        writer(self, ep.name, os.path.join(self.egg_info, ep.name))
      File "/usr/local/lib/python2.7/site-packages/pbr/pbr_json.py", line 25, in write_pbr_json
        git_dir = git._run_git_functions()
      File "/usr/local/lib/python2.7/site-packages/pbr/git.py", line 131, in _run_git_functions
        if _git_is_installed():
      File "/usr/local/lib/python2.7/site-packages/pbr/git.py", line 83, in _git_is_installed
        _run_shell_command(['git', '--version'])
      File "/usr/local/lib/python2.7/site-packages/pbr/git.py", line 49, in _run_shell_command
        env=newenv)
      File "/usr/local/Cellar/python@2/2.7.14_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 390, in __init__
        errread, errwrite)
      File "/usr/local/Cellar/python@2/2.7.14_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1025, in _execute_child
        raise child_exception
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 0: ordinal not in range(128)
@mtreinish
Copy link
Owner

So this looks like a bug in PBR based on the stack trace, but I haven't confirmed that. Just curious which versions of pbr and pip are on your system?

Stestr isn't really doing anything special in its pbr usage. So I don't have any hints off the top of my head on what is causing this.

@TommyLike
Copy link
Author

Thanks @mtreinish
pbr 3.1.1
pip 10.0.0 from /usr/local/lib/python2.7/site-packages/pip (python 2.7)

@mtreinish
Copy link
Owner

mtreinish commented Apr 18, 2018

Ok cool, there is known issue with windows and pbr 4.0.0. So it's good to rule that out here. Pip 10 was just released, do you have the same issue with pip <10? I don't have a Mac environment to test things on, but I'm thinking pip 10 might have changed something and that's causing the issue.

@masayukig
Copy link
Collaborator

FYI, I just tested to install stestr with pip on my mac(Mac mini). And there's no issue for the installation.

My environment:

System Version: macOS 10.13.3 (17D47)
Kernel Version: Darwin 17.4.0
pip 10.0.0
pbr 4.0.2
stestr 2.0.0

@mtreinish
Copy link
Owner

@masayukig yeah I'm thinking the issue here is a mix of localization settings having git use unicode characters and pbr < 4.0.2. I just took a look at recent pbr commits and came across: openstack/pbr@7767c44 which seems to support this idea. So we need to see if the issue persists on 4.0.2.

If using pbr 4.0.2 fixes this that's good and we know how to workaround this for now. But we'll have a potential issue when we try to release stestr next. We had to cap the pbr version in stestr because of a bug in pbr: https://bugs.launchpad.net/pbr/+bug/1761134 on windows. So we'll have to sort that out if we need pbr 4.0.2 to fix this.

@masayukig
Copy link
Collaborator

@mtreinish ok, I see and agree with that.

FYI, I've also tested with some combinations like pbr3.1.1 and environment variables(LC_ALL, LANG, etc). But I couldn't reproduce the issue yet, though. But I think there are still some differences from @TommyLike 's environment. So, this is not so surprising.

@TommyLike
Copy link
Author

Thanks @mtreinish and @masayukig, Now I would like to try another mac to see if this is a individual issue:)

@cybertron
Copy link

I'm curious what the output of git --version looks like on TommyLike's system. On mine it's this:

[bnemec@RedHat ~]$ git --version
git version 2.13.6

I suppose it's possible that if "version" is localized it could end up with unicode data in it.

@TommyLike
Copy link
Author

thanks @cybertron, looks like normal.

╰─$ git --version
git version 2.13.0

@TommyLike
Copy link
Author

The bug is finally located, I have to append these two lines in my zshrc file.

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

@TommyLike
Copy link
Author

Thanks everyone:)

@masayukig
Copy link
Collaborator

@TommyLike I think that's just a workaround. So, I think the issue isn't resolved yet. Especially for multibytes language environment users like us :)

@mtreinish I think we shouldn't close this issue yet. What do you think?

@mtreinish
Copy link
Owner

Yeah, I consider setting a different localization setting as just a workaround not actually a fix for the bug. We really should be able to make this work in an environment with any localization settings. That being said I think this is still probably a pbr bug of some sort. I'm fine with keeping this open until we get it truly sorted.

@mtreinish mtreinish reopened this Apr 19, 2018
@cybertron
Copy link

Weird, that version output doesn't appear to have any unicode characters in it. I wonder if there's an error/warning message in the actual call that has unicode. I've run into something like that before.

Anyway, it seems like we should probably make pbr handle unicode from this call. It would be helpful if we can get a reproducer so we can verify that any fixes actually work.

@mtreinish
Copy link
Owner

I'm closing this since we haven't been able to reproduce it in the year since and I haven't seen any more details on this.

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

4 participants