nanomsg-python 安装在Windows下的流程

  1. 在本机安装x64的nanomsg : https://blog.csdn.net/norsd/article/details/81285104
  2. 从GitHub 下载 nanomsg-python的 zip 文件: https://github.com/tonysimpson/nanomsg-python
  3. 把zip文件解压到 c:\nanomsg-python-master
  4. 以Administrator权限打开 Visual Studio 17 下的 x64 Native Tools Command Prompt (如果不使用这个环境,编译连接会出现 cannot run “rc.exe”错误)
  5. 把c:\Program Files\nanomsg\lib\nanomsg.lib 复制到 c:\nanomsg-python-master\下
  6. 路径到 c:\nanomsg-python-master
  7. python setup.py install
  8. 最后添加Path: c:\Program Files\nanomsg\bin (否则Python可能无法找到dll)
Generating code
Finished generating code
creating build\bdist.win-amd64
creating build\bdist.win-amd64\egg
creating build\bdist.win-amd64\egg\nanomsg
copying build\lib.win-amd64-3.6\nanomsg\version.py -> build\bdist.win-amd64\egg\nanomsg
copying build\lib.win-amd64-3.6\nanomsg\wrapper.py -> build\bdist.win-amd64\egg\nanomsg
copying build\lib.win-amd64-3.6\nanomsg\__init__.py -> build\bdist.win-amd64\egg\nanomsg
creating build\bdist.win-amd64\egg\nanomsg_wrappers
copying build\lib.win-amd64-3.6\nanomsg_wrappers\__init__.py -> build\bdist.win-amd64\egg\nanomsg_wrappers
copying build\lib.win-amd64-3.6\_nanomsg_cpy.cp36-win_amd64.pyd -> build\bdist.win-amd64\egg
creating build\bdist.win-amd64\egg\_nanomsg_ctypes
copying build\lib.win-amd64-3.6\_nanomsg_ctypes\__init__.py -> build\bdist.win-amd64\egg\_nanomsg_ctypes
byte-compiling build\bdist.win-amd64\egg\nanomsg\version.py to version.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\nanomsg\wrapper.py to wrapper.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\nanomsg\__init__.py to __init__.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\nanomsg_wrappers\__init__.py to __init__.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\_nanomsg_ctypes\__init__.py to __init__.cpython-36.pyc
creating stub loader for _nanomsg_cpy.cp36-win_amd64.pyd
byte-compiling build\bdist.win-amd64\egg\_nanomsg_cpy.py to _nanomsg_cpy.cpython-36.pyc
creating build\bdist.win-amd64\egg\EGG-INFO
copying nanomsg.egg-info\PKG-INFO -> build\bdist.win-amd64\egg\EGG-INFO
copying nanomsg.egg-info\SOURCES.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying nanomsg.egg-info\dependency_links.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying nanomsg.egg-info\top_level.txt -> build\bdist.win-amd64\egg\EGG-INFO
writing build\bdist.win-amd64\egg\EGG-INFO\native_libs.txt
zip_safe flag not set; analyzing archive contents...
__pycache__._nanomsg_cpy.cpython-36: module references __file__
creating dist
creating 'dist\nanomsg-1.0-py3.6-win-amd64.egg' and adding 'build\bdist.win-amd64\egg' to it
removing 'build\bdist.win-amd64\egg' (and everything under it)
Processing nanomsg-1.0-py3.6-win-amd64.egg
creating c:\python36\lib\site-packages\nanomsg-1.0-py3.6-win-amd64.egg
Extracting nanomsg-1.0-py3.6-win-amd64.egg to c:\python36\lib\site-packages
Adding nanomsg 1.0 to easy-install.pth file

Installed c:\python36\lib\site-packages\nanomsg-1.0-py3.6-win-amd64.egg
Processing dependencies for nanomsg==1.0
Finished processing dependencies for nanomsg==1.0

最后就可以在python环境中运行”hello nanomsg” 的 Example了

from nanomsg import Socket, PAIR, PUB
s1 = Socket(PAIR)
s2 = Socket(PAIR)
s1.bind('inproc://bob')
s2.connect('inproc://bob')
s1.send(b'hello nanomsg')
print(s2.recv())
s1.close()
s2.close()
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值