question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

2018.11.14 regression: cannot create virtualenv

See original GitHub issue

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 <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 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 <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 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’)>

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
dimblebycommented, 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.

0reactions
FlorianLudwigcommented, Nov 18, 2018

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

pipenv --python `which python3`

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - Can't "activate" virtualenv - Stack Overflow
New to running Python in virtual environments, messing with Django, and can't activate a virtual environment.
Read more >
pipenv Documentation - Read the Docs
Pipenv is a tool that aims to bring the best of all packaging worlds (bundler, composer, npm, cargo, yarn, etc.) to the. Python...
Read more >
Release and Version History — pipenv 2022.12.20.dev0 ...
This fixes regression where install phase was using unexpected index after updating pip==22.3 # ... This makes several objects of pip fail to...
Read more >
Release and Version History — pipenv 2020.8.13.dev0 文档
#4274; Fixed a bug which caused Pipenv to fail to install packages in a virtual environment if those packages were already present in...
Read more >
virtualenv cannot create environment - Super User
well i switched to centos7 and got my django1.8 working with below commands yum install gcc libffi-devel python-devel openssl-devel yum install python-devel ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found