1

我试图让python-gasp在 Windows 上工作,但是当我这样做时,import gasp; gasp.begin_graphics()我得到以下回溯:

  File "C:\Python26\lib\site-packages\gasp\backend.py", line 142, in create_screen

    screen.updater.start()

  File "C:\Python26\lib\multiprocessing\process.py", line 104, in start

    self._popen = Popen(self)

  File "C:\Python26\lib\multiprocessing\forking.py", line 239, in __init__

    dump(process_obj, to_child, HIGHEST_PROTOCOL)

  File "C:\Python26\lib\multiprocessing\forking.py", line 162, in dump

    ForkingPickler(file, protocol).dump(obj)

  File "C:\Python26\lib\pickle.py", line 224, in dump

    self.save(obj)

  File "C:\Python26\lib\pickle.py", line 331, in save

    self.save_reduce(obj=obj, *rv)

  File "C:\Python26\lib\pickle.py", line 419, in save_reduce

    save(state)

  File "C:\Python26\lib\pickle.py", line 286, in save

    f(self, obj) # Call unbound method with explicit self

  File "C:\Python26\lib\pickle.py", line 649, in save_dict

    self._batch_setitems(obj.iteritems())

  File "C:\Python26\lib\pickle.py", line 681, in _batch_setitems

    save(v)

  File "C:\Python26\lib\pickle.py", line 286, in save

    f(self, obj) # Call unbound method with explicit self

  File "C:\Python26\lib\pickle.py", line 725, in save_inst

    save(stuff)

  File "C:\Python26\lib\pickle.py", line 286, in save

    f(self, obj) # Call unbound method with explicit self

  File "C:\Python26\lib\pickle.py", line 649, in save_dict

    self._batch_setitems(obj.iteritems())

  File "C:\Python26\lib\pickle.py", line 681, in _batch_setitems

    save(v)

  File "C:\Python26\lib\pickle.py", line 331, in save

    self.save_reduce(obj=obj, *rv)

  File "C:\Python26\lib\pickle.py", line 396, in save_reduce

    save(cls)

  File "C:\Python26\lib\pickle.py", line 286, in save

    f(self, obj) # Call unbound method with explicit self

  File "C:\Python26\lib\pickle.py", line 748, in save_global

    (obj, module, name))

PicklingError: Can't pickle <class 'multiprocessing.process._MainProcess'>: it's not found as multiprocessing.process._MainProcess

知道为什么我在 Windows XP 上出现此错误,但在 Ubuntu Linux 9.04 上却没有?

如果有帮助,它看起来像是( defscreen.updater )的一个实例。有问题的文件位于http://bazaar.launchpad.net/~gasp-dev/gasp-core/main/annotate/head%3A/gasp/backend.pyUpdater(multiprocessing.Process)

4

1 回答 1

2

你的Updater类有一个成员screen,它本身有一个process接收值的成员multiprocessing.current_process()

当您调用时updater.start(),它会尝试腌制更新程序。这只发生在 Windows 上,因为 Linux 使用fork()而不是酸洗。但是,当前进程对象不能被腌制并引发异常。

要解决此问题,您可以删除该process成员。

于 2010-01-14T15:04:08.340 回答