Problem with installing custom requirements

I have custom django app inside edxplatform which has it’s own python dependencies described in requirements.txt. I want to make these dependencies to be installed on my local devstack environment. To do that I am following this guidelines.

I tried to temporarily modify the main service command in docker-compose.yml:

lms:
    command: bash -c 'source /edx/app/edxapp/edxapp_env && pip install -r /edx/app/edxapp/edx-platform/openedx/features/project_name/requirements.txt && while true; do python /edx/app/edxapp/edx-platform/manage.py lms runserver 0.0.0.0:18000 --settings devstack_docker; sleep 2; done'

I stop all containers, delete images and volumes. Run make dev.pull.lms.

Then I run provision command make dev.provision.lms. It does install requirements but then fails on stage:

# Run edxapp migrations first since they are needed for the service users and OAuth clients
docker-compose exec -T lms bash -c 'source /edx/app/edxapp/edxapp_env && cd /edx/app/edxapp/edx-platform && paver update_db --settings devstack_docker'

Also I tried to add requirements installation directly to Dockerfile, then build the image with the same release name. But result is the same, only it fails on next provision stage:

# Create static assets for both LMS and Studio
for app in "${apps[@]}"; do
    docker-compose exec -T $app bash -c 'source /edx/app/edxapp/edxapp_env && cd /edx/app/edxapp/edx-platform && paver update_assets --settings devstack_docker'
done

Logs:

++ docker-compose restart lms
Restarting edx.devstack-lilac.master.lms ... done
++ docker-compose exec -T lms bash -c 'source /edx/app/edxapp/edxapp_env && cd /edx/app/edxapp/edx-platform && paver update_db --settings devstack_docker'
---> pavelib.servers.update_db
---> pavelib.prereqs.install_prereqs
---> pavelib.prereqs.install_node_prereqs
Node prereqs unchanged, skipping...
---> pavelib.prereqs.install_python_prereqs
---> pavelib.prereqs.uninstall_python_packages
NO_PYTHON_UNINSTALL is set. No attempts will be made to uninstall old Python libs.
Python prereqs unchanged, skipping...
pip freeze > /edx/app/edxapp/edx-platform/test_root/log/pip_freeze.log
********************************************************************************
* WARNING: Mac users should run this from both the lms and studio shells
* in docker devstack to avoid startup errors that kill your CPU.
* For more details, see:
* https://github.com/edx/devstack#docker-is-using-lots-of-cpu-time-when-it-should-be-idle
********************************************************************************
NO_EDXAPP_SUDO=1 EDX_PLATFORM_SETTINGS_OVERRIDE=devstack_docker /edx/bin/edxapp-migrate-lms --traceback --pythonpath=. 
2022-04-28 08:49:54,152 WARNING 91 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/newrelic/console.py:84: DeprecationWarning: `formatargspec` is deprecated since Python 3.5. Use `signature` and the `Signature` object directly
  prototype = wrapper.__name__[3:] + ' ' + inspect.formatargspec(

2022-04-28 08:49:54,269 WARNING 91 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/edx-platform/lms/djangoapps/course_wiki/plugins/markdownedx/wiki_plugin.py:5: DeprecationWarning: 'etree' is deprecated. Use 'xml.etree.ElementTree' instead.
  from lms.djangoapps.course_wiki.plugins.markdownedx import mdx_mathjax, mdx_video

Traceback (most recent call last):
  File "manage.py", line 120, in <module>
    startup.run()
  File "/edx/app/edxapp/edx-platform/lms/startup.py", line 20, in run
    django.setup()
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/apps/registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/apps/config.py", line 90, in create
    module = import_module(entry)
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'dal'

Please help me to properly configure custom requirements installation?

Hi @belek i’m getting same issue did you find any solutions ?

try to install using pip
or check here