Pickle error when trying to register project name ...
# prefect-community
e
Pickle error when trying to register project name
Copy code
flow.register('project_name')
  File "venv/lib/python3.8/site-packages/prefect/core/flow.py", line 1623, in register
    registered_flow = client.register(
  File "venv/lib/python3.8/site-packages/prefect/client/client.py", line 734, in register
    serialized_flow = flow.serialize(build=build)  # type: Any
  File "venv/lib/python3.8/site-packages/prefect/core/flow.py", line 1450, in serialize
    self.storage.add_flow(self)
  File "venv/lib/python3.8/site-packages/prefect/environments/storage/local.py", line 144, in add_flow
    flow_location = flow.save(flow_location)
  File "venv/lib/python3.8/site-packages/prefect/core/flow.py", line 1519, in save
    cloudpickle.dump(self, f)
  File "venv/lib/python3.8/site-packages/cloudpickle/cloudpickle_fast.py", line 55, in dump
    CloudPickler(
  File "venv/lib/python3.8/site-packages/cloudpickle/cloudpickle_fast.py", line 563, in dump
    return Pickler.dump(self, obj)
TypeError: cannot pickle 'weakref' object
n
Hi @Edison A - this has to do with pickling your flow, which happens at the registration step. It would appear you're attempting to pass an unpickable reference as part of your flow's metadata; without seeing more code it'll be difficult to point you in the right direction.
👍 1
e
Thanks @nicholas