Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No module named 'mymodule' #17

Open
KarlKeu00 opened this issue Jan 18, 2024 · 0 comments
Open

No module named 'mymodule' #17

KarlKeu00 opened this issue Jan 18, 2024 · 0 comments

Comments

@KarlKeu00
Copy link

Hello everyone,
I have created a module exactly as instructed and only edited the signals.py file. I have pushed the whole module to a private GitHub repo and would now like to install it on my server.
I have written the following Dockerfile for this purpose:

FROM pretix/standalone:stable

USER root

# Copy ssh key for github
RUN mkdir -p -m 0700 /root/.ssh
COPY ./certs/id_rsa /root/.ssh/id_rsa
RUN chmod -R 0600 /root/.ssh/id_rsa

# Add key to ssh-agent
RUN eval $(ssh-agent -s) && \
    ssh-add /root/.ssh/id_rsa

# Add github.com to known_hosts and config
RUN ssh-keyscan github.com >> /root/.ssh/known_hosts
RUN echo "Host github.com\n\tHostname github.com\n\tIdentityFile /root/.ssh/id_rsa\n" >> /root/.ssh/config

# Install plugins
RUN pip3 install -U "git+ssh://[email protected]/MyProfile/Pretix-Plugins-MyModule.git"

# Build pretix
USER pretixuser
RUN cd /pretix/src && make production

pip installs the module correctly and it also appears in pip list. Why can't pretix find the module? I get the following error:

 => ERROR [9/9] RUN cd /pretix/src && make production                                                                                                0.8s
------
 > [9/9] RUN cd /pretix/src && make production:
0.139 ./manage.py compilemessages
0.729 Traceback (most recent call last):
0.729   File "/pretix/src/./manage.py", line 31, in <module>
0.729     execute_from_command_line(sys.argv)
0.729   File "/usr/local/lib/python3.11/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
0.730     utility.execute()
0.730   File "/usr/local/lib/python3.11/site-packages/django/core/management/__init__.py", line 416, in execute
0.730     django.setup()
0.730   File "/usr/local/lib/python3.11/site-packages/django/__init__.py", line 24, in setup
0.730     apps.populate(settings.INSTALLED_APPS)
0.730   File "/usr/local/lib/python3.11/site-packages/django/apps/registry.py", line 91, in populate
0.731     app_config = AppConfig.create(entry)
0.731                  ^^^^^^^^^^^^^^^^^^^^^^^
0.731   File "/usr/local/lib/python3.11/site-packages/django/apps/config.py", line 193, in create
0.731     import_module(entry)
0.731   File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
0.732     return _bootstrap._gcd_import(name[level:], package, level)
0.732            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0.732   File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
0.732   File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
0.732   File "<frozen importlib._bootstrap>", line 1140, in _find_and_load_unlocked
0.732 ModuleNotFoundError: No module named 'mymodule'
0.796 make: *** [Makefile:6: localecompile] Error 1
------
Dockerfile:24
--------------------
  22 |     # Build pretix
  23 |     USER pretixuser
  24 | >>> RUN cd /pretix/src && make production
  25 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c cd /pretix/src && make production" did not complete successfully: exit code: 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant