Django, need to use pip installed module in installed apps
newCrisco (0)

When I start my Django project it pip installs the module fine but when I reference it in my installed apps in settings.py, it states that no such module exists.

How am I supposed to reference the module so that it woks, thanks in advance for your guy's help :)

You are viewing a single comment. View All
PhoenixC (6)

The issue is caused by the installation path is /home/runner/.site-packages instead of /usr/local/lib/python3.6/site-packages or /home/runner/.local/lib/python3.6/site-packages.

I wrote a script to move to move all the module to the right path:
https://repl.it/@PhoenixC/replit-Django-Module-Installation-Fix

Copy site_packages_setup.py to your project then add following code to the top of your settings.py:

from .site_packages_setup import move_site_packages

move_site_packages()

You might need to restart the Django twice.

newCrisco (0)

@PhoenixC Omg thank you so much, what a clean fix. :)