2

作为 Python 和 KDB+/Q 的新手,我尝试安装qPython包(KDB+ 的 Python API,不要被误认为是 QPython)。

  1. 我从https://github.com/exxeleron/qPython/releases/tag/qPython-1.0-RC1下载并解压缩了源代码

  2. 在 Wincmd中,我跑了python setup.py install(从上面第 1 步给出的路径)

  3. 收到以下错误日志。

它实际上在说什么,我应该如何进行?


Compiling qpython/fastutils.pyx because it changed.
Cythonizing qpython/fastutils.pyx
running install
running build
running build_py
creating build
creating build\lib.win-amd64-2.7
creating build\lib.win-amd64-2.7\qpython
copying qpython\qcollection.py -> build\lib.win-amd64-2.7\qpython
copying qpython\qconnection.py -> build\lib.win-amd64-2.7\qpython
copying qpython\qreader.py -> build\lib.win-amd64-2.7\qpython
copying qpython\qtemporal.py -> build\lib.win-amd64-2.7\qpython
copying qpython\qtype.py -> build\lib.win-amd64-2.7\qpython
copying qpython\qwriter.py -> build\lib.win-amd64-2.7\qpython
copying qpython\utils.py -> build\lib.win-amd64-2.7\qpython
copying qpython\_pandas.py -> build\lib.win-amd64-2.7\qpython
copying qpython\__init__.py -> build\lib.win-amd64-2.7\qpython
creating build\lib.win-amd64-2.7\samples
copying samples\async_query.py -> build\lib.win-amd64-2.7\samples
copying samples\console.py -> build\lib.win-amd64-2.7\samples
copying samples\publisher.py -> build\lib.win-amd64-2.7\samples
copying samples\sync_query.py -> build\lib.win-amd64-2.7\samples
copying samples\tick_subscriber.py -> build\lib.win-amd64-2.7\samples
copying samples\twistedclient.py -> build\lib.win-amd64-2.7\samples
copying samples\__init__.py -> build\lib.win-amd64-2.7\samples
copying LICENSE -> build\lib.win-amd64-2.7
copying CHANGELOG.txt -> build\lib.win-amd64-2.7
copying README.rst -> build\lib.win-amd64-2.7
copying requirements.txt -> build\lib.win-amd64-2.7
running build_ext
building 'qpython.fastutils' extension
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
creating build\temp.win-amd64-2.7\Release\qpython
G:\R\Rtools\gcc-4.6.3\bin\gcc.exe -DMS_WIN64 -mdll -O -Wall -IG:\Anaconda\lib\site-packages\numpy\core\include -IG:\Anaconda\include -IG:\Anaconda\PC -c qpython/fastutils.c -o build\temp.win-amd64-2.7\Release\qpython\fastutils.o
In file included from G:\Anaconda\lib\site-packages\numpy\core\include/numpy/ndarraytypes.h:1804:0, from G:\Anaconda\lib\site-packages\numpy\core\include/numpy/ndarrayobject.h:17, from G:\Anaconda\lib\site-packages\numpy\core\include/numpy/arrayobject.h:4, from qpython/fastutils.c:232: G:\Anaconda\lib\site-packages\numpy\core\include/numpy/npy_1_7_deprecated_api.h:
12:9: note: #pragma message: G:\Anaconda\lib\site-packages\numpy\core\include/numpy/npy_1_7_deprecated_api.h(12) : Warning Msg: Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
qpython/fastutils.c: In function '__Pyx_RaiseArgtupleInvalid':
qpython/fastutils.c:4376:18: warning: unknown conversion type character 'z' in format [-Wformat]
qpython/fastutils.c:4376:18: warning: format '%s' expects argument of type 'char*', but argument 5 has type 'Py_ssize_t' [-Wformat]
qpython/fastutils.c:4376:18: warning: unknown conversion type character 'z' in format [-Wformat]
qpython/fastutils.c:4376:18: warning: too many arguments for format [-Wformat-extra-args]
qpython/fastutils.c: In function '__Pyx_BufFmt_ProcessTypeChunk':
qpython/fastutils.c:4754:26: warning: unknown conversion type character 'z' in format [-Wformat]
qpython/fastutils.c:4754:26: warning: unknown conversion type character 'z' in format [-Wformat]
qpython/fastutils.c:4754:26: warning: too many arguments for format [-Wformat-extra-args]
qpython/fastutils.c:4806:20: warning: unknown conversion type character 'z' in format [-Wformat]
qpython/fastutils.c:4806:20: warning: unknown conversion type character 'z' in format [-Wformat]
qpython/fastutils.c:4806:20: warning: too many arguments for format [-Wformat-extra-args]
qpython/fastutils.c: In function '__pyx_buffmt_parse_array':
qpython/fastutils.c:4868:25: warning: unknown conversion type character 'z' in format [-Wformat]
qpython/fastutils.c:4868:25: warning: too many arguments for format [-Wformat-extra-args]
qpython/fastutils.c: In function '__Pyx_GetBufferAndValidate':
qpython/fastutils.c:5053:7: warning: unknown conversion type character 'z' in format [-Wformat]
qpython/fastutils.c:5053:7: warning: format '%s' expects argument of type 'char*', but argument 3 has type 'Py_ssize_t' [-Wformat]
qpython/fastutils.c:5053:7: warning: unknown conversion type character 'z' in format [-Wformat]
qpython/fastutils.c:5053:7: warning: too many arguments for format [-Wformat-extra-args]
qpython/fastutils.c: In function '__Pyx_RaiseTooManyValuesError':
qpython/fastutils.c:5413:18: warning: unknown conversion type character 'z' in format [-Wformat]
qpython/fastutils.c:5413:18: warning: too many arguments for format [-Wformat-extra-args]
qpython/fastutils.c: In function '__Pyx_RaiseNeedMoreValuesError':
qpython/fastutils.c:5419:18: warning: unknown conversion type character 'z' in format [-Wformat]
qpython/fastutils.c:5419:18: warning: format '%s' expects argument of type 'char*', but argument 3 has type 'Py_ssize_t' [-Wformat]
qpython/fastutils.c:5419:18: warning: too many arguments for format [-Wformat-extra-args]
qpython/fastutils.c: At top level: G:\Anaconda\lib\site-packages\numpy\core\include/numpy/__multiarray_api.h:1629:1: warning: '_import_array' defined but not used [-Wunused-function]
G:\Anaconda\lib\site-packages\numpy\core\include/numpy/__ufunc_api.h:241:1: warning: '_import_umath' defined but not used [-Wunused-function]
writing build\temp.win-amd64-2.7\Release\qpython\fastutils.def
G:\R\Rtools\gcc-4.6.3\bin\gcc.exe -DMS_WIN64 -shared -s build\temp.win-amd64-2.7\Release\qpython\fastutils.o build\temp.win-amd64-2.7\Release\qpython\fastutils.def -LG:\Anaconda\libs -LG:\Anaconda\PCbuild\amd64 -lpython27 -lmsvcr90 -o build\lib.win-amd64-2.7\qpython\fastutils.pyd
g:/r/rtools/gcc-4.6.3/bin/../lib/gcc/i686-w64-mingw32/4.6.3/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible G:\Anaconda\libs/libpython27.a when searching for -lpython27
g:/r/rtools/gcc-4.6.3/bin/../lib/gcc/i686-w64-mingw32/4.6.3/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible G:\Anaconda\libs/python27.lib when searching for -lpython27
g:/r/rtools/gcc-4.6.3/bin/../lib/gcc/i686-w64-mingw32/4.6.3/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible G:\Anaconda\libs\libpython27.a when searching for -lpython27
g:/r/rtools/gcc-4.6.3/bin/../lib/gcc/i686-w64-mingw32/4.6.3/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible G:\Anaconda\libs/libpython27.a when searching for -lpython27
g:/r/rtools/gcc-4.6.3/bin/../lib/gcc/i686-w64-mingw32/4.6.3/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible G:\Anaconda\libs/python27.lib when searching for -lpython27
g:/r/rtools/gcc-4.6.3/bin/../lib/gcc/i686-w64-mingw32/4.6.3/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible G:\Anaconda\libs\python27.lib when searching for -lpython27
g:/r/rtools/gcc-4.6.3/bin/../lib/gcc/i686-w64-mingw32/4.6.3/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lpython27
g:/r/rtools/gcc-4.6.3/bin/../lib/gcc/i686-w64-mingw32/4.6.3/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible G:\Anaconda\libs/libmsvcr90.a when searching for -lmsvcr90
g:/r/rtools/gcc-4.6.3/bin/../lib/gcc/i686-w64-mingw32/4.6.3/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible G:\Anaconda\libs\libmsvcr90.a when searching for -lmsvcr90
collect2: ld returned 1 exit status
error: command 'G:\\R\\Rtools\\gcc-4.6.3\\bin\\gcc.exe' failed with exit status 1
4

