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

python -m pipenv.help broken in 11.10.0 #1969

Closed
murrple-1 opened this issue Apr 12, 2018 · 4 comments
Closed

python -m pipenv.help broken in 11.10.0 #1969

murrple-1 opened this issue Apr 12, 2018 · 4 comments

Comments

@murrple-1
Copy link

See title. Erroring with TypeError: format() argument after ** must be a mapping, not NoneType.


Expected result

Help info should be output successfully

Actual result

Help info only partially succeeds, before erroring. Example output:

$ python -m pipenv.help
<details><summary>$ python -m pipenv.help output</summary>
Pipenv version: `'11.10.0'`
Pipenv location: `'/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/pipenv'`
Python location: `'/home/travis/virtualenv/python3.6.3/bin/python'`
Other Python installations in `PATH`:
  - `2.7`: `/opt/pyenv/shims/python2.7`
  - `2.7`: `/opt/pyenv/shims/python2.7`
  - `2.7`: `/usr/bin/python2.7`
  - `3.4`: `/usr/bin/python3.4m`
  - `3.4`: `/usr/bin/python3.4`
Traceback (most recent call last):
  File "/opt/python/3.6.3/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/opt/python/3.6.3/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/pipenv/help.py", line 89, in <module>
    main()
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/pipenv/help.py", line 24, in main
    found = find_python_in_path(python_v)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/pipenv/core.py", line 355, in find_python_in_path
    version = python_version(p)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/pipenv/utils.py", line 218, in python_version
    return u'{major}.{minor}.{micro}'.format(**version)
TypeError: format() argument after ** must be a mapping, not NoneType
The command "python -m pipenv.help" exited with 1.
Steps to replicate

Please see minimum-reproducible code at this repo, with this Travis-CI.

@uranusjr
Copy link
Member

I broke things again 🤦‍♂️ So sorry about that.

@uranusjr
Copy link
Member

I wonder what causes this on Travis though. One of python, python2, python3, and py commands returned something unexpected when passed the --version flag.

@jacebrowning
Copy link
Contributor

I'm seeing something similar on Travis CI that just started with 11.10.0:

pipenv install --dev
Creating a virtualenv for this project…
Using /opt/pyenv/versions/3.6/bin/python3.6m (3.6.3) to create virtualenv…
Running virtualenv with interpreter /opt/pyenv/versions/3.6/bin/python3.6m
Using base prefix '/opt/pyenv/versions/3.6'
New python executable in /home/travis/.local/share/virtualenvs/project_demo-bCjNwlW-/bin/python3.6m
Also creating executable in /home/travis/.local/share/virtualenvs/project_demo-bCjNwlW-/bin/python
Installing setuptools, pip, wheel...done.
Virtualenv location: /home/travis/build/zapier/project-template/demo/project_demo/.venv
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.6.3/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/pipenv/cli.py", line 366, in install
    selective_upgrade=selective_upgrade,
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/pipenv/core.py", line 1730, in do_install
    skip_requirements=skip_requirements,
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/pipenv/core.py", line 620, in ensure_project
    crayons.green(shorten_path(path_to_python)),
TypeError: __str__ returned non-string (type NoneType)

Let me know if this should be a separate issue.

@uranusjr
Copy link
Member

I hate pyenv shims 🤦‍♂️ It is slightly different, but #1971 should fix it as well.

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

3 participants