hadiasghari / pyasn

Python IP address to Autonomous System Number lookup module. (Supports fast local lookups, and historical lookups using archived BGP dumps.)
Other
292 stars 72 forks source link

failed install on windows 10 #58

Open randomgambit opened 6 years ago

randomgambit commented 6 years ago

Hello!

I tried to install the package on my computer, but the install fails


(base) C:\Users\john\Documents\packages\dist\pyasn-1.6.0b1>python setup.py build
running build
running build_py
creating build
creating build\lib.win-amd64-2.7
creating build\lib.win-amd64-2.7\pyasn
copying pyasn\mrtx.py -> build\lib.win-amd64-2.7\pyasn
copying pyasn\_version.py -> build\lib.win-amd64-2.7\pyasn
copying pyasn\__init__.py -> build\lib.win-amd64-2.7\pyasn
running build_ext
building 'pyasn.pyasn_radix' extension
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
creating build\temp.win-amd64-2.7\Release\pyasn
creating build\temp.win-amd64-2.7\Release\pyasn\_radix
C:\Users\john\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Users\john\Documents\packages\dist\pyasn-1.6.0b1\pyasn -IC:\Users\john\Anaconda2\include -IC:\Users\john\Anaconda2\PC /Tcpyasn/pyasn_radix.c /Fobuild\temp.win-amd64-2.7\Release\pyasn/pyasn_radix.obj
pyasn_radix.c
pyasn/pyasn_radix.c(662) : error C2143: syntax error : missing ';' before 'type'
pyasn/pyasn_radix.c(663) : error C2065: 'buf' : undeclared identifier
pyasn/pyasn_radix.c(663) : warning C4047: 'function' : 'char *' differs in levels of indirection from 'int'
pyasn/pyasn_radix.c(663) : warning C4024: 'fgets' : different types for formal and actual parameter 1
pyasn/pyasn_radix.c(665) : error C2065: 'buf' : undeclared identifier
pyasn/pyasn_radix.c(665) : error C2109: subscript requires array or pointer type
pyasn/pyasn_radix.c(665) : error C2065: 'buf' : undeclared identifier
pyasn/pyasn_radix.c(665) : error C2109: subscript requires array or pointer type
pyasn/pyasn_radix.c(665) : error C2065: 'buf' : undeclared identifier
pyasn/pyasn_radix.c(665) : error C2109: subscript requires array or pointer type
pyasn/pyasn_radix.c(665) : error C2065: 'buf' : undeclared identifier
pyasn/pyasn_radix.c(665) : error C2109: subscript requires array or pointer type
pyasn/pyasn_radix.c(668) : error C2065: 'p1' : undeclared identifier
pyasn/pyasn_radix.c(668) : error C2065: 'buf' : undeclared identifier
pyasn/pyasn_radix.c(668) : warning C4047: 'function' : 'const char *' differs in levels of indirection from 'int'
pyasn/pyasn_radix.c(668) : warning C4024: 'strchr' : different types for formal and actual parameter 1
pyasn/pyasn_radix.c(668) : warning C4047: '=' : 'int' differs in levels of indirection from 'char *'
pyasn/pyasn_radix.c(668) : warning C4047: '==' : 'int' differs in levels of indirection from 'void *'
pyasn/pyasn_radix.c(668) : error C2065: 'p2' : undeclared identifier
pyasn/pyasn_radix.c(668) : error C2065: 'buf' : undeclared identifier
pyasn/pyasn_radix.c(668) : warning C4047: 'function' : 'const char *' differs in levels of indirection from 'int'
pyasn/pyasn_radix.c(668) : warning C4024: 'strchr' : different types for formal and actual parameter 1
pyasn/pyasn_radix.c(668) : warning C4047: '=' : 'int' differs in levels of indirection from 'char *'
pyasn/pyasn_radix.c(668) : warning C4047: '==' : 'int' differs in levels of indirection from 'void *'
pyasn/pyasn_radix.c(668) : error C2065: 'p2' : undeclared identifier
pyasn/pyasn_radix.c(668) : error C2065: 'p1' : undeclared identifier
pyasn/pyasn_radix.c(671) : error C2065: 'p1' : undeclared identifier
pyasn/pyasn_radix.c(671) : error C2100: illegal indirection
pyasn/pyasn_radix.c(671) : error C2065: 'p2' : undeclared identifier
pyasn/pyasn_radix.c(671) : error C2100: illegal indirection
pyasn/pyasn_radix.c(671) : error C2106: '=' : left operand must be l-value
pyasn/pyasn_radix.c(671) : error C2106: '=' : left operand must be l-value
pyasn/pyasn_radix.c(673) : error C2065: 'p1' : undeclared identifier
pyasn/pyasn_radix.c(673) : warning C4047: 'function' : 'const char *' differs in levels of indirection from 'int'
pyasn/pyasn_radix.c(673) : warning C4024: 'atol' : different types for formal and actual parameter 1
pyasn/pyasn_radix.c(673) : error C2065: 'p2' : undeclared identifier
pyasn/pyasn_radix.c(673) : warning C4047: 'function' : 'const char *' differs in levels of indirection from 'int'
pyasn/pyasn_radix.c(673) : warning C4024: 'atoi' : different types for formal and actual parameter 1
pyasn/pyasn_radix.c(673) : error C2065: 'buf' : undeclared identifier
pyasn/pyasn_radix.c(673) : warning C4047: 'function' : 'const char *' differs in levels of indirection from 'int'
pyasn/pyasn_radix.c(673) : warning C4024: 'add_pyobject_to_radix_tree' : different types for formal and actual parameter 4
pyasn/pyasn_radix.c(713) : warning C4267: 'function' : conversion from 'size_t' to 'long', possible loss of data
error: command 'C:\\Users\\john\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2

