pkg_resources.DistributionNotFound: The 'pip>=9.0.1' distribution was not found and is required by pipenv
$ pip --version
pip 10.0.0 from .../python3.6/site-packages/pip (python 3.6)
Please provide detailed information. I cannot reproduce anything with information this scarce. Follow the issue template at least.
i cannot give you the normal (python -m pipenv.help | pbcopy) details because that command aint working as well after i upgraded pip to version 10. :(
File "/Users/andy/.pyenv/versions/3.6.4/lib/python3.6/site-packages/pipenv/utils.py", line 218, in python_version
return u'{major}.{minor}.{micro}'.format(*version)
TypeError: format() argument after * must be a mapping, not NoneType
osx 10.13.4
python 3.6.4
pip 10
pipenv 11.9
Do you mean you have Pip 10 globally, or in the virtualenv? If it鈥檚 global (my guess), try force-reinstalling pip with the --ignore-installed
option. pkg_resources
can be confused if the installation is not completely successful.
Also you might want to make sure pip and Pipenv are actually installed to the same Python (I can鈥檛 tell from the ...
part).
Okay, somehow the pip upgrade totally broke pipenv. After manually removing all pipenv stuff from my disc and installing pipenv again it works.
Weird!
FYI I hit this issue too. Removing the python_version
in the Pipfile resolved my particular issue. That allowed pipenv to see the virtualenv again which was broken. Deleting that, and then re-adding the python_version fixed. Just reporting incase it helps a future traveler.
I also hit this issue as well. I have pipenv brew installed on a Mac and am running pip version 10.0.1
. Here's the traceback, attempting @jarshwah's fix unfortunately did not work for me.
```BOS-MAC-TEST:python test$ pipenv install -d
Traceback (most recent call last):
File "/usr/local/Cellar/pipenv/11.10.0/libexec/bin/pipenv", line 11, in
load_entry_point('pipenv==11.10.0', 'console_scripts', 'pipenv')()
File "/usr/local/Cellar/pipenv/11.10.0/libexec/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
return self.main(args, kwargs)
File "/usr/local/Cellar/pipenv/11.10.0/libexec/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/local/Cellar/pipenv/11.10.0/libexec/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/Cellar/pipenv/11.10.0/libexec/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, *ctx.params)
File "/usr/local/Cellar/pipenv/11.10.0/libexec/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
return callback(args, *kwargs)
File "/usr/local/Cellar/pipenv/11.10.0/libexec/lib/python3.6/site-packages/pipenv/cli.py", line 366, in install
selective_upgrade=selective_upgrade,
File "/usr/local/Cellar/pipenv/11.10.0/libexec/lib/python3.6/site-packages/pipenv/core.py", line 1730, in do_install
skip_requirements=skip_requirements,
File "/usr/local/Cellar/pipenv/11.10.0/libexec/lib/python3.6/site-packages/pipenv/core.py", line 611, in ensure_project
python_version(path_to_python) or ''
File "/usr/local/Cellar/pipenv/11.10.0/libexec/lib/python3.6/site-packages/pipenv/utils.py", line 218, in python_version
return u'{major}.{minor}.{micro}'.format(version)
TypeError: format() argument after ** must be a mapping, not NoneType
Update:
When I comment out `python_version = "3"` of the Pipfile I get
BOS-MAC-TEST:python test$ pipenv run python docfinder/manage.py runserver
dyld: Library not loaded: @executable_path/../.Python
Referenced from: /Users/test/.virtualenvs/python-WXdX62tA/bin/python
Reason: image not found
```
@afs2015 The image not found error indicates your virtualenv is broken (likely because you created it from Homebrew Python and a brew upgrade
and/or brew clean
broke it). You need to recreate it.
Also, don鈥檛 create virtualenvs against Homebrew Python. They break.
@uranusjr Thanks! Recreating the virtualenv did the trick. I'll avoid creating virtualenvs against Homebrew Python in the future.
Most helpful comment
FYI I hit this issue too. Removing the
python_version
in the Pipfile resolved my particular issue. That allowed pipenv to see the virtualenv again which was broken. Deleting that, and then re-adding the python_version fixed. Just reporting incase it helps a future traveler.