Django Installed Apps Error after Quickstart on M1

Hello Everyone,

I am working on setting up my development environment on an M1 Macbook and have followed the following guide: Open edX Devstack Development with Apple Macbook M1 Silicon (ARM Architecture)

I am still using the Maple version and v13.3.1 of Tutor since we cannot make significant changes currently.

Therefore, I have built the images locally using my fork of maple.3 tag using the --build-arg argument.

I have also changed the MySQL image to MariaDB as suggested.

I can run tutor local quickstart without a problem, however, once I try to open it shows Internal Server Error and the logs for lms and cms show the following problem.

Model class openedx.core.djangoapps.content_libraries.models.ContentLibrary doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.

I have only found one more person with this problem here, however, it does not seem like their problem is solved: Tutor in development, error 1 import imp - #3 by Leonn - Tutor - Overhang.IO

I would like to ask if anyone has any clues as to what might have gone wrong.

I would also like to add that the exact same configuration works on an Intel Macbook.

I don’t think the problem is related to M1/ARM nor to MariaDB; it seems like a python/django installation or configuration issue.

content_libraries is a Django app plugin, so this line in should result in it being “auto-detected” by the system, and automatically added to INSTALLED_APPS. Yet for some reason it’s not in INSTALLED_APPS. Is there more context to the logs so we can see at what point the error is occurring?

I would guess at some possibilities:

  • Perhaps edx-platform is not installed correctly into the python virtual environment. From an LMS shell, in the edx-platform directory, you can try running pip install -e . and then ./ lms shell to see if that resolves it.
  • Perhaps something is modifying INSTALLED_APPS and removing content_libraries. I am not sure what that would be.
  • I think the system should also generally work with content_libraries uninstalled, so I’m wondering what code is referencing the content_libraries app even though it appears to be uninstalled. Perhaps the full error message may provide more clues.
1 Like

Thank you Braden for the tips!

We will investigate these possibilities.

The first suggestion of running pip install -e . inside the LMS shell worked.

For anyone who meets this issue, the problem was simpler than that.

I bind volume a clean fork of our edx-platform to the containers instead of exporting the fork from the image, and working on the exported version of the fork.

This meant that none of the commands to build the assets, install the openedx app etc actually run on the edx-platform directory.

I dont’t quite get the solution here.

I was following this

# Run bash in the lms container
tutor dev run --mount=/path/to/edx-platform lms bash

# Compile local python requirements
pip install --requirement requirements/edx/development.txt

# Install nodejs packages in node_modules/
npm clean-install

# Rebuild static assets
openedx-assets build --env=dev

which I suppose to run within the container mounted directory but still met the same error :frowning:

Could you please explain a bit more on your solution

@tiendv89 There might be many reasons for your problem. Additionally, I am running v13.3.1 which is not the latest version and things might have changed since.

Please create a new topic with the following information:

  • Version of Tutor and Open edX you are trying to run
  • What you have done to make Tutor work on M1, in addition to the steps you have shared.
  • The exact error and the log messages

I am working with the open-release/olive.1 tag.

I have been successfully used tutor local and tutor k8s.

I am trying to learn how to set up openedx develop environment and decide to go with tutor dev.

By runnning tutor dev start -d --mount=/path/to/edx-platform lms I met the issue:
Model class openedx.core.djangoapps.content_libraries.models.ContentLibrary doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.

And yes, I use a clean fork of the edx-platform and mount it to lms container.

From what I understand about your solution, I am trying to use copyfrom to copy the edx-platform on the running lms to my host machine and mount it back (however it still take long time to copy and haven’t worked out yet)

Yes, that is how I solved the problem. The copy process does take upwards of 10 minutes to complete.

1 Like