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.

pipenv update raises an IndexError

See original GitHub issue

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.

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
techalchemycommented, Feb 15, 2018

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.

0reactions
kennethreitzcommented, Feb 17, 2018

#1372 is now merged.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Errors to use pipenv after updating python version
Running with a new Ubuntu 22.04 system, I faced the same urllib3 collections issue you report as your initial problem: $ pipenv install ......
Read more >
snowflake-connector-python - PyPI
... a bug where empty results containing GEOGRAPHY type raised IndexError. v2.7.8(May 28,2022). Updated PyPi documentation link to python specific main page ...
Read more >
Common Pipenv Errors - Towards Data Science
When you use pipenv install to get a new dependency, the Pipfile and Pipfile.lock are automatically updated with that new dependency.
Read more >
Python Examples of toml.TomlDecodeError - ProgramCreek.com
TomlDecodeError, IndexError) as e: raise RuntimeError('failed to load ... TypeError): print(f"Unable to update {pyproject_file}: file not found.
Read more >
Frequently Encountered Pipenv Problems - Read the Docs
☤ An exception is raised during Locking dependencies… ¶. Run pipenv lock --clear and try again. The lock sequence caches results to speed...
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