Skip to content

Error: Cannot Instantiate PosixPath in your system #229

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

Closed
umesh-timalsina opened this issue Aug 18, 2023 · 3 comments
Closed

Error: Cannot Instantiate PosixPath in your system #229

umesh-timalsina opened this issue Aug 18, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@umesh-timalsina
Copy link
Contributor

It seems like nodes created in a Linux system cannot be instantiated in Windows and throws the above error:

File "C:\Users\OELE03\MMLAProject\ChimeraPy\chimerapy\engine\worker\http_server_service.py", line 223, in _async_create_node_route
    await self.eventbus.asend(Event("create_node", CreateNodeEvent(node_config)))
  File "C:\Users\OELE03\MMLAProject\ChimeraPy\chimerapy\engine\eventbus\eventbus.py", line 41, in asend
    await self.stream.asend(event)
  File "C:\Users\OELE03\miniconda3\envs\chimerapy-dev\lib\site-packages\aioreactive\subject.py", line 125, in asend
    await obv.asend(value)
  File "C:\Users\OELE03\MMLAProject\ChimeraPy\chimerapy\engine\eventbus\eventbus.py", line 119, in asend
    await self.exec_callable(self._on_asend, **event.data.__dict__)
  File "C:\Users\OELE03\MMLAProject\ChimeraPy\chimerapy\engine\eventbus\eventbus.py", line 98, in exec_callable
    await func(*arg, **kwargs)
  File "C:\Users\OELE03\MMLAProject\ChimeraPy\chimerapy\engine\worker\node_handler_service.py", line 266, in async_create_node
    node_object = dill.loads(node_config.pickled)
  File "C:\Users\OELE03\miniconda3\envs\chimerapy-dev\lib\site-packages\dill\_dill.py", line 286, in loads
    return load(file, ignore, **kwds)
  File "C:\Users\OELE03\miniconda3\envs\chimerapy-dev\lib\site-packages\dill\_dill.py", line 272, in load
    return Unpickler(file, ignore=ignore, **kwds).load()
  File "C:\Users\OELE03\miniconda3\envs\chimerapy-dev\lib\site-packages\dill\_dill.py", line 419, in load
    obj = StockUnpickler.load(self)
  File "C:\Users\OELE03\miniconda3\envs\chimerapy-dev\lib\pathlib.py", line 962, in __new__
    raise NotImplementedError("cannot instantiate %r on your system"
NotImplementedError: cannot instantiate 'PosixPath' on your system
@umesh-timalsina umesh-timalsina self-assigned this Aug 18, 2023
@umesh-timalsina umesh-timalsina added the bug Something isn't working label Aug 18, 2023
@edavalosanaya
Copy link
Collaborator

edavalosanaya commented Aug 18, 2023

Yes, need to ensure that all pathlib.Path objects should be strings before dill loads. Looking for a solution as well.

@edavalosanaya
Copy link
Collaborator

Likely the issue is that NodeState has a logdir variable with type Pathlib.Path that is created in the Manager computer, pickled, and sent to the Worker computer to be unpickled. Different OS can cause incompatible pathlib.Path objects. Let me convert it to string.

@umesh-timalsina
Copy link
Contributor Author

I was wondering why the logdir needs to be a path during initialization? Additionally, does the temporary directory needs to be created during initialization?

@github-project-automation github-project-automation bot moved this to On-going Development in ChimeraPy Development Aug 18, 2023
@edavalosanaya edavalosanaya moved this from On-going Development to Done in ChimeraPy Development Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

2 participants