无法使用 OpenShift 安装 Pandas

2023-12-09

I am ssh-ingFlask 应用程序OpenShiftPython 依赖项之一是 Pandas 0.16.1。纵观整个OpenShift 文档,我创建了我的setup.py文件如下:

from setuptools import setup

setup(name='MyApp',
    version='0.1a',
    description='some description',
    author='me',
    author_email='[email protected]',
    url='http://myapp.com/',
    install_requires=['Flask>=0.10.1','numpy>=1.9.2','pandas>=0.16.1'],
    )

使用需求创建应用程序时,该过程失败。产生以下错误...救命!

The initial build for the application failed: Shell command
'/sbin/runuser -s /bin/sh 557ba9e9e0b8cd360b000131 -c "exec
/usr/bin/runcon 'unconfined_u:system_r:openshift_t:s0:c1,c69' /bin/sh
-c \"gear postreceive --init >> /tmp/initial-build.log 2>&1\""' returned an error. rc=137 .Last 10 kB of build output: Stopping Python
2.7 cartridge Repairing links for 1 deployments Building git ref 'master', commit 239ba5f Activating virtenv Running setup.py script..
running develop running egg_info creating GTFS_Viewer.egg-info writing
requirements to GTFS_Viewer.egg-info/requires.txt writing
GTFS_Viewer.egg-info/PKG-INFO writing top-level names to
GTFS_Viewer.egg-info/top_level.txt writing dependency_links to
GTFS_Viewer.egg-info/dependency_links.txt writing manifest file
'GTFS_Viewer.egg-info/SOURCES.txt' reading manifest file
'GTFS_Viewer.egg-info/SOURCES.txt' writing manifest file
'GTFS_Viewer.egg-info/SOURCES.txt' running build_ext Creating
/var/lib/openshift/557ba9e9e0b8cd360b000131/app-root/runtime/dependencies/python/virtenv/lib/python2.7/site-packages/GTFS-Viewer.egg-link
(link to .) Adding GTFS-Viewer 0.1a to easy-install.pth file Installed
/var/lib/openshift/557ba9e9e0b8cd360b000131/app-root/runtime/repo
Processing dependencies for GTFS-Viewer==0.1a Searching for
pandas>=0.16.1 Reading
http://mirror1.ops.rhcloud.com/mirror/python/web/simple/pandas/ Best
match: pandas 0.16.1 Downloading
mirror1.ops.rhcloud.com/mirror/python/web/packages/source/p/pandas/pandas-0.16.1.zip#md5=d465643d588c4f886b8e796ae56673ad
Processing pandas-0.16.1.zip Writing
/tmp/easy_install-97qgiA/pandas-0.16.1/setup.cfg Running
pandas-0.16.1/setup.py -q bdist_egg --dist-dir
/tmp/easy_install-97qgiA/pandas-0.16.1/egg-dist-tmp-VpNuur warning: no
files found matching 'README.rst' no previously-included directories
found matching 'doc/build' warning: no directories found matching
'examples' warning: no previously-included files matching '*.so' found
anywhere in distribution warning: no previously-included files
matching '*.pyd' 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 warning: no
previously-included files matching '*.png' found anywhere in
distribution In file included from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1728,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:15,
from pandas/index.c:250:
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/npy_deprecated_api.h:11:2:
warning: #warning "Using deprecated NumPy API, disable it by #defining
NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" pandas/index.c: In function
'__pyx_f_6pandas_5index_11IndexEngine__maybe_get_bool_indexer':
pandas/index.c:4088: warning: '__pyx_v_last_true' may be used
uninitialized in this function pandas/index.c: In function
'__pyx_f_6pandas_5index_13Float64Engine__maybe_get_bool_indexer':
pandas/index.c:7981: warning: '__pyx_v_last_true' may be used
uninitialized in this function pandas/index.c: In function
'__pyx_f_6pandas_5index_11Int64Engine__maybe_get_bool_indexer':
pandas/index.c:7356: warning: '__pyx_v_last_true' may be used
uninitialized in this function pandas/index.c: In function
'__pyx_f_6pandas_5index__bin_search': pandas/index.c:8769: warning:
'__pyx_v_mid' may be used uninitialized in this function In file
included from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1728,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:15,
from pandas/src/datetime/np_datetime.c:18:
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/npy_deprecated_api.h:11:2:
warning: #warning "Using deprecated NumPy API, disable it by #defining
NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"
/opt/rh/python27/root/usr/include/python2.7/datetime.h:188: warning:
'PyDateTimeAPI' defined but not used In file included from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1728,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:15,
from pandas/src/datetime/np_datetime_strings.c:17:
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/npy_deprecated_api.h:11:2:
warning: #warning "Using deprecated NumPy API, disable it by #defining
NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"
pandas/src/datetime/np_datetime_strings.c: In function
'make_iso_8601_datetime':
pandas/src/datetime/np_datetime_strings.c:1147: warning: format
'%04ld' expects type 'long int', but argument 4 has type 'long long
int' pandas/src/datetime/np_datetime_strings.c:1147: warning: format
'%04ld' expects type 'long int', but argument 4 has type 'long long
int' pandas/src/datetime/np_datetime_strings.c: At top level:
pandas/src/datetime/np_datetime_strings.c:127: warning: 'get_gmtime'
defined but not used In file included from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1728,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:15,
from pandas/src/period.c:251:
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/npy_deprecated_api.h:11:2:
warning: #warning "Using deprecated NumPy API, disable it by #defining
NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/__multiarray_api.h:1594:
warning: '_import_array' defined but not used
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/__ufunc_api.h:236:
warning: '_import_umath' defined but not used In file included from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1728,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:15,
from pandas/src/datetime/np_datetime.c:18:
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/npy_deprecated_api.h:11:2:
warning: #warning "Using deprecated NumPy API, disable it by #defining
NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"
/opt/rh/python27/root/usr/include/python2.7/datetime.h:188: warning:
'PyDateTimeAPI' defined but not used In file included from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1728,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:15,
from pandas/src/datetime/np_datetime_strings.c:17:
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/npy_deprecated_api.h:11:2:
warning: #warning "Using deprecated NumPy API, disable it by #defining
NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"
pandas/src/datetime/np_datetime_strings.c: In function
'make_iso_8601_datetime':
pandas/src/datetime/np_datetime_strings.c:1147: warning: format
'%04ld' expects type 'long int', but argument 4 has type 'long long
int' pandas/src/datetime/np_datetime_strings.c:1147: warning: format
'%04ld' expects type 'long int', but argument 4 has type 'long long
int' pandas/src/datetime/np_datetime_strings.c: At top level:
pandas/src/datetime/np_datetime_strings.c:127: warning: 'get_gmtime'
defined but not used In file included from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1728,
from pandas/src/period_helper.h:12, from pandas/src/period_helper.c:1:
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/npy_deprecated_api.h:11:2:
warning: #warning "Using deprecated NumPy API, disable it by #defining
NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"
pandas/src/period_helper.c:33: warning: 'NULL_AF_INFO' defined but not
used In file included from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1728,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:15,
from pandas/algos.c:250:
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/npy_deprecated_api.h:11:2:
warning: #warning "Using deprecated NumPy API, disable it by #defining
NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"

