zoukankan      html  css  js  c++  java
  • 使用ctp的python接口

    在github上查到一个项目
    ctpwrapper

    在按照文档按照的时候报错

    >>>pip install cython --upgrade
    >>>pip install ctpwrapper --upgrade
    

    在安装第二个命令的时候

    第一个问题

    安装yum install -y gcc-c++ 解决

    第二个问题
    ctpwrapper/MdApi.cpp:39:20: 致命错误:Python.h:没有那个文件或目录

    查找问题,需要python的dev文件 没有正确安装pythondev的头文件和静态库
    下载对应的python包的dev

    为apt (乌本图Debian.。):
    sudo apt-get install python-dev   # for python2.x installssudo apt-get install python3-dev  # for python3.x installs
    为yum (CentOS,RHEL.。):
    sudo yum install python-devel   # for python2.x installssudo yum install python34-devel   # for python3.4 installs
    为dnf (软呢帽.。):
    sudo dnf install python2-devel  # for python2.x installssudo dnf install python3-devel  # for python3.x installs
    为zypper (开诚布公.。):
    sudo zypper in python-devel   # for python2.x installssudo zypper in python3-devel  # for python3.x installs
    为apk (阿尔卑斯山.。):
    # This is a departure from the normal Alpine naming# scheme, which uses py2- and py3- prefixessudo apk add python2-dev   # for python2.x installssudo apk add python3-dev  # for python3.x installs
    为apt-cyg (西格温.。):
    apt-cyg install python-devel   # for python2.x installsapt-cyg install python3-devel  # for python3.x installs
    

    如果需要用最新的上期api,可使用项目中的setup文件中心生成,生成的ctpwrapper替换到site-package下的文件即可使用,请求方法会调用原生的api,响应的返回可以根据自己的需要进行定制,
    需要注意的点,在请求与返回之间最好加上time.sleep,

  • 相关阅读:
    Sum of Medians
    MINSUB
    Girls Love 233
    How Many Answers Are Wrong
    Sorting It All Out
    Cube Stacking
    Boolean Expressions
    表达式求值
    #1301 : 筑地市场
    用seaborn对数据可视化
  • 原文地址:https://www.cnblogs.com/cizao/p/12500862.html
Copyright © 2011-2022 走看看