tudorelu / pyjuque

⚡ Open Source Algorithmic Trading Bot for Python.
MIT License
456 stars 90 forks source link

InvalidRequestError: One or more mappers failed to initialize - can't proceed with initialization of other mappers. #11

Closed rafaelin-github closed 3 years ago

rafaelin-github commented 3 years ago

Description When I run a bot for the first time I am getting this error:

InvalidRequestError: One or more mappers failed to initialize - can't proceed with initialization of other mappers. Triggering mapper: 'mapped class EntrySettingsModel->entry_settings'. Original exception was: Could not determine join condition between parent/child tables on relationship EntrySettingsModel.bots - there are no foreign keys linking these tables. Ensure that referencing columns are associated with a ForeignKey or ForeignKeyConstraint, or specify a 'primaryjoin' expression.

Traceback

Traceback (most recent call last):

  File "E:\TradingBot\Tests\Bot\pyjuque\test.py", line 70, in <module>
    main()

  File "E:\TradingBot\Tests\Bot\pyjuque\test.py", line 59, in main
    bot_controller = defineBot(bot_config)

  File "E:\Programs\anaconda3\lib\site-packages\pyjuque\Bot.py", line 75, in defineBot
    bot_controller = _defineTaBot(bot_config)

  File "E:\Programs\anaconda3\lib\site-packages\pyjuque\Bot.py", line 85, in _defineTaBot
    bot_model = session.query(TABotModel).filter_by(name=bot_name).first()

  File "E:\Programs\anaconda3\lib\site-packages\sqlalchemy\orm\session.py", line 1584, in query
    return self._query_cls(entities, self, **kwargs)

  File "E:\Programs\anaconda3\lib\site-packages\sqlalchemy\orm\query.py", line 199, in __init__
    self._set_entities(entities)

  File "E:\Programs\anaconda3\lib\site-packages\sqlalchemy\orm\query.py", line 227, in _set_entities
    self._set_entity_selectables(self._entities)

  File "E:\Programs\anaconda3\lib\site-packages\sqlalchemy\orm\query.py", line 258, in _set_entity_selectables
    ent.setup_entity(*d[entity])

  File "E:\Programs\anaconda3\lib\site-packages\sqlalchemy\orm\query.py", line 4292, in setup_entity
    self._with_polymorphic = ext_info.with_polymorphic_mappers

  File "E:\Programs\anaconda3\lib\site-packages\sqlalchemy\util\langhelpers.py", line 883, in __get__
    obj.__dict__[self.__name__] = result = self.fget(obj)

  File "E:\Programs\anaconda3\lib\site-packages\sqlalchemy\orm\mapper.py", line 2158, in _with_polymorphic_mappers
    configure_mappers()

  File "E:\Programs\anaconda3\lib\site-packages\sqlalchemy\orm\mapper.py", line 3276, in configure_mappers
    raise e

System Information:

Branch:

Additional info I am not sure which tables are involved, am I missing something? testbot.txt

Physicworld commented 3 years ago

Hey bro! in your testbot.txt you have commented the line 7, where you read your API KEYS.

Check if that is the problem.

rafaelin-github commented 3 years ago

Thanks for the tip, in the attached they are commented but in the one I'm using the keys aren't commented, and the ones I am using are the ones I created in binance, I think it's something related to the database and the relationship with the tables, Can you help me further?

Physicworld commented 3 years ago

Bro, i have been talking with Tudor about this problem, we consider that the problem could be the OS, we use Mac OS and Linux to run pyjuque and we dont ever tested pyjuque on Windows.

This is a new issue to solve, give us some time.

Thanks Rafa!

rafaelin-github commented 3 years ago

Thanks Bro for your and Tudor's time, I was fearing that the OS was the issue, Pyjuque is amazing I hope be able to use it soon, good luck on all your projects!

rafaelin-github commented 3 years ago

Bro, I have uninstalled everything and installed everything from scratch from anaconda to libraries and it's working now, thank you for all your support, I am closing this now.