即使在 Arch Linux 上安装了 pygtk,也无法编译 Dropbox 源代码

即使在 Arch Linux 上安装了 pygtk,也无法编译 Dropbox 源代码

我最近在我的系统上安装了 Arch Linux,我想设置 Dropbox 客户端,以便我可以将一些文件与云同步。我正在尝试按照指示从源代码编译客户端如何构建适用于 Linux 的 Dropbox 安装程序?。但是我有一个问题,它指示我安装pygtk,并且我已经使用 pacman 完成了安装,但是即使在重新启动后运行:

cd ./nautilus-dropbox-2015.10.28; ./configure; make; make install;

仅返回:

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for pkg-config... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for NAUTILUS... yes
checking for GLIB... yes
checking for python... /usr/bin/python
checking for rst2man... python rst2man.py
checking for pygtk... no
configure: error: couldn't find pygtk
make: *** No targets specified and no makefile found.  Stop.
make: *** No rule to make target 'install'.  Stop.

我的系统是最新的,我缺少什么?

信息更新:

我宁愿不提供整个日志,因为那里有很多系统配置信息,我宁愿不在线发布以防万一,但以下是我认为是所请求的相关部分config.log

configure:10713: checking for python
configure:10731: found /usr/bin/python
configure:10743: result: /usr/bin/python
configure:10754: checking for rst2man
configure:10785: result: python rst2man.py
configure:10799: checking for pygtk
configure:10812: result: no
configure:10814: error: couldn't find pygtk

但这个错误消息并不能真正帮助我理解问题是什么以及为什么找不到pygtk.

答案1

我遇到了同样的问题,修改符号链接以指向对我python来说python2.7不起作用。

对我有用的是运行以下命令来替换每个文件中出现的所有python内容python2nautilus-dropbox-2.10.0

grep -rl python . | xargs sed -i 's/python/python2/g'

之后我运行了configure,makemake install命令。

答案2

我在尝试同样的事情时遇到了这个问题,我想我知道为什么会发生这种情况。

在 Arch Linux 中,运行 Python 将调用 Python 3 而不是 Python 2,这与几乎所有其他 Linux 操作系统不同。我真的很喜欢 Arch Linux,但老实说我不知道​​为什么 Python 2 不是默认的,因为这只会使从源代码构建的整个过程变得复杂。你可能不应该更换python符号链接替换为指向 Python 2 的符号链接,因为它可能会弄乱其他所有内容。

不管怎样,我看了一下configure,它通过尝试在 python 中导入 pygtk 来检查它。在Python 2中,运行import pygtk有效,而在Python 3中,运行它会导致错误:

>>> import pygtk
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pygtk'

现在我们该如何解决这个问题呢?我不太确定。我尝试改变PYTHON变量更改为仅指向python2保管箱内,但这似乎不起作用。

您最初问题的答案是您没有错过任何内容,只是它不起作用,因为python指向/usr/bin/python3.

答案3

我在某种程度上设法解决了这个问题,正如你所说的那样configurePython 3而不是Python 2。

只需转到二进制文件夹cd /usr/bin并将符号链接从 Python 3 修改为 Python 2,并保留备份以在安装完成后恢复:

sudo mv python python.old
sudo ln -s python2.7 python

然后,您可以返回到包文件夹并运行make构建保管箱。完成后,您必须将符号链接恢复到 Python 3,否则您的系统将会出现一些问题:

cd /usr/bin
sudo mv python.old python

您现在需要告诉保管箱应用程序不要遵循/usr/bin/python符号链接,而是遵循现有的/usr/bin/python2符号链接。为此,只需/usr/bin/dropbox在您最喜欢的文本编辑器中打开文件(使用sudo或您将无法编辑它)并将第一行从#!/usr/bin/python#!/usr/bin/python2.

您现在应该能够通过键入来启动 Dropbox API,dropbox start而不会出现任何兼容性问题。

答案4

我最近遇到了这个问题,我发现(除了之前答案中建议的内容之外)是配置脚本尝试导入GTK模块,不是pygtk正如人们所预料的那样。

$as_echo_n "checking for pygtk... " >&6; }

cat <<EOF | python
try:
 import gtk
except:
 exit(1)
else:

解决方法是用 deGTK为了pygtk在那条线上

sed -i 's/ gtk/ pygtk/g' nautilus-dropbox-2.10.0/configure

我知道与原始问题中的软件包版本不同,但由于错误消息是相同的,因此对于那些针对同一问题的人来说可能会有所帮助。

相关内容