我遇到了同样的问题:Installing pandas throughrequirements.txt或使用pip不工作。

Openshift 在尝试编译时停止并终止进程algos.c。这是对我有用的手动安装解决方法(python3.3 墨盒)。这是一个有点乏味的试错过程的结果,我无法真正解释它为什么有效。但您可能想尝试一下。

  1. 连接到 openshift:rhc ssh <appname>.

  2. 下载最新的pandas源码到/tmp目录下手动安装

    cd /tmp
    mkdir pandas
    cd pandas
    wget https://pypi.python.org/packages/source/p/pandas/pandas-0.16.2.zip#md5=860a6c7e5e1a24bb0aa549b115830252
    unzip pandas-0.16.2.zip
    cd pandas-0.16.2
    
  3. 编辑setup.py使用您最喜欢的(可用)编辑器创建文件,例如emacs并搜索“algos”。第二次出现时注释掉变量中的algos包ext_data:

    ...
        index={'pyxfile': 'index',
               'sources': ['pandas/src/datetime/np_datetime.c',
                           'pandas/src/datetime/np_datetime_strings.c']},
    #    algos={'pyxfile': 'algos',                                                                                                     
    #           'depends': [srcpath('generated', suffix='.pyx'),                                                                        
    #                       srcpath('join', suffix='.pyx')]},                                                                                               
        parser={'pyxfile': 'parser',
                'depends': ['pandas/src/parser/tokenizer.h',
                            'pandas/src/parser/io.h',
                            'pandas/src/numpy_helper.h'],
     ...
    
  4. 运行安装过程的第一部分:

    ./setup.py install
    
  5. 现在,让我们来编译缺失的algos手工一块。为此,请删除您在步骤 2 中所做的评论,然后注释掉所有其他条目(除了algos条目)在ext_data.

  6. 在“试运行”模式下运行安装程序以查看两个gcc编译算法所需的命令

    ./setup.py -n build
    
  7. 复制第一个gcc命令从 shell 运行它。当我尝试这个时,这个命令使 openshift 关闭了连接。因此,我通过删除重复选项并删除-O2标志(即优化)。这对我有用:

    gcc -pthread -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -I/opt/rh/python33/root/usr/include -Ipandas/src/klib -Ipandas/src -I/opt/rh/python33/root/usr/lib64/python3.3/site-packages/numpy/core/include -I$OPENSHIFT_HOMEDIR/python/virtenv/venv/include -I/opt/rh/python33/root/usr/include/python3.3m -c pandas/algos.c -o build/temp.linux-x86_64-3.3/pandas/algos.o
    
  8. 第二个命令可以不变地运行。对我来说是:

    gcc -pthread -shared -L/opt/rh/python33/root/usr/lib64 -L/usr/lib6464 build/temp.linux-x86_64-3.3/pandas/algos.o -L/opt/rh/python33/root/usr/lib64 -lpython3.3m -o build/lib.linux-x86_64-3.3/pandas/algos.cpython-33m.so
    
  9. 现在,需要安装手工制作的文件:

    ./setup.py install
    
  10. 快速检查它是否适合您。第一的cd到你的主目录,然后尝试 python:

    cd
    python
    Python 3.3.2 (default, Mar 20 2014, 20:25:51) 
    [GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import pandas
    
  11. 删除/tmp/pandas目录。

    rm -rf /tmp/pandas
    

希望这对你也有用!

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

无法使用 OpenShift 安装 Pandas 的相关文章

随机推荐

  • 从打印语句中删除最后一个分隔符

    这是对整数数组进行排序的方法 如何从输出中删除最后一个分隔符 public void Sort int sort for int a sort System out print a Output 1 2 3 4 5 6 7 8 9 10 1
  • 仅将圆角添加到 UITableView 的顶部?

    我试图仅向 UITableView 的顶角添加圆角 但问题是 使用下面的代码 它只会在整个 UITableView 上形成黑色层 我该如何解决这个问题 Rounded Corners for top corners of UITableVi
  • 基于 Android 4.0 的 Virtual Box 模拟器无法检测到笔记本电脑的蓝牙 4.0

    目前我正在开发与蓝牙 4 0 设备通信的 Android 应用程序 截至目前 我包括博康布尔在我的应用程序中并做了一些示例代码 实际上我没有基于蓝牙 4 0 的 Android 智能手机 因此出于测试目的 我只是安装了 Oracle Vir
  • Websocket 使用队列等待服务器响应

    我使用 websocket 发送和接收数据 每秒最多 30 条小消息 我希望客户端发送 websocket 有效负载并等待来自服务器的特定消息 Flow 客户端发送请求 它还将 requestId 163 存储在waitingRespons
  • D3:将鼠标滚轮重新映射为平移手势而不是缩放手势

    默认情况下 当您在 D3 中创建新的缩放行为时 它会映射鼠标滚轮来控制缩放级别 如果图表大于图表区域 您还可以单击并拖动来平移图表 我想重新映射鼠标滚轮手势以在垂直轴上平移 鼠标滚轮向上平移 鼠标滚轮向下平移 有人知道如何实现这一目标吗 好
  • Fortran“参数”类型不包含在编译对象中

    我有一个 Fortran 模块 其中包含一些具有属性的变量parameter有些有属性save The parameter那些不包含在编译的对象中 这在尝试组装库时成为一个问题 例如 考虑一个文件testModule f90 module
  • Javascript:检查服务器是否在线?

    通过 JavaScript 检查我的服务器是否在线的最快方法是什么 我尝试过以下 AJAX function isonline var uri MYURL var xhr new XMLHttpRequest xhr open GET ur
  • 如何使用 HttpWebRequest 登录后从网络提取数据

    我正在尝试从登录中提取数据 以便能够验证登录是否成功 如何使用 HttpWebRequest 提取页面内容 以便我可以使用它来验证登录是否正常 由于无论登录正确还是错误 每次登录都会返回状态代码 200 因此验证登录是否成功变得更加困难 p
  • _tkinter.TclError:预期的浮点数但得到“08”(看起来像无效的八进制数)

    我是一名 A level 学生 正在写计算机课程作业 我的代码的一小部分接受输入 将它们转换成时间 早上 8 点钟显示如下 08 因为 SQLite 喜欢这样 但是 当将其转换为日期时 我在标题中收到错误消息 tkinter TclErro
  • Windows下使用Lua读写串口

    我的总体计划目标是使用 Lua 创建更好的 3D 打印机校准 GUI 幸运的是 GUI 部分已经可以工作了 我正在尝试从 Windows 10 计算机上的 COM 端口读取和写入打印机的 Arduino 然而 我对串行通信感到困惑 目前 我
  • 比较两个字符串并突出显示发现的不匹配之处

    我想比较两个字符串并突出显示不匹配的单词 我编写的代码有以下两个问题 1 只要存在不匹配 该单词就会存储在 令牌 中 但是一旦调用突出显示函数 它就会突出显示该字符串中与令牌中的单词匹配的所有单词 2 所有差异都会显示在控制台上 然而 当
  • Soundcloud API:如何仅播放曲目的一部分?

    对于即将到来的项目 我正在研究使用 Soundcloud API 仅播放特定长度 例如 20 秒 的曲目的可能性 有人可以告诉我这是否可能吗 或者应该单独创建一个长度有限的不同轨道吗 非常感谢 马丁 WebForDreams 有几种方法可以
  • IE挂起,CPU占用100%

    我有一个 Web 应用程序 在正常交互过程中 它会挂起 IE 我所说的 IE 被挂起 是指 IE 不再响应并使用 100 的 CPU 摆脱这种状态的唯一方法就是终止 IE 进程 关于该应用程序 它仅在浏览器中加载一页 通过 Ajax 查询与
  • 在图表.net mvc3中设置间隔

    我想在 mvc3 net c 中将图表上的间隔设置为 1 使用 System Web Helpers 我找不到图表属性来设置间隔 以便 x yValues 显示所有标签 这里是代码 Chart key new Chart width 600
  • 如何从 YouTube 播放器中删除 YouTube 徽标以便在其他应用程序中使用?

    我想在我的应用程序中使用 Charmless youtube 播放器 并且我想从播放器中删除 youtube 徽标 我怎样才能实现这个目标 我的应用程序是使用 AS3 开发的 只需添加 modestbranding 1到您的网址末尾 查看更
  • React Native 中 WebView 内的 Twitter 小部件

    我正在尝试在 a 中加载 Twitter 小部件WebView在我的 React Native 应用程序中 但似乎我注入的 Javascript 由于某种原因无法工作 我正在做的是异步加载 Twitter 脚本 函数采取从这里 然后执行tw
  • n & (n-1) 这个表达式的作用是什么? [复制]

    这个问题在这里已经有答案了 可能的重复 关于判断数字是否为2的幂的查询 这个函数有什么作用 n n 1 这个表达可以用在什么地方 它正在弄清楚如果n是 0 或 2 的精确幂 它之所以有效 是因为 2 的二进制幂的形式为1000 000减去一
  • 如何使用闭包在两个 ViewController 之间传递数据

    我想知道如何使用闭包传递数据 我知道有三种类型的数据传递方法 delegate 通知中心 closure 我想用一个例子来正确地澄清闭包 使用块 闭包传递数据是一种很好且合理的方法 比通知要好得多 下面是相同的代码 第一个 ViewCont
  • Linq 同时进行 2 个集合

    我有两个清单 List a listA1 GetFirstList List a listA2 GetSecondList and class A定义 class A public int Id get set public DateTim
  • 无法使用 OpenShift 安装 Pandas

    I am ssh ingFlask 应用程序OpenShiftPython 依赖项之一是 Pandas 0 16 1 纵观整个OpenShift 文档 我创建了我的setup py文件如下 from setuptools import se