首先,我不懂python。我想这就是我有问题的原因。我试图从源代码构建编译,但我被困在构建简单的ccsm。simple-ccsm的设置使用python和setup.py。安装时,报错:
Package compiz was not found in the pkg-config search path.
Perhaps you should add the directory containing 'compiz.pc'
to the PKG_CONFIG_PATH environment variable
No package 'compiz' was found
现在,PKG_CONFIG_PATH指向正确的文件夹。更重要的是,pkg-config还可以找到正确的编译:
pkg-config --libs compiz
它确实安装了simple-ccsm,但是当我运行它时,simple-ccsm报错
ImportError: No module named compizconfig
我已经安装了simple-ccsm所需的所有依赖项(包括compizconfig-python绑定,它似乎通常会给出上述错误)所以,我想请教一下蟒蛇专家,我该如何引导蟒蛇往正确的地方看。我猜它没有在正确的目录中查找。
为了将Python引导到正确的位置,您可能需要修改PYTHONPATH:(正在编辑中,因为链接断开了)。
PYTHONPATH sets the search path for importing python modules:
PYTHONPATH Augment the default search path for module files. The format is
the same as the shell’s PATH: one or more directory pathnames separated by
os.pathsep (e.g. colons on Unix or semicolons on Windows). Non-existent
directories are silently ignored.
In addition to normal directories, individual PYTHONPATH entries may refer
to zipfiles containing pure Python modules (in either source or compiled
form). Extension modules cannot be imported from zipfiles.
The default search path is installation dependent, but generally begins with
prefix/lib/pythonversion (see PYTHONHOME above). It is always appended to
PYTHONPATH.
An additional directory will be inserted in the search path in front of
PYTHONPATH as described above under Interface options. The search path can
be manipulated from within a Python program as the variable sys.path.
要设置该变量,可以在运行python脚本时指定:
PYTHONPATH=/blah/whatever/ python somescript.py somecommand
或者导出到您的Bash环境:
export PYTHONPATH=/blah/whatever/