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

2018.11.14 regression: cannot create virtualenv #3232

Closed
dimbleby opened this issue Nov 15, 2018 · 5 comments
Closed

2018.11.14 regression: cannot create virtualenv #3232

dimbleby opened this issue Nov 15, 2018 · 5 comments
Assignees
Labels
Type: Bug 🐛 This issue is a bug. Type: Regression This issue is a regression of a previous behavior. Type: Vendored Dependencies This issue affects vendored dependencies within pipenv.

Comments

@dimbleby
Copy link

Issue description

Can't create new virtual environment.

Expected result

Run pipenv --three, say. Get a new virtual environment.

Actual result

$ pipenv --three --verbose                                                                                                                                       [7/188]
Traceback (most recent call last):
  File "/data/developer/.local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1114, in invoke
    return Command.invoke(self, ctx)
  File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/data/developer/.local/lib/python3.6/site-packages/pipenv/cli/command.py", line 203, in cli
    clear=state.clear,
  File "/data/developer/.local/lib/python3.6/site-packages/pipenv/core.py", line 569, in ensure_project
    pypi_mirror=pypi_mirror,
  File "/data/developer/.local/lib/python3.6/site-packages/pipenv/core.py", line 511, in ensure_virtualenv
    ensure_python(three=three, python=python)
  File "/data/developer/.local/lib/python3.6/site-packages/pipenv/core.py", line 397, in ensure_python
    path_to_python = find_a_system_python(python)
  File "/data/developer/.local/lib/python3.6/site-packages/pipenv/core.py", line 360, in find_a_system_python
    python_entry = finder.find_python_version(line)
  File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/pythonfinder.py", line 114, in find_python_version
    major=major, minor=minor, patch=patch, pre=pre, dev=dev, arch=arch, name=name
  File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 396, in find_python_version
    ver = next(iter(self.get_pythons(sub_finder)), None)
  File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 279, in get_pythons
    reverse=True
  File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 277, in <genexpr>
    (p for p in self._filter_paths(finder) if p.is_python),
  File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 264, in <genexpr>
    pth for pth in unnest(finder(p) for p in self.path_entries if p is not None)
  File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/utils.py", line 138, in unnest
    for el in target:
  File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 264, in <genexpr>
    pth for pth in unnest(finder(p) for p in self.path_entries if p is not None)
  File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/mixins.py", line 121, in find_python_version
    for child in unnest(self.pythons.values())
  File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 523, in pythons
    for path, entry in self.children.items():
  File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/cached_property.py", line 35, in __get__
    value = obj.__dict__[self.func.__name__] = self.func(obj)
  File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 494, in children
    for child_key, child_val in self._gen_children():
  File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 487, in _gen_children
    yield (child.as_posix(), PathEntry.create(path=child, **pass_args))
  File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 567, in create
    _new = cls(**creation_args)
  File "<attrs generated init 81256d6f9278a22b980267a2af2176cbb62c24db>", line 16, in __init__
  File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 510, in get_py_version
    py_version = PythonVersion.from_path(path=self, name=self.name)
  File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/python.py", line 418, in from_path
    instance_dict = cls.parse(py_version.strip())
  File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/python.py", line 366, in parse
    raise ValueError("Not a valid python version: %r" % version)
