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

Ignore pythonz / gracefully handle non-pythons #19

Closed
techalchemy opened this issue Oct 15, 2018 · 1 comment
Closed

Ignore pythonz / gracefully handle non-pythons #19

techalchemy opened this issue Oct 15, 2018 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@techalchemy
Copy link
Member

No description provided.

@techalchemy techalchemy added the bug Something isn't working label Oct 15, 2018
@techalchemy techalchemy self-assigned this Oct 15, 2018
@AlJohri
Copy link
Contributor

AlJohri commented Oct 16, 2018

Even on a regular pyenv python, Python 3.6.5, I'm getting the pythonz not found error via a WindowsError:

Error %s while executing command %s name 'WindowsError' is not defined /usr/local/bin/pythonz -c import sys; print(sys.version.split()[0])
Traceback (most recent call last):
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/vistir/misc.py", line 102, in _spawn_subprocess
    return subprocess.Popen(cmd, **options)
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/subprocess.py", line 709, in __init__
    restore_signals, start_new_session)
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/subprocess.py", line 1344, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/bin/pythonz': '/usr/local/bin/pythonz'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/johria/.pyenv/versions/3.6.5/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/cli/command.py", line 249, in install
    editable_packages=state.installstate.editables,
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/core.py", line 1724, in do_install
    pypi_mirror=pypi_mirror,
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/core.py", line 565, in ensure_project
    pypi_mirror=pypi_mirror,
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/core.py", line 488, in ensure_virtualenv
    python = ensure_python(three=three, python=python)
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/core.py", line 401, in ensure_python
    path_to_python = find_a_system_python(python)
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/core.py", line 364, in find_a_system_python
    python_entry = finder.find_python_version(line)
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/pythonfinder.py", line 91, in find_python_version
    major=major, minor=minor, patch=patch, pre=pre, dev=dev, arch=arch
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 262, in find_python_version
    (c for c in sorted(path_filter, key=version_sort, reverse=True)), None
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 259, in <genexpr>
    path_filter = filter(None, (sub_finder(p) for p in paths if p is not None))
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/mixins.py", line 106, in find_python_version
    py_filter, key=lambda child: child[1].version_sort, reverse=True
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/mixins.py", line 96, in <genexpr>
    if child.as_python
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/cached_property.py", line 35, in __get__
    value = obj.__dict__[self.func.__name__] = self.func(obj)
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 364, in as_python
    self.py_version = PythonVersion.from_path(self.path)
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/python.py", line 162, in from_path
    py_version = get_python_version(str(path.path))
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/utils.py", line 37, in get_python_version
    out, _ = vistir.misc.run(version_cmd, block=True, nospin=True)
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/vistir/misc.py", line 293, in run
    combine_stderr=combine_stderr
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/vistir/misc.py", line 124, in _create_subprocess
    combine_stderr=combine_stderr)
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/vistir/misc.py", line 103, in _spawn_subprocess
    except WindowsError as e:
NameError: name 'WindowsError' is not defined

techalchemy added a commit that referenced this issue Oct 18, 2018
- Improve lookups and fallbacks for all finders
- Add support for named pythons, such as `anaconda...`
- Fix `pythonz` failures
- Fixes #19
- Fixes #20

Signed-off-by: Dan Ryan <dan@danryan.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants