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

pip install fails on python3.8 #216

Closed
hobson opened this issue Dec 9, 2020 · 4 comments
Closed

pip install fails on python3.8 #216

hobson opened this issue Dec 9, 2020 · 4 comments
Assignees

Comments

@hobson
Copy link

hobson commented Dec 9, 2020

Environment

Ubuntu 20.04
Python 3.7.9: conda create -n py38 'python>=3.8,<3.9' && conda activate py38

Reproduce

  1. activate a python 3.8+ environment
  2. pip install from pypi or from source: git clone [email protected]:ejwa/gitinspector && cd gitinspector && pip install -e .

Traceback

$ git clone [email protected]:ejwa/gitinspector && cd gitinspector
$ conda create -n py38 'python>=3.8,<3.9' && conda activate py38
$ python --version
Python 3.8.5
$ pip install .
Processing /home/hobs/code/tangibleai/gitinspector
    ERROR: Command errored out with exit status 1:
     command: /home/hobs/anaconda3/envs/py38/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-0blcltb3/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-0blcltb3/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 /tmp/pip-pip-egg-info-kmx4x74r
         cwd: /tmp/pip-req-build-0blcltb3/
    Complete output (11 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-req-build-0blcltb3/setup.py", line 22, in <module>
        from gitinspector.version import __version__
      File "/tmp/pip-req-build-0blcltb3/gitinspector/version.py", line 23, in <module>
        localization.init()
      File "/tmp/pip-req-build-0blcltb3/gitinspector/localization.py", line 71, in init
        __translation__.install(True)
      File "/home/hobs/anaconda3/envs/py38/lib/python3.8/gettext.py", line 352, in install
        for name in allowed & set(names):
    TypeError: 'bool' object is not iterable
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Workaround

downgrade to python <3.8

@maccuaa
Copy link

maccuaa commented Dec 10, 2020

Removing True from that line worked for me - localization.py:71

- __translation__.install(True)
+ __translation__.install()

Python 3.9.0
macOS 10.14.6

@adam-waldenberg adam-waldenberg self-assigned this Dec 13, 2020
@adam-waldenberg adam-waldenberg added this to the 0.5.0 milestone Dec 13, 2020
@adam-waldenberg
Copy link
Member

Yep - seems the API changed here in more recent bindings of gettext. Will take a proper look for the next release. Thank you for the report and solution.

@adam-waldenberg
Copy link
Member

Closing this, as it is a duplicate. See #213 for the original reported issue.

@thiagodp
Copy link

thiagodp commented May 1, 2021

Python 3.9.4 on Windows 10 20H2

It still gives the following error after making the change proposed by @maccuaa

C:\dev\python\lib\subprocess.py:941: RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used
  self.stdout = io.open(c2pread, 'rb', bufsize)
Traceback (most recent call last):
  File "C:\Users\Thiago\AppData\Roaming\npm\node_modules\gitinspector\gitinspector.py", line 24, in <module>
    gitinspector.main()
  File "C:\Users\Thiago\AppData\Roaming\npm\node_modules\gitinspector\gitinspector\gitinspector.py", line 206, in main
    run.process(repos)
  File "C:\Users\Thiago\AppData\Roaming\npm\node_modules\gitinspector\gitinspector\gitinspector.py", line 58, in process
    localization.disable()
  File "C:\Users\Thiago\AppData\Roaming\npm\node_modules\gitinspector\gitinspector\localization.py", line 106, in disable
    gettext.NullTranslations().install(True)
  File "C:\dev\python\lib\gettext.py", line 354, in install
    for name in allowed & set(names):
TypeError: 'bool' object is not iterable

Removing True from localization.py:106 worked for me, although still receiving the following warning:

C:\dev\python\lib\subprocess.py:941: RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used
  self.stdout = io.open(c2pread, 'rb', bufsize)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants