Django on apache: Could not find platform dependent libreries <exe_prefix>

I'm trying to deploy a django app in an Apache Server (Wamp) using a virtual environtment, but getting that error. Everything is going well, the problem seems to be happen in the file.

The never start the venv so this never start the app.

Here is my httpd-vhost.conf:

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    WSGIPassAuthorization On
    Alias /static C:/wamp/apache2/htdocs/<myappname>/frontend/build/static/
    <Directory "C:/wamp/apache2/htdocs/<myappname>/frontend/build/static/">
        Allow from all
        Require all granted
    <Directory "C:/wamp/apache2/htdocs/<myappname>/<mysetting's django folder>">
            Allow from all
            Require all granted
    #WSGIDaemonProcess <> python-path="C:/wamp/apache2/htdocs/<>/env/Lib/site-packages"
    #WSGIProcessGroup <>
    WSGIScriptAlias / "C:/wamp/apache2/htdocs/<>/<settings folder>/"

Here is my file:

import os
import sys

# Add the virtual environment path to the system path

# activate_this = 'C:/wamp/apache2/htdocs/<>/env/Scripts/'
# execfile(activate_this, dict(__file__=activate_this))
# exec(open(activate_this).read(),dict(__file__=activate_this))

# Activate the virtual environment
activate_env = 'C:/wamp/apache2/htdocs/<>/env/Scripts/python'
exec(open(activate_env, 'rb').read(), {'__file__': activate_env})

# Set the DJANGO_SETTINGS_MODULE environment variable
# os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'app.settings')

os.environ['DJANGO_SETTINGS_MODULE'] = 'app.settings'

# Import the Django application from the Django project
from django.core.wsgi import get_wsgi_application

application = get_wsgi_application()

In the file there are two ways I found for activate the venv. The venv don't have the file but there was an answer I found answer-here that say you simply copying it from the virtualenv package solve the problem. I tried and worked (in Windows 10). But then I tried in a lower Windows version and got that error. Then I found the other solution without the file but still don't work.

Hope someone can help me. Thanks in advance.

Back to Top