繁体   English   中英

OANDA API 连接错误: tpqoa.py 中的 TypeError __init__ 中的 package(self,conf_file)

[英]OANDA API Connection Error: TypeError in tpqoa.py package in __init__(self, conf_file)

尝试与我的 OANDA Practice 帐户建立连接时出现以下错误:

api = tpqoa.tpqoa("oanda.cfg")

TypeError Traceback (most recent call last)
in
----> 1 api = tpqoa.tpqoa("oanda.cfg")
~/Library/Python/3.8/lib/python/site-packages/tpqoa/tpqoa.py in init(self, conf_file)
67 self.stream_hostname = 'stream-fxpractice.oanda.com'
68
---> 69 self.ctx = v20.Context(
70 hostname=self.hostname,
71 port=443,

TypeError: init() got an unexpected keyword argument 'token'

我的 oanda.cfg 看起来像这样:

[oanda]
account_id = 101-004-8861064-001 
access_token = ddab9dd1e464036643cb7a4574e83d87-a35a1948575e9825dacfaac49bb90b00
account_type = practice

我的 pip 冻结:

appnope==0.1.2
APScheduler==3.6.3
as==0.1
asgiref==3.2.7
attrs==19.3.0
autopep8==1.5
backcall==0.2.0
black==19.10b0
certifi==2019.11.28
chardet==3.0.4
Click==7.0
coreapi==2.3.3
coreschema==0.0.4
decorator==4.4.2
Django==3.0.5
django-extensions==2.2.8
django-rest-swagger==2.2.0
djangorestframework==3.11.0
entrypoints==0.3
flake8==3.7.9
flake8-black==0.1.1
Flask==1.1.1
idna==2.9
ipykernel==5.4.2
ipython==7.19.0
ipython-genutils==0.2.0
itsdangerous==1.1.0
itypes==1.1.0
jedi==0.17.2
jupyter-client==6.1.7
jupyter-core==4.7.0
mccabe==0.6.1
numpy==1.19.4
openapi-codec==1.3.2
packaging==20.3
pandas==1.2.0
parso==0.7.1
pathspec==0.7.0
pd==0.0.1
pexpect==4.8.0
pickleshare==0.7.5
prompt-toolkit==3.0.8
ptyprocess==0.6.0
pycodestyle==2.5.0
pyflakes==2.1.1
Pygments==2.7.3
python-dateutil==2.8.1
pytz==2020.5
PyYAML==5.3.1
pyzmq==20.0.0
redis==3.4.1
regex==2020.1.8
requests==2.23.0
six==1.15.0
sqlparse==0.3.1
toml==0.10.0
tornado==6.1
tpqoa @ git+https://github.com/yhilpisch/tpqoa@025ee329f21089db44f1da49fb81cdf1e872422d
traitlets==5.0.5
typed-ast==1.4.1
tzlocal==2.0.0
ujson==4.0.1
uritemplate==3.0.1
urllib3==1.25.8
v20==3.0.25.0
wcwidth==0.2.5
Werkzeug==1.0.0

我正在尝试使用 OANDA v20 Python tpqoa API 连接到我的 OANDA 练习帐户。 尝试在 oanda.cfg 变量周围使用引号但没有成功。 怀疑是新手手指错误,但是,我找不到?

亲切的问候,

约翰

我无法复制您的错误,但在您的.cfg文件中, account_id应该是您的用户名,而不是帐号。

亲爱的约翰我有同样的错误。 你解决了吗? 如果是怎么办? 谢谢丹尼斯

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM