Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't install via pip on Windows #11

Closed
samstreak opened this issue Dec 11, 2018 · 6 comments
Closed

Can't install via pip on Windows #11

samstreak opened this issue Dec 11, 2018 · 6 comments

Comments

@samstreak
Copy link

Received error:

error: Microsoft Visual C++ 9.0 is required. Get it from http://aka.ms/vcpython27

installed from that location and tried again, continued slightly further but got another error:

src/arpreq.c(3) : fatal error C1083: Cannot open include file: 'stdbool.h': No such file or directory

after some searching in Google, found this message and several other similar .h file errors pointing to header files that are for *nix not for Win32/64. I tried creating blank files for all the subsequent error'ing .h missing files and ended up with many other errors:

src/arpreq.c(42) : error C2054: expected '(' to follow 'inline'
src/arpreq.c(44) : error C2085: 'mac_to_string' : not in formal parameter list
src/arpreq.c(44) : error C2143: syntax error : missing ';' before '{'
src/arpreq.c(62) : error C2054: expected '(' to follow 'inline'
src/arpreq.c(63) : error C2085: 'address_from_long' : not in formal parameter list
src/arpreq.c(63) : error C2143: syntax error : missing ';' before '{'
src/arpreq.c(84) : error C2054: expected '(' to follow 'inline'
src/arpreq.c(85) : error C2085: 'address_from_bytes' : not in formal parameter list
src/arpreq.c(85) : error C2143: syntax error : missing ';' before '{'
src/arpreq.c(102) : error C2054: expected '(' to follow 'inline'
src/arpreq.c(103) : error C2085: 'address_from_unicode' : not in formal parameter list
src/arpreq.c(103) : error C2143: syntax error : missing ';' before '{'
src/arpreq.c(117) : error C2054: expected '(' to follow 'inline'
src/arpreq.c(118) : error C2085: 'coerce_argument' : not in formal parameter list
src/arpreq.c(118) : error C2143: syntax error : missing ';' before '{'
src/arpreq.c(179) : error C2079: 'ip_address' uses undefined struct 'sockaddr_in'
src/arpreq.c(181) : error C2224: left of '.sin_family' must have struct/union type
src/arpreq.c(181) : error C2065: 'AF_INET' : undeclared identifier
src/arpreq.c(182) : warning C4013: 'coerce_argument' undefined; assuming extern returning int
src/arpreq.c(182) : error C2224: left of '.sin_addr' must have struct/union type
src/arpreq.c(186) : error C2065: 'uint32_t' : undeclared identifier
src/arpreq.c(186) : error C2146: syntax error : missing ';' before identifier 'addr'
src/arpreq.c(186) : error C2065: 'addr' : undeclared identifier
src/arpreq.c(186) : error C2224: left of '.sin_addr' must have struct/union type

etc (there were many more than that)...

Clearly this isn't the right way to work around the system for a Windows build, so any other guidance for a python/pip novice?

@samstreak
Copy link
Author

After further investigation, arpreq apparently isn't supported under Windows, so any way you can use some other method to get the host up-state before trying to connect?

@scrool
Copy link
Owner

scrool commented Dec 12, 2018

Arpreq is used only with discovery. you can completely skip discovery by using --hostname:

$ xled --hostname 192.168.1.4 on

@samstreak
Copy link
Author

xled will no longer install via pip due to the issue with arpreq. Do I then install it via some other method?

@scrool
Copy link
Owner

scrool commented Dec 12, 2018

I'm not really using Windows but I guess you could git clone/download sources, manually remove arpreq from setup.py and run python setup.py install.

@scrool
Copy link
Owner

scrool commented Dec 12, 2018

I have tried to do so - remove arpreq dependency on Windows and it turned out discovery imported all over the place so the change won't be so easy.

I have thought about this and I'm afraid I can only support Linux as that's where I develop and run this project. I'm sorry but unless somebody will be able to support Windows platform I won't support it.

@scrool scrool closed this as completed Dec 12, 2018
scrool added a commit that referenced this issue Dec 12, 2018
- One of discover dependencies - arpreq - is not available on Windows.
- I have tested this only on Linux so let's start with minimum.

Fixes: #11
@githubprince
Copy link

Hi @samstreak ,

As scrool mentioned, you need to clone the project, then you should just modify 2 things:

  1. in setup.py under requirements change "arpreq" to "getmac"
  2. in discover.py replace 'from arpreq import arpreq' with 'from getmac import get_mac_address' and 'hw_address = arpreq(ip_address)' with 'hw_address = get_mac_address(ip_address)'

Then install the project from you local clone.
cd your-local-repo
pip install -e .

I hope it helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants