celery文档声明我应该可以使用Jython运行它。不幸的是,我无法让它发挥作用。这是我尝试运行时遇到的错误:
Traceback (most recent call last):
File "/home/linoor/jython2.7.0/bin/celery", line 11, in
sys.exit(main())
File "/home/linoor/jython2.7.0/Lib/site-packages/celery/__main__.py", line 29, in main
from celery.bin.celery import main
File "/home/linoor/jython2.7.0/Lib/site-packages/celery/bin/__init__.py", line 3, in
from .base import Option
File "/home/linoor/jython2.7.0/Lib/site-packages/celery/bin/base.py", line 86, in
from celery import VERSION_BANNER, Celery, maybe_patch_concurrency
File "/home/linoor/jython2.7.0/Lib/site-packages/celery/five.py", line 307, in __getattr__
module = __import__(self._object_origins[name], None, None, [name])
File "/home/linoor/jython2.7.0/Lib/site-packages/celery/app/__init__.py", line 14, in
from celery import _state
File "/home/linoor/jython2.7.0/Lib/site-packages/celery/_state.py", line 20, in
from celery.utils.threads import LocalStack
File "/home/linoor/jython2.7.0/Lib/site-packages/celery/utils/__init__.py", line 27, in
from celery.exceptions import CPendingDeprecationWarning, CDeprecationWarning
File "/home/linoor/jython2.7.0/Lib/site-packages/celery/exceptions.py", line 15, in
from billiard.exceptions import ( # noqa
File "/home/linoor/jython2.7.0/Lib/site-packages/billiard/__init__.py", line 60, in
from .process import Process, current_process, active_children
File "/home/linoor/jython2.7.0/Lib/site-packages/billiard/process.py", line 25, in
from multiprocessing import process as _mproc
ImportError: No module named multiprocessing
所以我尝试安装多处理,但后来发生了这种情况:
Downloading/unpacking multiprocessing
Downloading multiprocessing-2.6.2.1.tar.gz (108kB): 108kB downloaded
Running setup.py (path:/tmp/pip_build_linoor/multiprocessing/setup.py) egg_info for package multiprocessing
Installing collected packages: multiprocessing
Running setup.py install for multiprocessing
building 'multiprocessing._multiprocessing' extension
error: Compiling extensions is not supported on Jython
Complete output from command /home/linoor/jython2.7.0/bin/jython -c "import setuptools, tokenize;__file__='/tmp/pip_build_linoor/multiprocessing/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-EnQW3c-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.java1.7.0_79-2.7
creating build/lib.java1.7.0_79-2.7/multiprocessing
copying Lib/multiprocessing/queues.py -> build/lib.java1.7.0_79-2.7/multiprocessing
copying Lib/multiprocessing/tests.py -> build/lib.java1.7.0_79-2.7/multiprocessing
copying Lib/multiprocessing/sharedctypes.py -> build/lib.java1.7.0_79-2.7/multiprocessing
copying Lib/multiprocessing/synchronize.py -> build/lib.java1.7.0_79-2.7/multiprocessing
copying Lib/multiprocessing/heap.py -> build/lib.java1.7.0_79-2.7/multiprocessing
copying Lib/multiprocessing/pool.py -> build/lib.java1.7.0_79-2.7/multiprocessing
copying Lib/multiprocessing/connection.py -> build/lib.java1.7.0_79-2.7/multiprocessing
copying Lib/multiprocessing/__init__.py -> build/lib.java1.7.0_79-2.7/multiprocessing
copying Lib/multiprocessing/util.py -> build/lib.java1.7.0_79-2.7/multiprocessing
copying Lib/multiprocessing/process.py -> build/lib.java1.7.0_79-2.7/multiprocessing
copying Lib/multiprocessing/reduction.py -> build/lib.java1.7.0_79-2.7/multiprocessing
copying Lib/multiprocessing/managers.py -> build/lib.java1.7.0_79-2.7/multiprocessing
copying Lib/multiprocessing/forking.py -> build/lib.java1.7.0_79-2.7/multiprocessing
copying Lib/multiprocessing/patch.py -> build/lib.java1.7.0_79-2.7/multiprocessing
creating build/lib.java1.7.0_79-2.7/multiprocessing/dummy
copying Lib/multiprocessing/dummy/connection.py -> build/lib.java1.7.0_79-2.7/multiprocessing/dummy
copying Lib/multiprocessing/dummy/__init__.py -> build/lib.java1.7.0_79-2.7/multiprocessing/dummy
creating build/lib.java1.7.0_79-2.7/multiprocessing/examples
copying Doc/includes/mp_benchmarks.py -> build/lib.java1.7.0_79-2.7/multiprocessing/examples
copying Doc/includes/mp_synchronize.py -> build/lib.java1.7.0_79-2.7/multiprocessing/examples
copying Doc/includes/mp_workers.py -> build/lib.java1.7.0_79-2.7/multiprocessing/examples
copying Doc/includes/__init__.py -> build/lib.java1.7.0_79-2.7/multiprocessing/examples
copying Doc/includes/mp_newtype.py -> build/lib.java1.7.0_79-2.7/multiprocessing/examples
copying Doc/includes/mp_distributing.py -> build/lib.java1.7.0_79-2.7/multiprocessing/examples
copying Doc/includes/mp_webserver.py -> build/lib.java1.7.0_79-2.7/multiprocessing/examples
copying Doc/includes/mp_pool.py -> build/lib.java1.7.0_79-2.7/multiprocessing/examples
running build_ext
building 'multiprocessing._multiprocessing' extension
error: Compiling extensions is not supported on Jython
从我读到的内容来看,它无法在Jython中使用包multiprocessing
,因为它需要C扩展(link to SO question)。
毕竟,用Jython运行芹菜是不是很有可能呢?
谢谢!