简体   繁体   English

Pybluex python 蓝牙模块安装报错 pycharm

[英]Pybluex python bluetooth module installation error error in pycharm

I have to communate python with aurdino for this I am trying to install package pybluex but always it gave this error为此,我必须将 python 与pybluex进行交流

  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.

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/ 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删除 IRPROPS.LIB

In this release irprops.lib has been removed from the Windows SDK.在此版本中,irprops.lib 已从 Windows SDK 中删除。 Apps that were linking against irprops.lib can switch to bthprops.lib as a drop-in replacement.链接到 irprops.lib 的应用程序可以切换到 bthprops.lib 作为替代品。

To solve it I installed a previous version of the Windows 10 SDK.为了解决这个问题,我安装了以前版本的 Windows 10 SDK。 If I had more time I probably would try to update the dependency to bthprops.lib;)如果我有更多时间,我可能会尝试将依赖项更新为 bthprops.lib;)

This is now fixed in the github repo but it looks like they haven't updated the pip package.这现在已在github 存储库中修复,但看起来他们尚未更新 pip package。 installing from the repo directly worked without having to downgrade从 repo 直接安装,无需降级

  • I installed VS Code onto my windows 10 box.我将 VS Code 安装到我的 windows 10 盒子上。

  • I downloaded and installed in a separate step, the MS VS 10 build library.我在单独的步骤中下载并安装了 MS VS 10 构建库。 (It is big.) (它很大。)

  • Download the pybluez zip file from their github, and unzip it.从他们的 github 下载 pybluez zip 文件,然后解压缩。 Dont use pip to install it because pybluez's setup.py is now wrong (outdated).不要使用 pip 来安装它,因为 pybluez 的 setup.py 现在是错误的(过时的)。

  • Change pybluez library's setup.py file to say bthprops.lib because irprops.lib does not exist any more.将 pybluez 库的 setup.py 文件更改为 bthprops.lib 因为 irprops.lib 不再存在。 (You can have your file editor search in the file for props.lib for convenience.) (为方便起见,您可以让文件编辑器在文件中搜索 props.lib。)

  • I activated my projects python virtual environment.我激活了我的项目 python 虚拟环境。

  • At command line, in the new directory you extracted the lib to, run the usual python installation command for libraries: python setup.py install在命令行中,在您将 lib 解压缩到的新目录中,运行通常的 python 库安装命令: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.事实证明,关键是手动修改 setup.py 文件,您只能通过首先下载 pybluez 的 zip 文件来完成此操作,其中包含您可以修改的 setup.py 文件,而不是使用 pip,您无法修改其中的 setup.py 文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM