python ctp接口_使用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,
創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎總結
以上是生活随笔為你收集整理的python ctp接口_使用ctp的python接口的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: mysql全局变量 error_记录——
- 下一篇: “有司机收入超690亿”?滴滴官方回应: