Tutor dev - fail to install app plugin

Hi.
Tutor dev server fails to install a python package that is a private requirement.
This issue has been raised here.
I can confirm that this issue exists in tutor 13.1.5 and 13.1.11. The package is installed in local and works without a problem. After building dev image and running lms server, the package is not installed(checked using pip freeze).
Running pip install -r private.txt on the runserver container and restarting it resolves the issue.
Reading the Dockerfile and tracing the build steps as I run tutor dev dc build lms I can confirm that the package is installed but the final result is as I described.
I currently don’t have an idea what causes this problem. Will update if I find out.

1 Like

I was struggling with something very similar to this yesterday while trying to work on a custom django app plugin. I couldn’t get edx-platform to detect my plugin when using tutor dev runserver lms.

In my case it appears that the issue was the lack of a .egg-info directory for my package on the host. The Open edX plugin system uses importlib.metadata to discover packages and entrypoints, and requires discoverable package metadata to be available through a .egg-info or similar. It wouldn’t surprise me if pip freeze also is unable to list packages without discoverable metadata.

What I think may be happening is that .egg-info directories are being created during image build, but are not copied to the host (becuase the volume is not mounted). Then during tutor dev runserver lms the host requirements lacking .egg-info are mounted so the metadata created during build is no longer present and tools that depend on it don’t detect the custom package.

I ended up at the same workaround as you. Reinstalling packages while the host volume is mounted via tutor dev run lms creates .egg-info on the host, and future invocations of tutor dev runserver lms should work as expected (I hope).

1 Like

I face the same issue and fixed it via pip install my-django-app command but actually, it’s not a really good Developer eXperience.
any idea how we can fix this in the next releases, @regis ?

Lacking precise instructions, I do not know how to reproduce this issue. Please give a step-by-step set of instructions that I can follow to experience the problem. In particular, do not use a private Python package but a public one that I can install.