Skip to content

Commit 50fe222

Browse files
Add updated PyPi and example install instructions
1 parent 2cd39b5 commit 50fe222

File tree

1 file changed

+21
-28
lines changed

1 file changed

+21
-28
lines changed

README.md

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -50,43 +50,24 @@ The first step to using this package is installing it on your system. The instal
5050

5151
### Python
5252

53-
The package is primarily installed using the `pip` command, downloading the package from the Python Index - "PyPi". Note - the below instructions outline installation an Linux-based (Raspberry Pi) system.
54-
5553
#### PyPi Installation
54+
The package is primarily installed using the `pip3` command, downloading the package from the Python Index - "PyPi".
5655

57-
The SparkFun Qwiic Keypad Python package is part of the overall SparkFun Qwiic Python package which is hosted on PyPi. On systems that support PyPi installation via pip, this library is installed using the following commands
56+
Note - the below instructions outline installation an Linux-based (Raspberry Pi) system.
5857

59-
For all users (note: the user must have sudo privileges):
58+
First, setup a virtual environment from a specific directory using venv:
6059
```sh
61-
sudo pip install sparkfun-qwiic
60+
python3 -m venv path/to/venv
6261
```
63-
For the current user:
62+
You can pass any path as path/to/venv, just make sure you use the same one for all future steps. For more information on venv [click here](https://docs.python.org/3/library/venv.html).
6463

64+
Next, install the qwiic package with:
6565
```sh
66-
pip install sparkfun-qwiic
67-
```
68-
---
69-
---
70-
> [!CAUTION]
71-
> **TODO** Put together how this works with the new virtual environments used with the latest Python install
72-
---
73-
---
74-
#### Local Installation
75-
To install, make sure the setuptools package is installed on the system.
76-
77-
Direct installation at the command line:
78-
```sh
79-
python setup.py install
66+
path/to/venv/bin/pip3 install sparkfun-qwiic-keypad
8067
```
81-
82-
To build a package for use with pip:
83-
```sh
84-
python setup.py sdist
85-
```
86-
A package file is built and placed in a subdirectory called dist. This package file can be installed using pip.
68+
Now you should be able to run any example or custom python scripts that have `import qwiic_keypad` by running e.g.:
8769
```sh
88-
cd dist
89-
pip install sparkfun_qwiic_keypad-<version>.tar.gz
70+
path/to/venv/bin/python3 example_script.py
9071
```
9172

9273
### MicroPython Installation
@@ -97,6 +78,11 @@ Connect a device with MicroPython installed to your computer and then install th
9778
mpremote mip install github:sparkfun/qwiic_keypad_py
9879
```
9980

81+
If you would also like to install the examples for this repository, issue the following mip command as well:
82+
```sh
83+
mprmeote mip install github:sparkfun/qwiic_keypad_py@examples
84+
```
85+
10086
### CircuitPython Installation
10187
If not already installed, follow the [instructions here](https://docs.circuitpython.org/projects/circup/en/latest/#installation) to install CircUp on your computer.
10288

@@ -110,6 +96,13 @@ Finally, connect a device with CircuitPython installed to your computer and then
11096
circup install --py qwiic_keypad
11197
```
11298

99+
If you would like to install any of the examples from this repository, issue the corresponding circup command from below. (NOTE: The below syntax assumes you are using CircUp on Windows. Linux and Mac will have different path seperators (i.e. "/" vs. "\"). See the [CircUp "example" command documentation](https://learn.adafruit.com/keep-your-circuitpython-libraries-on-devices-up-to-date-with-circup/example-command) for more information)
100+
```sh
101+
circup example qwiic_keypad\qwiic_keypad_ex1.py
102+
circup example qwiic_keypad\qwiic_keypad_ex2.py
103+
circup example qwiic_keypad\qwiic_keypad_ex3.py
104+
```
105+
113106
Example Use
114107
---------------
115108
Below is a quickstart program to print which button was pressed or a space if '*' is pressed and a newline if '#' is pressed.

0 commit comments

Comments
 (0)