Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

Can't pickle <function cli at 0x105140a60>: it's not the same object as pyspider.run.cli #995

Open
heyonly opened this issue Oct 24, 2023 · 3 comments

Comments

@heyonly
Copy link

heyonly commented Oct 24, 2023

  • pyspider version: 0.3.10 & 0.4.0
  • Operating system: macos 14.0 (M1)
  • Start up command: pyspider

Can't pickle <function cli at 0x105140a60>: it's not the same object as pyspider.run.cli

$ pyspider

Traceback (most recent call last):
File "/Users/haibing6/Library/Python/3.9/bin/pyspider", line 8, in
sys.exit(main())
File "/Users/haibing6/Library/Python/3.9/lib/python/site-packages/pyspider/run.py", line 839, in main
cli()
File "/Users/haibing6/Library/Python/3.9/lib/python/site-packages/click/core.py", line 1130, in call
return self.main(*args, **kwargs)
File "/Users/haibing6/Library/Python/3.9/lib/python/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/Users/haibing6/Library/Python/3.9/lib/python/site-packages/click/core.py", line 1635, in invoke
rv = super().invoke(ctx)
File "/Users/haibing6/Library/Python/3.9/lib/python/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/haibing6/Library/Python/3.9/lib/python/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/Users/haibing6/Library/Python/3.9/lib/python/site-packages/click/decorators.py", line 26, in new_func
return f(get_current_context(), *args, **kwargs)
File "/Users/haibing6/Library/Python/3.9/lib/python/site-packages/pyspider/run.py", line 177, in cli
ctx.invoke(all)
File "/Users/haibing6/Library/Python/3.9/lib/python/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/Users/haibing6/Library/Python/3.9/lib/python/site-packages/click/decorators.py", line 26, in new_func
return f(get_current_context(), *args, **kwargs)
File "/Users/haibing6/Library/Python/3.9/lib/python/site-packages/pyspider/run.py", line 531, in all
threads.append(run_in(ctx.invoke, phantomjs, **phantomjs_config))
File "/Users/haibing6/Library/Python/3.9/lib/python/site-packages/pyspider/libs/utils.py", line 68, in run_in_subprocess
thread.start()
File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/multiprocessing/process.py", line 121, in start
self._popen = self._Popen(self)
File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/multiprocessing/context.py", line 224, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/multiprocessing/context.py", line 284, in _Popen
return Popen(process_obj)
File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 32, in init
super().init(process_obj)
File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/multiprocessing/popen_fork.py", line 19, in init
self._launch(process_obj)
File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 47, in _launch
reduction.dump(process_obj, fp)
File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/multiprocessing/reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
_pickle.PicklingError: Can't pickle <function cli at 0x105140a60>: it's not the same object as pyspider.run.cli

How to resolve this issue?

@waitttttttttttttttttttttttting

me+1,
Is there anything I can do to fix this?

@JadeXH
Copy link

JadeXH commented Feb 22, 2024

+1

1 similar comment
@djn-m
Copy link

djn-m commented Apr 9, 2024

+1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants