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

ModuleNotFoundError: No module named 'gi' #124

Open
tfreedman opened this issue Mar 12, 2022 · 9 comments
Open

ModuleNotFoundError: No module named 'gi' #124

tfreedman opened this issue Mar 12, 2022 · 9 comments

Comments

@tfreedman
Copy link

I just tried setting up pantalaimon in docker, and can't get panctl to run from within the container.

Docker commands:
docker run -d --restart=unless-stopped -v /home/core/data:/data -p 8008:8008 matrixdotorg/pantalaimon
docker exec -it <instanceID> /bin/bash

# panctl
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/pantalaimon/panctl.py", line 28, in <module>
    from gi.repository import GLib
ModuleNotFoundError: No module named 'gi'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/panctl", line 5, in <module>
    from pantalaimon.panctl import main
  File "/usr/local/lib/python3.8/site-packages/pantalaimon/panctl.py", line 30, in <module>
    from pgi.repository import GLib
ModuleNotFoundError: No module named 'pgi'

I'm assuming 86060a2 didn't totally fix things.

@aspacca
Copy link
Contributor

aspacca commented May 26, 2022

@JeremyMahieu
Copy link

https://gist.github.com/aspacca/6320d86692353001f7a0be1ae4471113

This gives me

Step 8/22 : RUN pip wheel .[ui] --wheel-dir /wheels --find-links /wheels
 ---> Running in xxxxxxxxxx
ERROR: Directory '.[ui]' is not installable. Neither 'setup.py' nor 'pyproject.toml' found.
ERROR: Service 'pantaleimon' failed to build: The command '/bin/sh -c pip wheel .[ui] --wheel-dir /wheels --find-link

@aspacca
Copy link
Contributor

aspacca commented Jun 9, 2022

I cannot reproduce on a arm based mac and on amd64 debian bullseye
I apologise for the silly question: do you run from the build from the root of the git repo? @JeremyMahieu

@JeremyMahieu
Copy link

JeremyMahieu commented Jun 11, 2022

do you run from the build from the root of the git repo?

What does it matter, you're pulling all the code from pip

RUN pip --no-cache-dir install --find-links /wheels --no-index pantalaimon
RUN pip --no-cache-dir install --find-links /wheels --no-index pantalaimon[ui]

@aspacca
Copy link
Contributor

aspacca commented Jun 11, 2022

What does it matter, you're pulling all the code from pip

not in the builder: https://gist.github.com/aspacca/6320d86692353001f7a0be1ae4471113#file-dockerfile-L13-L15

COPY . /app

RUN pip wheel .[ui] --wheel-dir /wheels --find-links /wheels

that's exactly where you have the error

indeed not even in the run: --find-links /wheels :)
(https://pip.pypa.io/en/stable/cli/pip_install/#cmdoption-f)

@JeremyMahieu
Copy link

JeremyMahieu commented Jun 12, 2022

Successfully built 76fe9ba922f7
Successfully tagged pantaleimon_pantalaimon:latest
Creating pantalaimon ... done
Attaching to pantalaimon
pantalaimon    | open terminal failed: not a terminal

Edit, this is due to using docker compose. Fine when using the docker run -it command

@aspacca You're absolutely correct, I didn't spot that and I didn't copy the git repsitory to my folder. I feel like this is all a bit off topic. Though. Perhaps your gist should become the actual dockerfile, see #131

ERROR: pantalaimon: Notifications are enabled but no notification server could be found, disabling notifications.

@jph
Copy link

jph commented Sep 15, 2022

I'm not sure I'm following the above replies. Was there a tried and true solution for this? As it stands, Pantalaimon is unusable for me, as I cannot operate panctl at all.

@aspacca
Copy link
Contributor

aspacca commented Sep 15, 2022

@jph
starting the container building from the dockefile at https://gist.github.com/aspacca/6320d86692353001f7a0be1ae4471113 solves the issue

it starts a tmux session that you can attach and from there start a new one running panctl

@jph
Copy link

jph commented Sep 20, 2022

Thanks @aspacca, good workaround.

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

4 participants