Note: I will list two issues that I'm currently facing with pipenv down below.
So recently I was trying to generate a pipfile.lock fr Heroku and I was having a problem when trying to use pipenv install firebase-admin. The issue is in the version of requests, at least that's according to the messageERROR: ERROR: Could not find a version that matches requests<3.0.0,<3.0.0dev,==2.11.1,>=2.0.1,>=2.18.0 that appears in the console.
This appears even though I have version 2.24.0 which it lists down as one of the versions that it tried to install.
after doing the obvious like clearing the cache and installing using --pre I decided on updating pipenv before writing this down as an issue. to my surprise however, now I'm getting an issue with the resolver.
Traceback (most recent call last):
File "c:/users/abdul/anaconda3/envs/semsar-flask-env/lib/site-packages/pipenv/resolver.py", line 807, in <module>
main()
File "c:/users/abdul/anaconda3/envs/semsar-flask-env/lib/site-packages/pipenv/resolver.py", line 794, in main
from pipenv.vendor.vistir.misc import replace_with_text_stream
ImportError: cannot import name 'replace_with_text_stream'
I'm very frustrated as I couldn't find any solutions on the internet.
You are likely to have two different versions of Pipenv installed.
Please uninstall them all and install the latest version of Pipenv
Thanks for the suggestion, but no that wasn't the problem as I tried uninstalling/installing beforehand.
Anyways I solved my problem by bypassing pipenv altogether and forced Heroku to use the requirements.txt as described in this particular issue.
#!/main_project_directory/bin/env bash
# Make non-zero exit codes & other errors fatal:
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -euo pipefail
# Prevent heroku-buildpack-python from using pipenv instead of pip and requirements.txt.
rm Pipfile Pipfile.lock
I had this same issue. It seemed to be because the virtualenv Python was being used to execute Pipenv which is outside the virtualenv. The virtualenv presumably itself has an older version of Pipenv in it.
I ended up solving it by running pipenv --rm && pipenv install
to delete and recreate the environment with the latest version of Pipenv which solved the issue.
Most helpful comment
I had this same issue. It seemed to be because the virtualenv Python was being used to execute Pipenv which is outside the virtualenv. The virtualenv presumably itself has an older version of Pipenv in it.
I ended up solving it by running
pipenv --rm && pipenv install
to delete and recreate the environment with the latest version of Pipenv which solved the issue.