KeyError when during `pipenv install <package>`
See original GitHub issueKey error when installing dependency. It seams to happen when pipenv is trying to add dependency to Pipfile:
Action:
pipenv install mock
Environment
- MacOS 10.12.6 Sierra
- Python version: 3.6.4
- Pipenv version: 8.3.2
Expected result
No KeyError raised. Dependency added to Pipfile.
Actual result
KeyError raised. Dependency is not added to Pipfile.
Installing mock…
Requirement already satisfied: mock in /Users/robin/.local/share/virtualenvs/ATG-PATKL30Y/lib/python3.6/site-packages
Requirement already satisfied: pbr>=0.11 in /Users/robin/.local/share/virtualenvs/ATG-PATKL30Y/lib/python3.6/site-packages (from mock)
Requirement already satisfied: six>=1.9 in /Users/robin/.local/share/virtualenvs/ATG-PATKL30Y/lib/python3.6/site-packages (from mock)
Adding mock to Pipfile's [packages]…
Traceback (most recent call last):
File "/usr/local/bin/pipenv", line 11, in <module>
sys.exit(cli())
File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/pipenv/cli.py", line 1923, in install
project.add_package_to_pipfile(package_name, dev)
File "/usr/local/lib/python3.6/site-packages/pipenv/project.py", line 461, in add_package_to_pipfile
p = self._pipfile
File "/usr/local/lib/python3.6/site-packages/pipenv/project.py", line 268, in _pipfile
p_section[norm_key] = p_section.pop(key)
File "/usr/local/lib/python3.6/site-packages/pipenv/patched/prettytoml/elements/table.py", line 114, in pop
v = self[key]
File "/usr/local/lib/python3.6/site-packages/pipenv/patched/prettytoml/elements/abstracttable.py", line 58, in __getitem__
raise KeyError
KeyError
Steps to replicate
Use this Pipfile
[[source]]
verify_ssl = true
url = "https://pypi.python.org/simple"
[requires]
python_version = '3.6'
[packages]
xlrd = "==1.1.0"
xlsxwriter = "==0.9.9"
pip-conflict-checker = "==0.3"
mypy = "==0.530"
pylint = "==1.7.4"
hyperopt = "==0.1"
networkx = "==1.11"
pyyaml = "==3.12"
scipy = "==0.18.1"
scikit-learn = "==0.19.1"
[dev-packages]
tensorflow = "==1.4.0"
matplotlib = "==2.1.1"
Then install mock with:
pipenv install mock
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (2 by maintainers)
Top Results From Across the Web
`pipenv install` fails with " KeyError: 'url' " - Stack Overflow
I want to create a virtual environment using pipenv. Problem. In order to create a virtual environment, I used pipenv. However, even though...
Read more >Working with the AWS CDK in Python
Managing AWS Construct Library modules. Use the Python package installer, pip, to install and update AWS Construct Library modules for use by your...
Read more >pipenv Documentation - Read the Docs
This tutorial walks you through installing and using Python packages. It will show you how to install and use the necessary tools and...
Read more >Common Pipenv Errors and How to Solve Them: Why Won't it ...
Be aware that the 'Installation Succeeded' alert is untrue; there is no Panadas to install. All that s occurred is the addition of...
Read more >Unable to complete "cdktf init --template=python - r/Terraform
pipenv install cdktf~=0.4.1 ··· ✓ Warning: Your Pipfile requires ... line 530, in write_toml for package in data[section]: KeyError: ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@monkut It should be gone in master branch.
I think it’s this line in my
Pipfile
that’s causing the problem:I’ve tried installing that package afresh, doing this:
pipenv --rm
rm Pipfile.lock
wagtailcomments-xtd...
line fromPipfile
pipenv install --dev
pipenv install -e git+https://github.com/UnfoldStories/wagtailcomments_xtd.git@wagtail-2-fixes#egg=wagtailcomments_xtd
The last step results in:
Neither this project nor that
wagtailcomments_xtd
repo have changed recently and this – doing pipenv updates – has been working OK for a few months.