diff --git a/beat/web/utils/management/commands/install.py b/beat/web/utils/management/commands/install.py
old mode 100644
new mode 100755
index 8e8cba72e46b321ab8f4df1a22a98c00fe325585..e5f753cfa1a5e009de3c7002cb5b3c7532cdfc9e
--- a/beat/web/utils/management/commands/install.py
+++ b/beat/web/utils/management/commands/install.py
@@ -1043,9 +1043,10 @@ class Command(BaseCommand):
         # Sets up the queue and environments
         setup_environment(arguments['queue_configuration'],
             arguments['verbosity'])
-        from ....backend.models import Environment, Queue
-        environment = Environment.objects.first()
-        queue = Queue.objects.first()
+        from ....backend.models import Environment, EnvironmentLanguage, Queue
+        from ....code.models import Code
+        environment = EnvironmentLanguage.objects.filter(language=Code.PYTHON).first().environment
+        queue = environment.queues.first()
 
         # Iterates over projects to install
         for project in ['system'] + arguments['project']: