Search code examples
djangobashpythonanywhere

How to move a directory out of ./virualenvs and into my project in PYTHONANYWHERE


Just for the record - I feel so stupid asking this question.

I can not move a directory out of; home/username/django18/lib/python35/site-packages into my Django project here; home/username/my_project

I did a;

pip install django-allauth

to install AllAuth for my project, which in turn dropped it in the above directory, not my project. To be neat and organised... I would like my AllAuth diretory to sit in the main directory of my project..

I have tried using the bash terminal, but can not get to that directory from it.


Solution

  • You should not even try moving the installed package, because it (probably) won't work. Python virtualenvs are not really relocatable.

    Just create a new virtual environment in your project directory and install all pip packages there:

    cd my_project
    virtualenv .env
    . .env/bin/activate
    pip install -r requirements.txt    # if you have a list of pip requirements
    pip install django-allauth