Уведомления

Группа в Telegram: @pythonsu

#1 Фев. 2, 2017 16:46:59

mts84
Зарегистрирован: 2017-02-02
Сообщения: 3
Репутация: +  0  -
Профиль   Отправить e-mail  

poloniex.com API

Добрый день
Установил версию 3,4,4
Скачал архив https://github.com/Pancho/poloniex установил.

 import time
from poloniex import poloniex
def test_ticker():
	api = poloniex.Poloniex('examples/config.py')
	while True:
		print(api.ticker())
		# Change this to less at your own risk - Bitstamp has a harsh policy about exceeding allowed number of calls
		time.sleep(1)
def test_volume():
	api = poloniex.Poloniex('examples/config.py')
	while True:
		print(api.daily_volume())
		# Change this to less at your own risk - Bitstamp has a harsh policy about exceeding allowed number of calls
		time.sleep(1)
def test_order_book():
	api = poloniex.Poloniex('examples/config.py')
	while True:
		print(api.order_book())
		# Change this to less at your own risk - Bitstamp has a harsh policy about exceeding allowed number of calls
		time.sleep(1)
def test_ws(*args, **kwargs):
	print(args, kwargs)
if __name__ == '__main__':
	api = poloniex.Poloniex('examples/config.py')
	api.attach_order_book(test_ws, 'BTC_ETH')

Выдает ошибку в чем проблемма?
 Traceback (most recent call last):
  File "C:\bot\poloniex-master-3-4\tests\example.py", line 39, in <module>
    api = poloniex.Poloniex('examples/config.py')
  File "C:\Python34\lib\site-packages\poloniex-0.6.1-py3.4.egg\poloniex\poloniex.py", line 49, in __init__
  File "C:\Python34\lib\site-packages\poloniex-0.6.1-py3.4.egg\poloniex\poloniex.py", line 129, in __get_credentials
Exception: While the config file was found, it was not configured correctly. Check for examples here: https://github.com/Pancho/poloniex
[Finished in 4.4s with exit code 1]
[shell_cmd: python -u "C:\bot\poloniex-master-3-4\tests\example.py"]
[dir: C:\bot\poloniex-master-3-4\tests]
[path: C:\Python34\;C:\Python34\Scripts;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem]

Помогите разобраться

Офлайн

#2 Фев. 2, 2017 16:55:08

FishHook
От:
Зарегистрирован: 2011-01-08
Сообщения: 8312
Репутация: +  568  -
Профиль   Отправить e-mail  

poloniex.com API

mts84
Смотрим внутрь setup.py

  packages=find_packages(exclude=['examples', 'tests']),
Это значит, что примеры и тесты в инсталляционный пакет не включаются. Вы же активно пытаетесь оттуда прочитать конфигу. Создайте свой фал конфигурации где-нибудь в своем юзерспейсе, опираясь на пример с гитхаба.



Офлайн

Board footer

Модераторировать

Powered by DjangoBB

Lo-Fi Version