Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy
 

How to install smbus2 via python pip




smbus2 - smbus2 is a drop-in replacement for smbus-cffi/smbus-python in pure Python, it belongs to Classifiers:

- Development Status :: 4 - Beta
- Programming Language :: Python :: 2
- Programming Language :: Python :: 2.7
- Programming Language :: Python :: 3.1
- Programming Language :: Python :: 3.4
- Programming Language :: Python :: 3.5
- Programming Language :: Python :: 3.9
- Programming Language :: Python :: 3.10
- Topic :: Utilities

When you know about this project and you want to new install smbus2 to support your project or you get trouble as ModuleNotFoundError: No module named "smbus2" or ImportError: cannot import name "smbus2" in your project, let follow this tutorial to install smbus2



Installation:

Step 1: First, ensure you installed pip in your os, to check pip has been installed on your computer

In Windows (CMD):

py -m pip --version

In Unix/macOS:

python3 -m pip --version

Ensure pip, setuptools, and wheel are up to date:

In Windows (CMD):

py -m pip install --upgrade pip setuptools wheel

In Unix/macOS:

python3 -m pip install --upgrade pip setuptools wheel


Optional - If you want to install in virtual environment:

In Windows (CMD):

- Install virtualenv - if you installed it, please ignore

py -m pip install --user virtualenv

- Create a virtual environment

py -m venv test_smbus2_env

- Active the virtual environment

test_smbus2_env\Scripts\active

In Unix/macOS:

- Install virtualenv - if you installed it, please ignore

pip3 install virtualenv

- Create a virtual environment

python3 -m venv test_smbus2_env

- Active the virtual environment

source test_smbus2_env/bin/active


Step 2: OK, now, let flow below content to start the installation smbus2

To install smbus2 on Windows(CMD):

py -m pip install smbus2

To install smbus2 on Unix/macOs:

pip install smbus2


Step 3: If you want to install a specific smbus2 version, add ==<smbus2 version> to the end command line

Example:

pip install smbus2==0.1.0


Please see the version list below table:

VersionReleased dateCommand
smbus2 0.4.22022-06-05T07:37:36Windows:

py -m pip install smbus2==0.4.2

Unix/macOs:

pip install smbus2==0.4.2

smbus2 0.4.12021-01-17T18:56:22Windows:

py -m pip install smbus2==0.4.1

Unix/macOs:

pip install smbus2==0.4.1

smbus2 0.4.02020-12-05T17:55:31Windows:

py -m pip install smbus2==0.4.0

Unix/macOs:

pip install smbus2==0.4.0

smbus2 0.3.02019-09-07T11:19:51Windows:

py -m pip install smbus2==0.3.0

Unix/macOs:

pip install smbus2==0.3.0

smbus2 0.2.32019-01-13T12:24:19Windows:

py -m pip install smbus2==0.2.3

Unix/macOs:

pip install smbus2==0.2.3

smbus2 0.2.22019-01-03T03:58:52Windows:

py -m pip install smbus2==0.2.2

Unix/macOs:

pip install smbus2==0.2.2

smbus2 0.2.12018-06-02T16:21:29Windows:

py -m pip install smbus2==0.2.1

Unix/macOs:

pip install smbus2==0.2.1

smbus2 0.2.02017-08-19T19:54:48Windows:

py -m pip install smbus2==0.2.0

Unix/macOs:

pip install smbus2==0.2.0

smbus2 0.1.52017-05-12T21:24:49Windows:

py -m pip install smbus2==0.1.5

Unix/macOs:

pip install smbus2==0.1.5

smbus2 0.1.42016-09-18T10:34:53Windows:

py -m pip install smbus2==0.1.4

Unix/macOs:

pip install smbus2==0.1.4

smbus2 0.1.32016-08-14T12:16:50Windows:

py -m pip install smbus2==0.1.3

Unix/macOs:

pip install smbus2==0.1.3

smbus2 0.1.22016-04-19T18:15:59Windows:

py -m pip install smbus2==0.1.2

Unix/macOs:

pip install smbus2==0.1.2

smbus2 0.1.12016-04-19T18:15:07Windows:

py -m pip install smbus2==0.1.1

Unix/macOs:

pip install smbus2==0.1.1

smbus2 0.1.02016-04-04T01:53:33Windows:

py -m pip install smbus2==0.1.0

Unix/macOs:

pip install smbus2==0.1.0


Step 4: Otherwise, you can install smbus2 from local archives:

Download the distribution file from smbus2-0.4.2.tar.gz or the specific smbus2 version in the below list of distribution

After that, install by command:

On Windows(CMD):

py -m pip install <path_to_smbus2_downloaded_file>

On Unix/macOs:

pip install <path_to_smbus2_downloaded_file>


List distribution:


Project link:

- Homepage