# Error when Pickling Actor from an imported file

**URL:** <https://discuss.ray.io/t/error-when-pickling-actor-from-an-imported-file/2995>\
**Category:** Ray Core\
**Created:** [July 23, 2021, 8:44pm UTC](https://discuss.ray.io/t/error-when-pickling-actor-from-an-imported-file/2995 "2021-07-23T20:44:19Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![mannyv](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/mannyv/32/606_2.png) [@mannyv](https://discuss.ray.io/u/mannyv)\
**Post date:** [July 24, 2021, 12:19am UTC](https://discuss.ray.io/t/error-when-pickling-actor-from-an-imported-file/2995/2 "2021-07-24T00:19:40Z")

</div>

I have a suspicion it is related to the implicit capture @sangcho describes here but I am not certain.

> [@Best solution to have multiprocess working in actor?](https://discuss.ray.io/t/best-solution-to-have-multiprocess-working-in-actor/2165/4):
>
> Ray’s multi processing lib should be the drop-in replacement of mp library, but it doesn’t support full APIs. So there’s def possibility your application won’t be ported seamlessly. For your issue, it is highly likely you have implicit capture of un-pickleable object in your actor definition. This is an example of implicit capture. a = object # Imagine this is a lock object @ray.remote class A: def \_\_init(self)\_\_: # In this case, a is captured from the above reference a, it should …

---

_[View the full topic](https://discuss.ray.io/t/error-when-pickling-actor-from-an-imported-file/2995)._
