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

pythonfinder + pyenv + anaconda issue #3044

Closed
AlJohri opened this issue Oct 16, 2018 · 1 comment
Closed

pythonfinder + pyenv + anaconda issue #3044

AlJohri opened this issue Oct 16, 2018 · 1 comment
Assignees
Labels
Type: Bug 🐛 This issue is a bug. Type: Vendored Dependencies This issue affects vendored dependencies within pipenv.

Comments

@AlJohri
Copy link
Contributor

AlJohri commented Oct 16, 2018

Issue description

Upgraded my pipenv today and ran into this issue. I have anaconda installed through peynv (this is fully supported by pyenv).
screen shot 2018-10-15 at 9 12 54 pm

Expected result

Even though this is not my active python, pipenv is failing to parse it. At the very least, this should be try-excepted. Ideally supported.

Actual result

Traceback (most recent call last):
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/pyenv.py", line 53, in get_versions
    version = PythonVersion.parse(p.name)
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/python.py", line 119, in parse
    raise ValueError("Not a valid python version: %r" % version)
ValueError: Not a valid python version: <LegacyVersion('anaconda3-5.0.1')>

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 90, in find_python_version
    return self.system_path.find_python_version(
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/pythonfinder.py", line 44, in system_path
    ignore_unsupported=self.ignore_unsupported,
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 309, in create
    ignore_unsupported=ignore_unsupported,
  File "<attrs generated init 21cfbcaf749d3af30eb10d5110d156423170deac>", line 37, in __init__
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 102, in __attrs_post_init__
    self._setup_pyenv()
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 133, in _setup_pyenv
    self.pyenv_finder = PyenvFinder.create(root=PYENV_ROOT, ignore_unsupported=self.ignore_unsupported)
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/pyenv.py", line 98, in create
    return cls(root=root, ignore_unsupported=ignore_unsupported)
  File "<attrs generated init 3bd668a02d3a0c4cfaeeb9a891e230fd7b4070d4>", line 7, in __init__
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/pyenv.py", line 57, in get_versions
    version = self.version_from_bin_dir(bin_dir)
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/pyenv.py", line 36, in version_from_bin_dir
    version = get_python_version(py.as_posix())
  File "/Users/johria/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/utils.py", line 41, in get_python_version
    raise InvalidPythonVersion("%s is not a valid python path" % path)
pipenv.vendor.pythonfinder.exceptions.InvalidPythonVersion: /Users/johria/.pyenv/versions/anaconda3-5.0.1/bin/anaconda is not a valid python path

Steps to replicate

Provide the steps to replicate (which usually at least includes the commands and the Pipfile).


Please run $ pipenv --support, and paste the results here. Don't put backticks (`) around it! The output already contains Markdown formatting.

If you're on macOS, run the following:

$ pipenv --support | pbcopy

If you're on Windows, run the following:

> pipenv --support | clip

If you're on Linux, run the following:

$ pipenv --support | xclip

The command pipenv --support | pbcopy fails with the same error.

pipenv --version, pipenv, version 2018.10.13

@techalchemy techalchemy added Type: Bug 🐛 This issue is a bug. Type: Vendored Dependencies This issue affects vendored dependencies within pipenv. labels Oct 29, 2018
@techalchemy techalchemy self-assigned this Oct 29, 2018
@techalchemy
Copy link
Member

This was fixed in #3096 so I believe it should work in the coming release, closing for now -- thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug 🐛 This issue is a bug. Type: Vendored Dependencies This issue affects vendored dependencies within pipenv.
Projects
None yet
Development

No branches or pull requests

2 participants