Installing Python packages

Trying to setup the Qwiic Twist on a Pi Zero W.

I have had the Twist working on an Arduino in the past.

This is the first time I’ve setup hardware on a pi.

Starting at the Qwiic Twist page I follow the github links

Sparkfun/Qwiic_Twist_Py → Sparkfun/Qwiic_Py → sparkfun/Qwiic_I2C_Py

I am working from /home/pi

Following directions at https://github.com/sparkfun/Qwiic_I2C_Py

pip install setuptools (All ready installed)

pip install smbus

sudo pip install sparkfun-qwiic-i2c

At the command

python setup.py install

I get the error:

python: can’t open file ‘/home/pi/setup.py’: [Errno 2] No such file or directory

setup.py is located on the pi

/usr/lib/python3/dist-packages/numpy/linalg/setup.py

and other locations under /usr/lib/python3/dist-packages.

Thanks for the help.

It looks like you’re trying to run setup.py it from the root directory (‘/home/pi/setup.py’); either add the full file path or navigate to the directory where it is and re-try

Thank you, you are correct, if I specify the path setup.py will run but I get errors when I try different ones.

pi@metar:~ $ python /usr/lib/python3/dist-packages/numpy/core/setup.py install

Traceback (most recent call last):

File “/usr/lib/python3/dist-packages/numpy/core/setup.py”, line 13, in

from numpy._build_utils.apple_accelerate import (

ModuleNotFoundError: No module named ‘numpy._build_utils’

Where should I be running the installs from?

Got it working.

I think I was running the install and then setup.py

from the wrong directories.

Started over

Instructions located at https://github.com/sparkfun/Qwiic_Twist_Py/tree/main

sudo apt update

sudo apt install git

From / NOT /home/pi

sudo git clone https://github.com/sparkfun/Qwiic_Py

git clone --recurse-submodules https://github.com/sparkfun/Qwiic_Py.git

This did not work, the above command downloaded files into the directions

sudo pip install sparkfun-qwiic

cd/Qwiic_I2C_Py

python setup.py install

Now Qwiic_Twist_Py

located at https://github.com/sparkfun/Qwiic_Twist_Py/tree/main

cd / # back to root

sudo pip install sparkfun-qwiic-twist

I did not have to run setup.py again