python-3.x - Xbbg 的 PyArrow 安装不起作用
问题描述
我正在尝试在 Bloomberg 和 Python 之间建立数据管道。我有一个 Bloomberg 终端、一个 Windows 64 位机器、Python 3.7.4 和一个 Sublime Text 环境,并且正在运行。我的目标是安装 XBBG 包:https ://pypi.org/project/xbbg/ 。
我已经按照https://pypi.org/project/xbbg/上的步骤安装了:
- 彭博 C++ SDK 版本 3.12.1 或更高版本
- Bloomberg Open API(需要手动安装如下图)
- pdblp - 彭博开放 API 的熊猫包装器
- numpy,熊猫,ruamel.yaml
但是pip install pyarrow
,即使我尝试了早期版本的pyarrow
.
pip install pyarrow
Collecting pyarrow
Downloading https://files.pythonhosted.org/packages/6c/75/e87ad78b3a0d1250984331e59648fac43218f00599fd570318447178c650/pyarrow-0.14.0.tar.gz (436kB)
100% |████████████████████████████████| 440kB 1.8MB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\AppData\Local\Temp\pip-install-r81qamg4\pyarrow\setup.py", line 29, in <module>
from Cython.Distutils import build_ext as _build_ext
ModuleNotFoundError: No module named 'Cython'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\AppData\Local\Temp\pip-install-r81qamg4\pyarrow\
So I installed Cython:
pip install Cython
Collecting Cython
Downloading https://files.pythonhosted.org/packages/5b/95/d0b8d1b15ddb1129b841b1c537e935dce19ae4ccf7da65ade0b37e210434/Cython-0.29.12-cp37-cp37m-win32.whl (1.6MB)
100% |████████████████████████████████| 1.6MB 2.1MB/s
Installing collected packages: Cython
Successfully installed Cython-0.29.12
并尝试再次安装 PyArrow:
pip install pyarrow
Collecting pyarrow
Using cached https://files.pythonhosted.org/packages/6c/75/e87ad78b3a0d1250984331e59648fac43218f00599fd570318447178c650/pyarrow-0.14.0.tar.gz
Collecting numpy>=1.14 (from pyarrow)
Downloading https://files.pythonhosted.org/packages/07/46/656c25b39fc152ea525eef14b641993624a6325a8ae815b200de57cff0bc/numpy-1.16.4-cp37-cp37m-win32.whl (10.0MB)
100% |████████████████████████████████| 10.0MB 1.3MB/s
Collecting six>=1.0.0 (from pyarrow)
Downloading https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Installing collected packages: numpy, six, pyarrow
Running setup.py install for pyarrow ... error
Complete output from command "c:\users\alain tchibozo\appdata\local\programs\python\python37-32\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\AppData\\Local\\Temp\\pip-install-gfndyai5\\pyarrow\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\\AppData\Local\Temp\pip-record-xs9wfdwm\install-record.txt --single-version-externally-managed --compile:
c:\users\appdata\local\temp\pip-install-gfndyai5\pyarrow\.eggs\setuptools_scm-3.3.3-py3.7.egg\setuptools_scm\utils.py:119: UserWarning: 'git' was not found
warnings.warn("%r was not found" % name)
running install
running build
running build_py
creating build
creating build\lib.win32-3.7
creating build\lib.win32-3.7\pyarrow
copying pyarrow\benchmark.py -> build\lib.win32-3.7\pyarrow
copying pyarrow\compat.py -> build\lib.win32-3.7\pyarrow
copying pyarrow\csv.py -> build\lib.win32-3.7\pyarrow
copying pyarrow\cuda.py -> build\lib.win32-3.7\pyarrow
copying pyarrow\feather.py -> build\lib.win32-3.7\pyarrow
copying pyarrow\filesystem.py -> build\lib.win32-3.7\pyarrow
copying pyarrow\flight.py -> build\lib.win32-3.7\pyarrow
copying pyarrow\hdfs.py -> build\lib.win32-3.7\pyarrow
copying pyarrow\ipc.py -> build\lib.win32-3.7\pyarrow
copying pyarrow\json.py -> build\lib.win32-3.7\pyarrow
copying pyarrow\jvm.py -> build\lib.win32-3.7\pyarrow
copying pyarrow\orc.py -> build\lib.win32-3.7\pyarrow
copying pyarrow\pandas_compat.py -> build\lib.win32-3.7\pyarrow
copying pyarrow\parquet.py -> build\lib.win32-3.7\pyarrow
copying pyarrow\plasma.py -> build\lib.win32-3.7\pyarrow
copying pyarrow\serialization.py -> build\lib.win32-3.7\pyarrow
copying pyarrow\types.py -> build\lib.win32-3.7\pyarrow
copying pyarrow\util.py -> build\lib.win32-3.7\pyarrow
copying pyarrow\_generated_version.py -> build\lib.win32-3.7\pyarrow
copying pyarrow\__init__.py -> build\lib.win32-3.7\pyarrow
creating build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\conftest.py -> build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\deserialize_buffer.py -> build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\pandas_examples.py -> build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\strategies.py -> build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\test_array.py -> build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\test_builder.py -> build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\test_compute.py -> build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\test_convert_builtin.py -> build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\test_csv.py -> build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\test_cuda.py -> build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\test_cuda_numba_interop.py -> build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\test_cython.py -> build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\test_deprecations.py -> build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\test_extension_type.py -> build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\test_feather.py -> build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\test_filesystem.py -> build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\test_flight.py -> build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\test_gandiva.py -> build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\test_hdfs.py -> build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\test_io.py -> build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\test_ipc.py -> build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\test_json.py -> build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\test_jvm.py -> build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\test_memory.py -> build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\test_misc.py -> build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\test_orc.py -> build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\test_pandas.py -> build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\test_parquet.py -> build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\test_plasma.py -> build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\test_plasma_tf_op.py -> build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\test_scalars.py -> build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\test_schema.py -> build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\test_serialization.py -> build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\test_strategies.py -> build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\test_table.py -> build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\test_tensor.py -> build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\test_types.py -> build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\util.py -> build\lib.win32-3.7\pyarrow\tests
copying pyarrow\tests\__init__.py -> build\lib.win32-3.7\pyarrow\tests
running egg_info
writing pyarrow.egg-info\PKG-INFO
writing dependency_links to pyarrow.egg-info\dependency_links.txt
writing entry points to pyarrow.egg-info\entry_points.txt
writing requirements to pyarrow.egg-info\requires.txt
writing top-level names to pyarrow.egg-info\top_level.txt
reading manifest file 'pyarrow.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*.so' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*~' found anywhere in distribution
warning: no previously-included files matching '#*' found anywhere in distribution
warning: no previously-included files matching '.git*' found anywhere in distribution
warning: no previously-included files matching '.DS_Store' found anywhere in distribution
no previously-included directories found matching '.asv'
writing manifest file 'pyarrow.egg-info\SOURCES.txt'
copying pyarrow\__init__.pxd -> build\lib.win32-3.7\pyarrow
copying pyarrow\_csv.pyx -> build\lib.win32-3.7\pyarrow
copying pyarrow\_cuda.pxd -> build\lib.win32-3.7\pyarrow
copying pyarrow\_cuda.pyx -> build\lib.win32-3.7\pyarrow
copying pyarrow\_flight.pyx -> build\lib.win32-3.7\pyarrow
copying pyarrow\_json.pyx -> build\lib.win32-3.7\pyarrow
copying pyarrow\_orc.pxd -> build\lib.win32-3.7\pyarrow
copying pyarrow\_orc.pyx -> build\lib.win32-3.7\pyarrow
copying pyarrow\_parquet.pxd -> build\lib.win32-3.7\pyarrow
copying pyarrow\_parquet.pyx -> build\lib.win32-3.7\pyarrow
copying pyarrow\_plasma.pyx -> build\lib.win32-3.7\pyarrow
copying pyarrow\array.pxi -> build\lib.win32-3.7\pyarrow
copying pyarrow\benchmark.pxi -> build\lib.win32-3.7\pyarrow
copying pyarrow\builder.pxi -> build\lib.win32-3.7\pyarrow
copying pyarrow\error.pxi -> build\lib.win32-3.7\pyarrow
copying pyarrow\feather.pxi -> build\lib.win32-3.7\pyarrow
copying pyarrow\gandiva.pyx -> build\lib.win32-3.7\pyarrow
copying pyarrow\io-hdfs.pxi -> build\lib.win32-3.7\pyarrow
copying pyarrow\io.pxi -> build\lib.win32-3.7\pyarrow
copying pyarrow\ipc.pxi -> build\lib.win32-3.7\pyarrow
copying pyarrow\lib.pxd -> build\lib.win32-3.7\pyarrow
copying pyarrow\lib.pyx -> build\lib.win32-3.7\pyarrow
copying pyarrow\memory.pxi -> build\lib.win32-3.7\pyarrow
copying pyarrow\pandas-shim.pxi -> build\lib.win32-3.7\pyarrow
copying pyarrow\public-api.pxi -> build\lib.win32-3.7\pyarrow
copying pyarrow\scalar.pxi -> build\lib.win32-3.7\pyarrow
copying pyarrow\serialization.pxi -> build\lib.win32-3.7\pyarrow
copying pyarrow\table.pxi -> build\lib.win32-3.7\pyarrow
copying pyarrow\types.pxi -> build\lib.win32-3.7\pyarrow
creating build\lib.win32-3.7\pyarrow\includes
copying pyarrow\includes\__init__.pxd -> build\lib.win32-3.7\pyarrow\includes
copying pyarrow\includes\common.pxd -> build\lib.win32-3.7\pyarrow\includes
copying pyarrow\includes\libarrow.pxd -> build\lib.win32-3.7\pyarrow\includes
copying pyarrow\includes\libarrow_cuda.pxd -> build\lib.win32-3.7\pyarrow\includes
copying pyarrow\includes\libarrow_flight.pxd -> build\lib.win32-3.7\pyarrow\includes
copying pyarrow\includes\libgandiva.pxd -> build\lib.win32-3.7\pyarrow\includes
creating build\lib.win32-3.7\pyarrow\tensorflow
copying pyarrow\tensorflow\plasma_op.cc -> build\lib.win32-3.7\pyarrow\tensorflow
copying pyarrow\tests\pyarrow_cython_example.pyx -> build\lib.win32-3.7\pyarrow\tests
creating build\lib.win32-3.7\pyarrow\tests\data
creating build\lib.win32-3.7\pyarrow\tests\data\orc
copying pyarrow\tests\data\orc\README.md -> build\lib.win32-3.7\pyarrow\tests\data\orc
copying pyarrow\tests\data\orc\TestOrcFile.emptyFile.jsn.gz -> build\lib.win32-3.7\pyarrow\tests\data\orc
copying pyarrow\tests\data\orc\TestOrcFile.emptyFile.orc -> build\lib.win32-3.7\pyarrow\tests\data\orc
copying pyarrow\tests\data\orc\TestOrcFile.test1.jsn.gz -> build\lib.win32-3.7\pyarrow\tests\data\orc
copying pyarrow\tests\data\orc\TestOrcFile.test1.orc -> build\lib.win32-3.7\pyarrow\tests\data\orc
copying pyarrow\tests\data\orc\TestOrcFile.testDate1900.jsn.gz -> build\lib.win32-3.7\pyarrow\tests\data\orc
copying pyarrow\tests\data\orc\TestOrcFile.testDate1900.orc -> build\lib.win32-3.7\pyarrow\tests\data\orc
copying pyarrow\tests\data\orc\decimal.jsn.gz -> build\lib.win32-3.7\pyarrow\tests\data\orc
copying pyarrow\tests\data\orc\decimal.orc -> build\lib.win32-3.7\pyarrow\tests\data\orc
creating build\lib.win32-3.7\pyarrow\tests\data\parquet
copying pyarrow\tests\data\parquet\v0.7.1.all-named-index.parquet -> build\lib.win32-3.7\pyarrow\tests\data\parquet
copying pyarrow\tests\data\parquet\v0.7.1.column-metadata-handling.parquet -> build\lib.win32-3.7\pyarrow\tests\data\parquet
copying pyarrow\tests\data\parquet\v0.7.1.parquet -> build\lib.win32-3.7\pyarrow\tests\data\parquet
copying pyarrow\tests\data\parquet\v0.7.1.some-named-index.parquet -> build\lib.win32-3.7\pyarrow\tests\data\parquet
running build_ext
creating build\temp.win32-3.7
creating build\temp.win32-3.7\Release
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\\AppData\Local\Temp\pip-install-gfndyai5\pyarrow\setup.py", line 606, in <module>
url='https://arrow.apache.org/'
File "c:\users\\appdata\local\programs\python\python37-32\lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "c:\users\\appdata\local\programs\python\python37-32\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\\appdata\local\programs\python\python37-32\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\users\appdata\local\programs\python\python37-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\\appdata\local\programs\python\python37-32\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "c:\users\\appdata\local\programs\python\python37-32\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "c:\users\\appdata\local\programs\python\python37-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\\appdata\local\programs\python\python37-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\\appdata\local\programs\python\python37-32\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\alain\appdata\local\programs\python\python37-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\\appdata\local\programs\python\python37-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\1\AppData\Local\Temp\pip-install-gfndyai5\pyarrow\setup.py", line 94, in run
self._run_cmake()
File "C:\Users\\AppData\Local\Temp\pip-install-gfndyai5\pyarrow\setup.py", line 273, in _run_cmake
raise RuntimeError('Not supported on 32-bit Windows')
RuntimeError: Not supported on 32-bit Windows
----------------------------------------
Command ""c:\users\\appdata\local\programs\python\python37-32\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\\\AppData\\Local\\Temp\\pip-install-gfndyai5\\pyarrow\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\\AppData\Local\Temp\pip-record-xs9wfdwm\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\\AppData\Local\Temp\pip-install-gfndyai5\pyarrow\
我试图阅读这个问题,在我看来,要么:
- pyarrow 与 python3.7 不兼容(这很奇怪,因为我尝试在 OS 机器上安装)
我做错了安装。
如果 1) 我很乐意降级我的 python 版本。如果您知道哪个 python 版本(超过 3 个)支持 pyarrow,我很乐意将其降级。如果 2) 请说明如何正确安装它。
(不太可能)如果有办法在没有 pyarrow 的情况下安装 xbbg,我会很高兴知道如何。记住目标是安装 xbbg。
非常感谢。
解决方案
pyarrow
需要 64 位 Python。验证您是否拥有64 位 Python:
python -c "import sys; print(sys.maxsize > 2**32)"
python -c "import struct; print(struct.calcsize('P') * 8)"
推荐阅读
- javascript - 反应 onClick 函数变量未定义,但应该在运行时工作,我应该如何解决这个问题?
- python - Python语音识别模块仅识别部分音频
- javascript - 使用 jquery 或 javascript 的列表/网格/平铺视图转换
- reactjs - 我想在输入字段的 id 密码中传递 onChange 属性中的两个函数。我也想传递事件和确认()函数。(反应)
- r - 如何从 R 中的国家名称列表中删除多余的空格、特殊字符和不需要的文本?
- c++ - 如何在c ++ dll中导出结构
- php - Jquery Datepicker not rhiding past dates
- python - 如何将 for 循环转换为递归函数
- python - 你可以从 python 程序中运行脚本吗?
- typescript - 为什么 TypeScript 允许在 const 声明中重复索引属性?