我真的想爲我的項目使用優秀的zerorpc,它使用IronPython,但它似乎不被支持。ZeroRPC和IronPython
我試圖下載源的郵政編碼爲zerorpc
和運行
"C:\Program Files (x86)\IronPython 2.7\ipy.exe" setup.py install
,但我認爲這一路上:
warning: build_py: byte-compiling is disabled, skipping.
此並不矛盾的答案:Fast and scalable RPC between C# and CPython。
我的問題(S):
- 是否有可能得到zerorpc與IronPython和如果是這樣運行的,請你給我怎麼辦呢提示嗎?
- 如果不是,那麼是否還有其他可以提供IronPython功能的等價包?這裏有一個列表:What is the current choice for doing RPC in Python?,但有誰知道這些工作是否與IronPython一起工作?
更新2 繼@PawelJasinski建議和他的更新pyzmq IronPython的-後臺,我曾嘗試以下:安裝IronPython的2.7.5b2
- 或更高版本
- 安裝來自http://zeromq.org/distro:microsoft-windows的32位版本zeromq
- 克隆
ironpython-backend
分支從https://github.com/paweljasinski/pyzmq/tree/ironpython-backend - 在
pyzmq
目錄,運行ipy.exe setup.py install --user
- 克隆zerorpc從https://github.com/dotcloud/zerorpc-python
- 在
zerorpc-python
,運行ipy.exe setup.py install --user
- 設置環境變量:
set PYZMQ_BACKEND=zmq.backend.ctypes
- 試圖使用從https://github.com/dotcloud/zerorpc-python的 '涼快' 類的例子,運行與
ipy.exe -X:Frames cooler.py
(cooler.py):
class Cooler(object):
""" Various convenience methods to make things cooler. """
def add_man(self, sentence):
""" End a sentence with ", man!" to make it sound cooler, and
return the result. """
return sentence + ", man!"
def add_42(self, n):
""" Add 42 to an integer argument to make it cooler, and return the
result. """
return n + 42
def boat(self, sentence):
""" Replace a sentence with "I'm on a boat!", and return that,
because it's cooler. """
return "I'm on a boat!"
import zerorpc
s = zerorpc.Server(Cooler())
s.bind("tcp://0.0.0.0:4242")
s.run()
現在我看到這個錯誤:
Traceback (most recent call last):
File "C:\Users\nlindop\AppData\Roaming\Python\IronPython27\site-packages\zmq\backend\select.py", line 26, in select_backend
File "C:\Users\nlindop\AppData\Roaming\Python\IronPython27\site-packages\zmq\backend\ctypes\__init__.py", line 26, in <module>
File "C:\Users\nlindop\AppData\Roaming\Python\IronPython27\site-packages\zmq\backend\ctypes\constants.py", line 16, in <module>
ImportError: No module named ZMQ
您將需要安裝用於編譯您的python版本的相同版本的visual studio。應該是2008年,但我可能是錯誤的。 – 2014-11-03 17:22:41
@Puciek謝謝,我會檢查我的設置,看看是否有幫助。 – 2014-11-03 23:23:11