I decided to change the name of my Flask project folder from microblog to finalproject. I am using Python 3.4.2 on a Mac.
Here's the hierarchy of finalproject:
Vivians-MacBook-Pro:finalproject vivianli$ ls
__pycache__ app.db db_create.py db_migrate.py db_upgrade.py run.py
app config.py db_downgrade.py db_repository flask tmp
Since then (and I should have thought this through more carefully before I did this), the path "flask/bin/python" no longer works. For example,
Vivians-MacBook-Pro:finalproject vivianli$ ./db_migrate.py
-bash: ./db_migrate.py: flask/bin/python: bad interpreter: No such file or directory
db_migrate.py is a migrating script that I've granted permission to. However when I use flask/bin/python3, it works.
My question is why flask/bin/python doesn't work anymore, why flask/bin/python3 does after changing my overall project name, and if there are any other settings I should be concerned about.
You are working with a virtual environnement located in the
./flask
folder, so have a look at theflask/bin
folder and pick a python interpreter.First make sure you have activated the virtual environment by launching
Also check for your interpreter in
./flask/bin/python
You should find here
python3.4
or something similar andpython
pointing on it, about like this :If not, you might need to make a symbolic link from python3 to python in your virtual environment to avoid finding the same problem in other scripts of the project.
This might fix your problem.