pipenv update raises an IndexError

Created on 9 Jan 2018  Â·  5Comments  Â·  Source: pypa/pipenv

I tried to run pipenv update. It errors.

Describe your environment
  1. OS Type: Ubuntu 17.10
  2. Python version: Python 3.6.4
  3. Pipenv version: pipenv, version 9.0.1
Expected result

A complete re-installation of the virtual environment.

Actual result

Got the following error instead:

pipenv update
Updating all dependencies from Pipfile…
Traceback (most recent call last):
  File "/home/omer/.pyenv/versions/3.6.4/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/home/omer/.pyenv/versions/3.6.4/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/omer/.pyenv/versions/3.6.4/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/omer/.pyenv/versions/3.6.4/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/omer/.pyenv/versions/3.6.4/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/omer/.pyenv/versions/3.6.4/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/omer/.pyenv/versions/3.6.4/lib/python3.6/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/omer/.pyenv/versions/3.6.4/lib/python3.6/site-packages/pipenv/cli.py", line 2556, in update
    do_purge()
  File "/home/omer/.pyenv/versions/3.6.4/lib/python3.6/site-packages/pipenv/cli.py", line 1227, in do_purge
    dep = convert_deps_from_pip(package)
  File "/home/omer/.pyenv/versions/3.6.4/lib/python3.6/site-packages/pipenv/utils.py", line 625, in convert_deps_from_pip
    req = get_requirement(dep)
  File "/home/omer/.pyenv/versions/3.6.4/lib/python3.6/site-packages/pipenv/utils.py", line 311, in get_requirement
    req = [r for r in requirements.parse(dep)][0]
IndexError: list index out of range
Steps to replicate

Run pipenv update with the following Pipfile:

[[source]]

url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"


[packages]

"e1839a8" = {path = ".", editable = true}


[dev-packages]

pytest = "*"
seaworthy = "*"

Notice that the installed package is an editable package.

Type

Most helpful comment

Lost track of this one. To answer your concerns @carsonyl pipenv install -e . and pip install -e . both call setup.py develop which installs the package as whatever it is named in the relevant setup.py, therefore you must uninstall it by that name. I would not recommend installing things with this approach if you don’t understand what it does to your environment.

As for the above error, it may be fixed in master as a side effect of #1372 when we merge it. We have a number of changes involving requirement parsing there.

All 5 comments

Hmmm this looks interesting. The expected behavior would just be to reinstall, yes? And there is a setup.py in the local project root?

The answers are yes and yes :)

I have the same issue on Windows 10, Python 3.6.4, pipenv 9.0.3. pipenv install -e . breaks pipenv update as described, and can only be undone by pipenv uninstall [that package name].

As an aside, I was surprised that the opposite of pipenv install -e . is not pipenv uninstall ..

Lost track of this one. To answer your concerns @carsonyl pipenv install -e . and pip install -e . both call setup.py develop which installs the package as whatever it is named in the relevant setup.py, therefore you must uninstall it by that name. I would not recommend installing things with this approach if you don’t understand what it does to your environment.

As for the above error, it may be fixed in master as a side effect of #1372 when we merge it. We have a number of changes involving requirement parsing there.

1372 is now merged.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

marc-fez picture marc-fez  Â·  3Comments

erinxocon picture erinxocon  Â·  3Comments

leileigong picture leileigong  Â·  3Comments

jakul picture jakul  Â·  3Comments

jacebrowning picture jacebrowning  Â·  3Comments