2 回答 2

2

看起来这是罪魁祸首:

g:/r/rtools/gcc-4.6.3/bin/../lib/gcc/i686-w64-mingw32/4.6.3/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lpython27

是的,我会说你需要安装 python-dev 来获取用于链接的 python27 库。

于 2015-01-22T16:39:45.547 回答
2

我已经在 windows vista 上安装了 qpython,如下所示:

从以下位置下载 zip 文件:https ://github.com/exxeleron/qPython/archive/qPython-1.0-RC2.zip

在命令提示符下解压并执行以下命令:

python -m pip install -r requirements.txt

在这个阶段,它给出了错误“错误:需要 Microsoft Visual C++ 9.0(无法找到 vcvarsall.bat)。从http://aka.ms/vcpython27获取”

因此,下载了所需的文件http://aka.ms/vcpython27并安装了它。

再次执行:python -m pip install -r requirements.txt

大约花了 30 分钟,安装了 qpython 所需的所有模块。

尝试通过以下方式安装 qpython:

python setup.py install

收到错误:“错误:无法找到 vcvarsall.bat”。

从以下位置安装 Visual Studio 2010 express:http: //www.visualstudio.com/downloads/download-visual-studio-vs#d-2010-express

安装又花了 30 分钟。

使用名称“VS90COMNTOOLS”和值“C:\Program Files\Microsoft Visual Studio 10.0\Common7\Tools\”创建了新的系统环境变量

最后,通过运行命令(在新的dos窗口中)成功安装qpython:

python setup.py install
于 2015-02-10T08:44:34.117 回答