-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ImportError: generic_type: type "Car" is already registered! #21
Comments
I'm not able to reproduce the error. I am using the example you linked, and unzipping the latest release (1.0.2), and I see no such import error. The example is still broken, since the psyonix patch screwed up state setting, but that's a separate issue. |
After some testing I was able to learn more about this strange behavior. My setup is as follows: I use rlutilities as a local module and bypass installing it normally via pip to ease version concerns for others using the bot. I keep rlbot files one level up with all my different bot projects being sub directories within that parent folder each containing their own rlutilities release folder as required. The error above is a result of running rlbot from that parent folder accessing an agent from one of the sub directory bots folders. I found however that if I copied the rlbot files to be local with the agents being accessed, then everything loaded properly. As a test, I installed the local rlutilities properly via pip instead of accessing it locally and the problem was resolved. |
I discovered today that this is not an issue with the new gui, only the legacy version. |
I was able to dupe this on the new GUI:
|
Is the GUI still installing old RLUtilities from pip? |
Diablo (made by @oxrock) comes packaged with the new RLUtilities. After some experimentation, I found that I could avoid the problem by moving Diablo's RLU python imports to the initialize_agent method, so that they don't clash with those of other bots at construction time (We construct all the bots just to grab their names etc so we can build a start match message, and this all happens in the main process. This may not be necessary, and the design should be reviewed). We try to avoid this problem here https://github.com/RLBot/RLBot/blob/edce25a0428346ee3430409f925c596b6e7ac308/src/main/python/rlbot/utils/class_importer.py#L88-L93 but this strategy seems not to work properly when dealing with RLU. The GUI does still install old RLUtilities, but that may not be relevant. https://github.com/RLBot/RLBotGUI/blob/master/pynsist_helpers/rlbot-requirements.txt#L11 I certainly hope it's not relevant, because we can't auto-remove that for anybody who already has the GUI installed. |
I'm posting the error log from running a bot with only the sample code provided here: https://github.com/samuelpmish/RLUtilities/blob/master/python/examples/7_Aerial/agent.py
This is using the python release rlutilities_1_0_2 and the unedited example aerial code
Traceback (most recent call last):
File "D:\python3.7.3\lib\site-packages\rlbot\gui\qt_root.py", line 193, in load_preset_toplevel
preset = self.agent_customisation.load_preset_cfg()
File "D:\python3.7.3\lib\site-packages\rlbot\gui\preset_editors.py", line 399, in load_preset_cfg
return super().load_preset_cfg()
File "D:\python3.7.3\lib\site-packages\rlbot\gui\preset_editors.py", line 132, in load_preset_cfg
preset = self.preset_class(self.validate_name(pathlib.Path(file_path).stem, None), file_path)
File "D:\python3.7.3\lib\site-packages\rlbot\gui\presets.py", line 103, in init
self.agent_class = import_agent(python_file_path).get_loaded_class()
File "D:\python3.7.3\lib\site-packages\rlbot\utils\class_importer.py", line 40, in import_agent
return import_class_with_base(python_file, BaseAgent)
File "D:\python3.7.3\lib\site-packages\rlbot\utils\class_importer.py", line 52, in import_class_with_base
return ExternalClassWrapper(python_file, base_class)
File "D:\python3.7.3\lib\site-packages\rlbot\utils\class_importer.py", line 21, in init
self.loaded_class, self.loaded_module = load_external_class(self.python_file, self.base_class)
File "D:\python3.7.3\lib\site-packages\rlbot\utils\class_importer.py", line 59, in load_external_class
loaded_module = load_external_module(python_file)
File "D:\python3.7.3\lib\site-packages\rlbot\utils\class_importer.py", line 86, in load_external_module
loaded_module = importlib.import_module(module_name)
File "D:\python3.7.3\lib\importlib_init_.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "", line 728, in exec_module
File "", line 219, in call_with_frames_removed
File "D:\coding projects\RLBot\RLBotPythonExample-master\mac-n-cheese\macNcheese.py", line 8, in
from rlutilities.linear_algebra import *
File "D:\coding projects\RLBot\RLBotPythonExample-master\mac-n-cheese\rlutilities_init.py", line 2, in
from .rlutilities import mechanics, simulation, linear_algebra
ImportError: generic_type: type "Car" is already registered!
There are no import errors when run individually without without the rlbot framework but it errors without fail if trying to start a match.
The text was updated successfully, but these errors were encountered: