Skip to content
This repository has been archived by the owner on Sep 27, 2021. It is now read-only.

windows install #52

Open
raidsan opened this issue Feb 13, 2018 · 8 comments
Open

windows install #52

raidsan opened this issue Feb 13, 2018 · 8 comments

Comments

@raidsan
Copy link

raidsan commented Feb 13, 2018

I have installed nanomsg at:
C:\Program Files (x86)\nanomsg

but when I run pip insall nnpy
or in git clone directory run python setup.py,
I got error:

WindowsError: [Error 3] : '/usr/local/include/nanomsg/.'

@raidsan
Copy link
Author

raidsan commented Feb 13, 2018

I edit the generate.py, add lines:

import platform
if platform.system()=="Windows":
DEFAULT_INCLUDE_DIRS = r'C:\Program Files (x86)\nanomsg\include'
DEFAULT_HOST_LIBRARY = r'C:\Program Files (x86)\nanomsg\bin\nanomsg.dll'

rerun setup.py, and I got following error:

D:\project\OpenSource\nnpy>python setup.py
Traceback (most recent call last):
File "setup.py", line 28, in
install_requires=['cffi'],
File "D:\Anaconda3\envs\py27_32\lib\site-packages\setuptools_init_.py", line 129, in setup
return distutils.core.setup(**attrs)
File "D:\Anaconda3\envs\py27_32\lib\distutils\core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "D:\Anaconda3\envs\py27_32\lib\site-packages\setuptools\dist.py", line 333, in init
_Distribution.init(self, attrs)
File "D:\Anaconda3\envs\py27_32\lib\distutils\dist.py", line 287, in init
self.finalize_options()
File "D:\Anaconda3\envs\py27_32\lib\site-packages\setuptools\dist.py", line 476, in finalize_options
ep.load()(self, ep.name, value)
File "d:\project\opensource\nnpy.eggs\cffi-1.11.4-py2.7-win32.egg\cffi\setuptools_ext.py", line 193, in cffi_modules
add_cffi_module(dist, cffi_module)
File "d:\project\opensource\nnpy.eggs\cffi-1.11.4-py2.7-win32.egg\cffi\setuptools_ext.py", line 49, in add_cffi_module
execfile(build_file_name, mod_vars)
File "d:\project\opensource\nnpy.eggs\cffi-1.11.4-py2.7-win32.egg\cffi\setuptools_ext.py", line 25, in execfile
exec(code, glob, glob)
File "generate.py", line 127, in
ffi = create_module()
File "generate.py", line 123, in create_module
f.write(symbols(ffi, host_library))
File "generate.py", line 69, in symbols
name = nanomsg.nn_symbol(i, val)
File "d:\project\opensource\nnpy.eggs\cffi-1.11.4-py2.7-win32.egg\cffi\api.py", line 875, in getattr
make_accessor(name)
File "d:\project\opensource\nnpy.eggs\cffi-1.11.4-py2.7-win32.egg\cffi\api.py", line 870, in make_accessor
raise AttributeError(name)
AttributeError: nn_symbol

@djc
Copy link
Member

djc commented Feb 13, 2018

Maybe have a look at #44?

@tannn tannn mentioned this issue Apr 22, 2018
@apatti
Copy link

apatti commented Jul 13, 2018

When i tried to install nnpy on windows i get following error:
OSError: cannot load library C:\Program Files\nanomsg\bin\nanomsg.dll: error 0xc1

@djc
Copy link
Member

djc commented Jul 13, 2018

I don't have a way of figuring that problem out, so I'm afraid you'll be on your own.

@apatti
Copy link

apatti commented Jul 13, 2018

I was able to resolve the 0xC1 issue but now facing following error:

AttributeError: nn_symbol

@djc
Copy link
Member

djc commented Jul 14, 2018

That sounds like you're using nng (maybe with the nanomsg compatibility layer), which as far as I know does not actually implement nn_symbol().

@neutrinoyu
Copy link

Try to solve this. Replace generate.py with this https://github.com/neutrinoyu/nnpy-win/blob/master/generate.py
I hope this may help you

@raidsan
Copy link
Author

raidsan commented Jul 21, 2018

thanks neutrinoyu , it works! my python version is 64bit Anaconda3,
so I rebuild nanomsg under vs2017 x64 command prompt,
and use compile option: cmake -G "Visual Studio 15 2017 Win64" ..
and get installed result: C:/Program Files/nanomsg/bin/nanomsg.dll
replace generate.py, run: python setup.py install
everything is ok now.

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