我正在尝试在cygwin下运行cassandra的cqlsh,它退出时不会显示错误:
/c/apps/apache-cassandra-2.0.9
>./bin/cqlsh
>
它看起来像一个python脚本:
#!/bin/sh
# -*- mode: Python -*-
...
# bash code here; finds a suitable python interpreter and execs this file.
# prefer unqualified "python" if suitable:
python -c 'import sys; sys.exit(not (0x020500b0 < sys.hexversion < 0x03000000))' 2>/dev/null \
&& exec python "$0" "$@"
for pyver in 2.6 2.7 2.5; do
which python$pyver > /dev/null 2>&1 && exec python$pyver "$0" "$@"
done
echo "No appropriate python interpreter found." >&2
exit 1
":"""
我确实安装了python解释器:
>python -V
Python 2.7.5
有没有办法判断是否有某个python库缺失,或者以某种方式看到一条错误消息,指出问题所在?
编辑:
bash -x
的输出:
>bash -x ./bin/cqlsh
+ :
+ python -c 'import sys; sys.exit(not (0x020500b0 < sys.hexversion < 0x03000000))'
+ exec python ./bin/cqlsh
编辑: sys.hexversion的价值:
>python -c "import sys; print sys.hexversion"
34014704
编辑:
>python -v ./bin/cqlsh 2>&1 | grep -v "^#" | grep -v "^import"
Python 2.7.5 (default, Oct 2 2013, 22:34:09)
[GCC 4.8.1] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
dlopen("/usr/lib/python2.7/lib-dynload/itertools.dll", 2);
dlopen("/usr/lib/python2.7/lib-dynload/_functools.dll", 2);
dlopen("/usr/lib/python2.7/lib-dynload/_ctypes.dll", 2);
dlopen("/usr/lib/python2.7/lib-dynload/_struct.dll", 2);
编辑: 结果:
>strace -o /usr/bin/python ./bin/cqlsh
strace.exe: can't open /usr/bin/python: Permission denied
>ll /usr/bin/python2.7.exe
-rwxr-xr-x 1 dabrans2 Domain Users 7187 Oct 2 2013 /usr/bin/python2.7.exe*
strace -o /usr/bin/python ./bin/cqlsh
strace.exe: can't open /usr/bin/python: Permission denied
之后,我打开资源管理器并双击python2.7.exe。 Windows说,“C:\ sygwin64 \ bin \ python2.7.exe不是有效的Win32应用程序。”但是,python3.2m.exe只需双击就可以正常运行。也许卸载python 2.7将解决问题。