Найти - Пользователи
Полная версия: poloniex.com API
Начало » Python для новичков » poloniex.com API
1
mts84
Добрый день
Установил версию 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]

Помогите разобраться
FishHook
mts84
Смотрим внутрь setup.py
  packages=find_packages(exclude=['examples', 'tests']),
Это значит, что примеры и тесты в инсталляционный пакет не включаются. Вы же активно пытаетесь оттуда прочитать конфигу. Создайте свой фал конфигурации где-нибудь в своем юзерспейсе, опираясь на пример с гитхаба.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB