4

I have to communate python with aurdino for this I am trying to install package pybluex but always it gave this error

  LINK : fatal error LNK1181: cannot open input file 'Irprops.lib'
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.26.28801\\bin\\HostX86\\x86\\link.exe' failed with exit status 1181
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\SHEKHA~1\\AppData\\Local\\Temp\\pycharm-packaging\\PyBluez\\setup.py'"'"'; __file__='"'"'C:\\Users\\SHEKHA~1\\AppData\\Local\\Temp\\pycharm-packaging\\PyBluez\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\shekhani laptop\AppData\Local\Temp\pip-record-ku9uo755\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Python38-32\Include\PyBluez' Check the logs for full command output.
Humayun Ahmad Rajib
  • 1,502
  • 1
  • 10
  • 22
Engr Talha
  • 41
  • 1
  • 5
  • Raymond Chen has an entry on it https://devblogs.microsoft.com/oldnewthing/20190516-00/?p=102498 – dacabdi Apr 16 '21 at 05:38

3 Answers3

5

In my case I noticed that the Windows SDK version didn't have the 'irprops.lib' as it has been replaced according to: https://blogs.windows.com/windowsdeveloper/2019/11/19/windows-10-sdk-preview-build-19023-available-now/

Removal of IRPROPS.LIB

In this release irprops.lib has been removed from the Windows SDK. Apps that were linking against irprops.lib can switch to bthprops.lib as a drop-in replacement.

To solve it I installed a previous version of the Windows 10 SDK. If I had more time I probably would try to update the dependency to bthprops.lib ;)

Talk2
  • 151
  • 3
1

This is now fixed in the github repo but it looks like they haven't updated the pip package. installing from the repo directly worked without having to downgrade

zeitoon
  • 330
  • 1
  • 2
  • 10
  • 1
    THeir repo still has the outdated file irprops.lib being referenced in setup.py so it does not directly work. You need to edit the setup.py, which is easy, but you have to, or it will not build, unless you happen to have that old irprops.lib file on your old computer. Newer windows computers dont have it. – Geoffrey Anderson Aug 12 '21 at 19:49
0
  • I installed VS Code onto my windows 10 box.

  • I downloaded and installed in a separate step, the MS VS 10 build library. (It is big.)

  • Download the pybluez zip file from their github, and unzip it. Dont use pip to install it because pybluez's setup.py is now wrong (outdated).

  • Change pybluez library's setup.py file to say bthprops.lib because irprops.lib does not exist any more. (You can have your file editor search in the file for props.lib for convenience.)

  • I activated my projects python virtual environment.

  • At command line, in the new directory you extracted the lib to, run the usual python installation command for libraries: python setup.py install

This is what actually got it working here. The key it turns out, is to hand-modify the setup.py file, which you only can do by first downloading the zip file of pybluez, which contains a setup.py file that you can modify, instead of using pip, which you can't modify the setup.py file that's in there.

Geoffrey Anderson
  • 1,534
  • 17
  • 25
  • Looks like there is an issue recently opened about this, you might want to submit your fix as a pull request: https://github.com/pybluez/pybluez/issues/408 – zeitoon Aug 14 '21 at 19:03