OANDA API连接错误:tpqoa.py包中的TypeError在_init__;(self,conf_文件)中

2024-06-01 04:07:30 发布

您现在位置:Python中文网/ 问答频道 /正文

我在尝试建立与我的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

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

亲切问候,

约翰


Tags: inselfcomapistreaminit帐户cfg