Background: I installed Python 3.5.2 on my Mac (which already contained 2.7.10) and have been apparently running the two installations side-by-side without any apparent issues. Everything works fine until I move the project folder somewhere else, and then when I try to do anything I get the following error:
Traceback (most recent call last):
File "manage.py", line 8, in <module>
from django.core.management import execute_from_command_line
ImportError: No module named django.core.management
My normal setup workflow is as follows:
- Install a virtual environment in the directory containing the Django project folder (not the directory containing
manage.py- one level up from that) withpython3 -m venv <venv-name> - Activate the virtual environment and install Django, Pillow, whatever I need for the project.
I know I'm missing something because I thought the way virtual environments worked was that you installed them locally and then as long as all of that accompanied your project folder, everything would be a-okay. But everything stops working when I move the directory, and if I move it back it works again.
Can anyone tell me what kind of issue I'm dealing with here based on this? Is this just normal behavior and I just need to get used to not moving Django project folders?
UPDATE: If I delete the virtual environment folder and re-install it once the folder is in the new location everything seems to work fine. I guess it's some issue with the creation of virtual environments and some kind of link to my Python installation? I have no idea.