I am using the latest anaconda distrib and I believe I have installed all the prerequisites... Do you have any ideas?

Thanks!!

hadiasghari commented 6 years ago

@randomgambit I don't have a Windows machine at this moment so I'm not sure. The errors are strange and makes me wonder about whether VS version is compatible. But I cannot help more. (Also I'd appreciate if you keep your questions centralized and for instance merge this and #57).

The compiling on Windows relates closely to issues #20/#25:

I wonder if @sebix/@dmth evenetually made a version of the library with the python-radix module (instead of the current C radix module thus taking away the need to compile anything)?

ghost commented 6 years ago

I wonder if @sebix/@dmth evenetually made a version of the library with the python-radix module (instead of the current C radix module thus taking away the need to compile anything)?

No.

py-radix also has a c backend but it is optional (although recommended): https://github.com/mjschultz/py-radix/issues/39#issuecomment-400726355

Beside from py-radix there's also pytricia.

randomgambit commented 6 years ago

@hadiasghari @wagner-certat damn... that makes the availability of a python wheel even more critical. I really want to use this package, but so have I am not even able to install it... any ideas? Thanks again!

randomgambit commented 6 years ago

hello @hadiasghari , just following up on this previous discussion. Any hope that you could provide a wheel or a windows binaries like the ones here (https://www.lfd.uci.edu/~gohlke/pythonlibs/)

Right now I simply cant even install your package....

thanks!

randomgambit commented 6 years ago

haha wait I say that and now I see pyasn referenced on this website!! yay!! did you do anything?

hadiasghari commented 6 years ago

@randomgambit I didn't create them since I don't have a Windows machine at the moment. Please tell me if they work so I can add the link to the README file for others.

randomgambit commented 6 years ago

yes, I tried yesterday and they seem to work! While you re at it, you could also add that the additional utils are in /Users/Anaconda/Scripts ... However, I was not able to make the get_asn_name script to work. Perhaps you could reference that on the README as well (`get_asn_name is only mentioned here and there in ... the issues)

Thanks!!!

hadiasghari commented 4 years ago

Hi @randomgambit, are you still using pyasn? Could you do a PR on the changes you made so I can merge them? I am going to do a new release soon, thanks

hadiasghari commented 2 weeks ago

BTW, has anyone tried this recently on newer versions of Windows and Python?