Pipenv: 'python_version': python_version(required_python)[: len('2.7')] TypeError: 'NoneType' object is not subscriptable

Created on 31 Oct 2018  Â·  2Comments  Â·  Source: pypa/pipenv

Recently, I got stuck the same problem with @adiusz at #1858, and I tried the way @adiusz mentioned , but it did not work for me, I wonder know why it occurs and how to solute it.

Version:

  • pipenv, version 11.9.0
  • Python 3.6.7
  • Debian Buster

When I tried pipenv install django, a prompt info showed.

Creating a virtualenv for this project…
Using /usr/bin/python3 (3.6.7) to create virtualenv…
â ‹/usr/bin/python3: No module named pipenv.pew

Virtualenv location:
Creating a Pipfile for this project…
Traceback (most recent call last):
  File "/usr/bin/pipenv", line 11, in <module>
    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 697, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/pipenv/cli.py", line 366, in install
    selective_upgrade=selective_upgrade,
  File "/usr/lib/python3/dist-packages/pipenv/core.py", line 1761, in do_install
    skip_requirements=skip_requirements,
  File "/usr/lib/python3/dist-packages/pipenv/core.py", line 636, in ensure_project
    ensure_pipfile(validate=validate, skip_requirements=skip_requirements)
  File "/usr/lib/python3/dist-packages/pipenv/core.py", line 289, in ensure_pipfile
    project.create_pipfile(python=python)
  File "/usr/lib/python3/dist-packages/pipenv/project.py", line 518, in create_pipfile
    'python_version': python_version(required_python)[: len('2.7')]
TypeError: 'NoneType' object is not subscriptable

Most helpful comment

You are on a very, very, very outdated version of pipenv, as a 1 to 1.5 person maintainer team I just don't really have the bandwidth to offer support for releases that are that old, so my advice is to use a user-install of pipenv that you can upgrade yourself:

pip install --user --upgrade --ignore-installed pipenv

And make sure that ~/.local/bin is on your path. Sorry for the trouble, hope that helps!

All 2 comments

You are on a very, very, very outdated version of pipenv, as a 1 to 1.5 person maintainer team I just don't really have the bandwidth to offer support for releases that are that old, so my advice is to use a user-install of pipenv that you can upgrade yourself:

pip install --user --upgrade --ignore-installed pipenv

And make sure that ~/.local/bin is on your path. Sorry for the trouble, hope that helps!

ok, thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AkiraSama picture AkiraSama  Â·  3Comments

marc-fez picture marc-fez  Â·  3Comments

konstin picture konstin  Â·  3Comments

ipmb picture ipmb  Â·  3Comments

jeyraof picture jeyraof  Â·  3Comments