1

While Installing smbus The Same error kept occuring which was [WinError 2] The system cannot find the file specified i am using python 3.7 and i am wondering why this error is occuring to install it i am using the command: py -3.7 -m pip install smbus

does anyone have a fix for the error message ?

7
  • Could you please provide the full pip output & traceback (e.g. on a paste site)? Commented Jul 18, 2023 at 23:23
  • BTW smbus looks like a linux specific package? Commented Jul 18, 2023 at 23:24
  • Please provide enough code so others can better understand or reproduce the problem. Commented Jul 19, 2023 at 6:04
  • 1
    pastebin.com/7tbvqvcM Commented Jul 19, 2023 at 9:23
  • 1
    @mara004 I read that much. I'm left wondering how they're connecting an i2c LCD to their Windows machine, for instance. Hence my question. Commented Jul 19, 2023 at 14:21

1 Answer 1

0

To my understanding you simply cannot use smbus on Windows.

The smbus pypi page points to this linux kernel site [^1] as homepage, which then refers to a git repository with a subfolder py-smbus/.

Your linked install log tells us pip calls the package's setup.py, which tries to build a binary extension, which does not work on windows since the referenced C extension smbusmodule.c requires linux headers rsp. linux-only libraries (i2c).

Why did you want to install smbus on Windows in the first place? Are you sure you have the right package name? Or is it a dependency of some other library/tool you want to use? smbus itself seems to be something very low-level and barely documented, and has received very few commits for almost a decade.

[^1]: which BTW is marked as obsolete

Sign up to request clarification or add additional context in comments.

3 Comments

There's a library I was trying to use called LiquidCrsyal i2c, which needed smbus to run, I thought at the time it was for windows as I couldn't find anywhere that declared the os that it's for. Is there any alternative library that works with communication with an i2c Lcd?
Are you referring to github.com/pl31/python-liquidcrystal_i2c? If so, it actually requires pysmbus (a different package, but also imported as smbus), which claims to be a pure python implementation of smbus communication.
Wait, though. Looking at pysmbus code, it posix-opens a /dev/... path. That also smells linux only. (Python's posix module is only available on unix-like systems.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.