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 'gi' #67

Open
vaporii opened this issue Jun 16, 2024 · 2 comments
Open

No module named 'gi' #67

vaporii opened this issue Jun 16, 2024 · 2 comments

Comments

@vaporii
Copy link

vaporii commented Jun 16, 2024

I'm on Arch. After creating a python venv and following the instructions on the README, I'm receiving the following error:

Traceback (most recent call last):
  File "/home/[username]/xborder/./xborders", line 11, in <module>
    import gi
ModuleNotFoundError: No module named 'gi'

This happens when building manually, and using the AUR.

@yigitkalan
Copy link

This happened to me to.
sudo pacman -S python-gobject
you need this package as well.

@TwinkleByte
Copy link

TwinkleByte commented Aug 2, 2024

You have to use pygobject. Installing pygobject using sudo pacman -S python-gobject didn't work for me. I assume it is because it was installed system wide, not installed inside virtual environment.
I used this command while being inside virtual environment and it worked.
pip install pygobject

Note that I use fish. That's why I have added .fish after activate. It asked me to upgrade so I used pip install --upgrade pip
These are the commands I used to make it work:

cd ~/.config
git clone https://github.com/deter0/xborder
cd xborder
python -m venv venv
source venv/bin/activate.fish
pip install -r requirements.txt
pip install --upgrade pip
Trying to ./xborders --help gives  No module named 'requests' error
nano /home/Twinkle/.config/xborder/xborders
Replace #!/bin/python3 with the line below the top. Rename the [username] with your home user name. no brackets
#!/home/[username]/.config/xborder/venv/bin/python
Example: #!/home/Alex/.config/xborder/venv/bin/python
./xborders --help will now give No module named 'gi'
pip install pygobject
./xborders --help
nano ~/.config/fish/config.fish
set PATH $PATH /home/Twinkle/.config/xborder
exec_always --no-startup-id fish -c 'source ~/.config/fish/config.fish; killall xborders; xborders --config ~/.config/xborder/config'
blur-background-exclude = [
    "role = 'xborder'"
];
nano ~/.config/xborder/config
example config
{
  "border-rgba": "#0cbdc1",
  "border-radius": 10,
  "border-width": 2,
  "border-mode": "outside",
  "disable-version-warning": false
}

Now it should work

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

3 participants