Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
436 views
in Technique[技术] by (71.8m points)

python - ValueError: Namespace GdkPixbuf not available caffeine-ng arch linux error

Hi there were some arch updates I recently installed that has broken some stuff on my computer.

I can't get caffeine-ng to work anymore. I get the error ValueError: Namespace GdkPixbuf not available

I did try installing gdk-pixbuf2 via pacman, but this hasn't solved the issue.

I am currently running arch 1.4

(base) [user@user ~]$ caffeine 
Traceback (most recent call last):
  File "/home/user/miniconda3/bin/caffeine", line 33, in <module>
    sys.exit(load_entry_point('caffeine-ng==3.4.2', 'gui_scripts', 'caffeine')())
  File "/home/user/miniconda3/bin/caffeine", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/home/user/miniconda3/lib/python3.8/importlib/metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "/home/user/miniconda3/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 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/user/.local/lib/python3.8/site-packages/caffeine/main.py", line 42, in <module>
    gi.require_version("GdkPixbuf", "2.0")  # noqa
  File "/home/user/miniconda3/lib/python3.8/site-packages/gi/__init__.py", line 126, in require_version
    raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace GdkPixbuf not available


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Turns out this is a problem to do with miniconda interfering with arch python (or something like that??)

anyway, did the following and got everything working:

Thanks! I edited my .bashrc file:

#
# ~/.bashrc
#

# If not running interactively, don't do anything
#[[ $- != *i* ]] && return

#alias ls='ls --color=auto'
#PS1='[u@h W]$ '

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/user/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
#if [ $? -eq 0 ]; then
    #eval "$__conda_setup"
#else
    if [ -f "/home/user/miniconda3/etc/profile.d/conda.sh" ]; then
        . "/home/user/miniconda3/etc/profile.d/conda.sh"
    #else
        #export PATH=""$PATH:/home/user/miniconda3/bin"
   # fi
fi
#unset __conda_setup
# <<< conda initialize <<<

and in /etc/profile i've commented out:

#export PATH="$PATH:/usr/local/miniconda/bin"

running type -a python gives me:

[user@user ~]$ type -a python
python is /usr/bin/python
python is /bin/python

I reinstalled caffeine-ng and it's all working great again


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...