Skip to content

pipenv install fails with python3.9.0a2 #4096

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

Closed
skoot opened this issue Jan 14, 2020 · 4 comments
Closed

pipenv install fails with python3.9.0a2 #4096

skoot opened this issue Jan 14, 2020 · 4 comments
Labels

Comments

@skoot
Copy link

skoot commented Jan 14, 2020

Hello,

Here's my stack trace. Am I doing something wrong or is it something that should be fixed?

361 $ pipenv install --python python -d
362 Creating a virtualenv for this project…
363 Pipfile: /builds/cloud/back/Pipfile
364 Using /usr/local/bin/python (3.9.0a2) to create virtualenv…
365 Already using interpreter /usr/local/bin/python
366 Using base prefix '/usr/local'
367 New python executable in /root/.local/share/virtualenvs/back-pv0NqEqa/bin/python
368 Installing setuptools, pip, wheel...
369 done.
370 Virtualenv location: /root/.local/share/virtualenvs/back-pv0NqEqa
371 Warning: Your Pipfile requires python_version 3.8, but you are using 3.9.0a2 (/root/.local/share/v/b/bin/python).
372   $ pipenv --rm and rebuilding the virtual environment may resolve the issue.
373   $ pipenv check will surely fail.
374 Pipfile.lock not found, creating…
375 Traceback (most recent call last):
376   File "/usr/local/bin/pipenv", line 8, in <module>
377     sys.exit(cli())
378   File "/usr/local/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 764, in __call__
379     return self.main(*args, **kwargs)
380   File "/usr/local/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 717, in main
381     rv = self.invoke(ctx)
382   File "/usr/local/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 1137, in invoke
383     return _process_result(sub_ctx.command.invoke(sub_ctx))
384   File "/usr/local/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 956, in invoke
385     return ctx.invoke(self.callback, **ctx.params)
386   File "/usr/local/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
387     return callback(*args, **kwargs)
388   File "/usr/local/lib/python3.9/site-packages/pipenv/vendor/click/decorators.py", line 64, in new_func
389     return ctx.invoke(f, obj, *args, **kwargs)
390   File "/usr/local/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
391     return callback(*args, **kwargs)
392   File "/usr/local/lib/python3.9/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
393     return f(get_current_context(), *args, **kwargs)
394   File "/usr/local/lib/python3.9/site-packages/pipenv/cli/command.py", line 235, in install
395     retcode = do_install(
396   File "/usr/local/lib/python3.9/site-packages/pipenv/core.py", line 1863, in do_install
397     do_init(
398   File "/usr/local/lib/python3.9/site-packages/pipenv/core.py", line 1239, in do_init
399     do_lock(
400   File "/usr/local/lib/python3.9/site-packages/pipenv/core.py", line 1035, in do_lock
401     dev_packages = project.dev_packages.copy()
402   File "/usr/local/lib/python3.9/site-packages/pipenv/project.py", line 673, in dev_packages
403     return self._build_package_list("dev-packages")
404   File "/usr/local/lib/python3.9/site-packages/pipenv/project.py", line 221, in _build_package_list
405     any(is_installable_file(i) for i in [k, v])
406   File "/usr/local/lib/python3.9/site-packages/pipenv/project.py", line 221, in <genexpr>
407     any(is_installable_file(i) for i in [k, v])
408   File "/usr/local/lib/python3.9/site-packages/pipenv/utils.py", line 902, in is_installable_file
409     from .patched.notpip._internal.utils.packaging import specifiers
410   File "/usr/local/lib/python3.9/site-packages/pipenv/patched/notpip/_internal/utils/packaging.py", line 10, in <module>
411     from pipenv.patched.notpip._internal import exceptions
412   File "/usr/local/lib/python3.9/site-packages/pipenv/patched/notpip/_internal/__init__.py", line 40, in <module>
413     from pipenv.patched.notpip._internal.cli.autocompletion import autocomplete
414   File "/usr/local/lib/python3.9/site-packages/pipenv/patched/notpip/_internal/cli/autocompletion.py", line 8, in <module>
415     from pipenv.patched.notpip._internal.cli.main_parser import create_main_parser
416   File "/usr/local/lib/python3.9/site-packages/pipenv/patched/notpip/_internal/cli/main_parser.py", line 12, in <module>
417     from pipenv.patched.notpip._internal.commands import (
418   File "/usr/local/lib/python3.9/site-packages/pipenv/patched/notpip/_internal/commands/__init__.py", line 6, in <module>
419     from pipenv.patched.notpip._internal.commands.completion import CompletionCommand
420   File "/usr/local/lib/python3.9/site-packages/pipenv/patched/notpip/_internal/commands/completion.py", line 6, in <module>
421     from pipenv.patched.notpip._internal.cli.base_command import Command
422   File "/usr/local/lib/python3.9/site-packages/pipenv/patched/notpip/_internal/cli/base_command.py", line 23, in <module>
423     from pipenv.patched.notpip._internal.index import PackageFinder
424   File "/usr/local/lib/python3.9/site-packages/pipenv/patched/notpip/_internal/index.py", line 14, in <module>
425     from pipenv.patched.notpip._vendor import html5lib, requests, six
426   File "/usr/local/lib/python3.9/site-packages/pipenv/patched/notpip/_vendor/html5lib/__init__.py", line 25, in <module>
427     from .html5parser import HTMLParser, parse, parseFragment
428   File "/usr/local/lib/python3.9/site-packages/pipenv/patched/notpip/_vendor/html5lib/html5parser.py", line 8, in <module>
429     from . import _tokenizer
430   File "/usr/local/lib/python3.9/site-packages/pipenv/patched/notpip/_vendor/html5lib/_tokenizer.py", line 16, in <module>
431     from ._trie import Trie
432   File "/usr/local/lib/python3.9/site-packages/pipenv/patched/notpip/_vendor/html5lib/_trie/__init__.py", line 3, in <module>
433     from .py import Trie as PyTrie
434   File "/usr/local/lib/python3.9/site-packages/pipenv/patched/notpip/_vendor/html5lib/_trie/py.py", line 6, in <module>
435     from ._base import Trie as ABCTrie
436   File "/usr/local/lib/python3.9/site-packages/pipenv/patched/notpip/_vendor/html5lib/_trie/_base.py", line 3, in <module>
437     from collections import Mapping
438 ImportError: cannot import name 'Mapping' from 'collections' (/usr/local/lib/python3.9/collections/__init__.py)

@ghost ghost added the triage label Jan 14, 2020
@skoot skoot changed the title pipenv install fails with python3.9a2 pipenv install fails with python3.9.0a2 Jan 14, 2020
@deveshks
Copy link

deveshks commented Apr 21, 2020

As per the discussion in html5lib/html5lib-python#419 , seems like the removal of the deprecated abstract base classes from the collections module has now been reverted, and the import from collections import Mapping outlined in the error happens succesfully in Python 3.9.0a4

$ python --version
Python 3.9.0a4

$ python -c 'from collections import Mapping'
<string>:1: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working

@ajvogel
Copy link

ajvogel commented Apr 23, 2022

Stops working in 3.10 on Ubuntu 22.04

@tomjowitt
Copy link

Ubuntu 20.04 defaults to 3.10 and breaks the version of pipenv in apt:

$ python --version
Python 3.10.4
$ pipenv --version
Traceback (most recent call last):
  File "/usr/bin/pipenv", line 33, in <module>
    sys.exit(load_entry_point('pipenv==11.9.0', 'console_scripts', 'pipenv')())
  File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 696, in main
    with self.make_context(prog_name, args, **extra) as ctx:
  File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 621, in make_context
    self.parse_args(ctx, args)
  File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 1018, in parse_args
    rest = Command.parse_args(self, ctx, args)
  File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 875, in parse_args
    parser = self.make_parser(ctx)
  File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 821, in make_parser
    for param in self.get_params(ctx):
  File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 774, in get_params
    help_option = self.get_help_option(ctx)
  File "/usr/lib/python3/dist-packages/pipenv/cli.py", line 26, in get_help_option
    from .import core
  File "/usr/lib/python3/dist-packages/pipenv/core.py", line 21, in <module>
    import requests
  File "/usr/lib/python3/dist-packages/pipenv/vendor/requests/__init__.py", line 65, in <module>
    from . import utils
  File "/usr/lib/python3/dist-packages/pipenv/vendor/requests/utils.py", line 27, in <module>
    from .cookies import RequestsCookieJar, cookiejar_from_dict
  File "/usr/lib/python3/dist-packages/pipenv/vendor/requests/cookies.py", line 172, in <module>
    class RequestsCookieJar(cookielib.CookieJar, collections.MutableMapping):
AttributeError: module 'collections' has no attribute 'MutableMapping'

@matteius
Copy link
Member

@ajvogel and @tomjowitt -- Need more details -- what you are reporting is technically a new/different issue from this report and this original report should have been closed apparently when it was resolved in 2020.

and breaks the version of pipenv in apt

Isn't the version of pipenv in apt so old that it should never be used ever again?

Yeah, that seems to be true. https://packages.ubuntu.com/jammy/pipenv is https://pypi.org/project/pipenv/11.9.0/

We don't maintain the aptitude package so I think this won't be solved in this backlog. Essentially you want to do a --user install of the latest pipenv to get all of those things that are already fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants