Home > other >  Problem recovering django with pipenv after crash
Problem recovering django with pipenv after crash

Time:01-15

I recently had a catastrophic hard drive failure and I had not pushed all of my recent commits to a remote repository (I have learned my lesson). Fortunately I did have a copy of most of my latest work.

I recreated my local environment (I thought correctly but maybe not) and attempted to start the project with the files. When I run "pipenv shell" the env appears to activate and running "git branch" does show the two branches. However when I ran "python manage.py migrate" I received the following error:

(sitefolder) user@users-MBP ohive % python manage.py migrate
  File "manage.py", line 17
    ) from exc
         ^
SyntaxError: invalid syntax

When I run "python -V" it returns 2.7.18. The python version should be 3.9.6. When I do start pipenv shell in a folder without the old files, the correct version is returned.

Any ideas about how I can get the pipenv to use the correct version of python?

CodePudding user response:

I recreated my local environment (I thought correctly but maybe not) and attempted to start the project with the files.

You probably made a virtual environment with as interpreter, you can construct one with:

pipenv --python 3
  •  Tags:  
  • Related