ValueError: Not a valid python version: <LegacyVersion('Starting installer, one moment...\ndm.c: 1693: not running as root returning empty list\nanaconda argparse: terminal size detection failed, usin
g default width\n[Errno 25] Inappropriate ioctl for device')>

Steps to replicate

pipenv --three

I mean I suppose there's something about my environment that triggers this - because surely you wouldn't make a release that simply didn't work - but I don't know what it is. 2018.10.13 works fine.


$ pipenv --support [9/285]

$ pipenv --support

Pipenv version: '2018.11.14'

Pipenv location: '/data/developer/.local/lib/python3.6/site-packages/pipenv'

Python location: '/usr/bin/python36'

Python installations found:

Traceback (most recent call last):
File "/data/developer/.local/bin/pipenv", line 11, in
sys.exit(cli())
File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 764, in call
return self.main(*args, **kwargs)
File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1114, in invoke
return Command.invoke(self, ctx)
File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/click/decorators.py", line 64, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/data/developer/.local/lib/python3.6/site-packages/pipenv/cli/command.py", line 142, in cli
get_pipenv_diagnostics()
File "/data/developer/.local/lib/python3.6/site-packages/pipenv/help.py", line 33, in get_pipenv_diagnostics
python_paths = finder.find_all_python_versions()
File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/pythonfinder.py", line 136, in find_all_python_versions
major=major, minor=minor, patch=patch, pre=pre, dev=dev, arch=arch, name=name
File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 328, in find_all_python_versions
values = list(self.get_pythons(sub_finder))
File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 279, in get_pythons
reverse=True
File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 277, in
(p for p in self._filter_paths(finder) if p.is_python),
File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 264, in
pth for pth in unnest(finder(p) for p in self.path_entries if p is not None)
File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/utils.py", line 138, in unnest
for el in target:
File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 264, in
pth for pth in unnest(finder(p) for p in self.path_entries if p is not None)
File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/mixins.py", line 76, in find_all_python_versions
path_filter = filter(None, (sub_finder(p) for p in self.children.values()))
File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/cached_property.py", line 35, in get
value = obj.dict[self.func.name] = self.func(obj)
File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 494, in children
for child_key, child_val in self._gen_children():
File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 487, in _gen_children
yield (child.as_posix(), PathEntry.create(path=child, **pass_args))
File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 567, in create
_new = cls(**creation_args)
File "<attrs generated init 6be5738e08783da8302cc0d6dfcda474b56054b8>", line 16, in init
File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 510, in get_py_version
py_version = PythonVersion.from_path(path=self, name=self.name)
File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/python.py", line 418, in from_path
instance_dict = cls.parse(py_version.strip())
File "/data/developer/.local/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/python.py", line 366, in parse
raise ValueError("Not a valid python version: %r" % version)
ValueError: Not a valid python version: <LegacyVersion('Starting installer, one moment...\ndm.c: 1693: not running as root returning empty list\nanaconda argparse: terminal size detection failed, usin
g default width\n[Errno 25] Inappropriate ioctl for device')>

@duplicate-issues
Copy link

Hey @dimbleby,

We did a quick check and this issue looks very darn similar to

This could be a coincidence, but if any of these issues solves your problem then I did a good job 😄

If not, the maintainers will get to this issue shortly.

Cheers,
Your Friendly Neighborhood ProBot

@dimbleby
Copy link
Author

bad bot

@dimbleby dimbleby changed the title 2018.11.14 regression 2018.11.14 regression: cannot create virtualenv Nov 15, 2018
@techalchemy
Copy link
Member

The bot is quite aggressive... wonder if that can be tuned a bit....

It looks like it encountered an anaconda command and died attempting to run it... I’ll be cutting a bugfix release shortly, so we just need to determine which command it tried running. Presumably anaconda in which case we need to drop that from the list or bypass it in pythonfinder.

@dimbleby
Copy link
Author

dimbleby commented Nov 16, 2018

On my system - Centos 7 - anaconda is nothing to do with python

$ which anaconda
/usr/sbin/anaconda

And anaconda --help says (among other things):

Anaconda is the installation program used by Fedora,Red Hat Enterprise Linux and some other
distributions.

@FlorianLudwig
Copy link

FlorianLudwig commented Nov 18, 2018

As a workaround you can pass the full path to the python interpreter:

pipenv --python `which python3`

@techalchemy techalchemy added this to the November Bugfix Release milestone Nov 19, 2018
@techalchemy techalchemy added the Type: Vendored Dependencies This issue affects vendored dependencies within pipenv. label Nov 19, 2018
@techalchemy techalchemy self-assigned this Nov 19, 2018
@techalchemy techalchemy added Type: Bug 🐛 This issue is a bug. Type: Regression This issue is a regression of a previous behavior. labels Nov 19, 2018
techalchemy added a commit that referenced this issue Nov 19, 2018
- Fixes #3242
- Fixes #3232
- Fixes #3229
- Fixes #3234

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
Type: Bug 🐛 This issue is a bug. Type: Regression This issue is a regression of a previous behavior. Type: Vendored Dependencies This issue affects vendored dependencies within pipenv.
Projects
None yet
Development

No branches or pull requests

3 participants