Why is pipenv trying to run installation scripts in a Python37 installation with Python27, producing a SyntaxError?

Viewed 13

I am on a Windows 10 VM. I have installed pipenv into my Python37 installation. This machine also has a Python27 install. I would like to create a Python 2.7 virtual environment using pipenv and then install some modules.

I can create the virtual environment using pipenv --python 2.7. I have a Pipfile already that was created from an older requirements.txt file. When I run pipenv install, I get the following error:

Pipfile.lock not found, creating...
Locking [packages] dependencies...
 Locking...
Resolving dependencies...
Locking Failed!

  File "c:/python37/lib/site-packages/pipenv/resolver.py", line 34
    path_options = [name, f"{name}.py"]
                                     ^
SyntaxError: invalid syntax

This seems to be because f-strings aren't supported in Python 2.7, but I am confused as to why pipenv is trying to run the resolver.py script, which is clearly in the Python37 installation, with what appears to be Python 2.7.

0 Answers
Related