Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5240

HATs and other add-ons • Re: Error: no module named pa1010d (The Pi Hut GPS module)

$
0
0

However, I am stuck again.
My program still does not run and again issues the same error:

Code:

ModuleNotFoundError: No module named pa1010d


There is no context for that error message. We are not there to see what you did.

Please show the steps leading up to the point where you run

Code:

python <rds_gps_script>.py


Is that because I need to run my program in a different folder?
No.

But you DO need to execute your script with the python interpreter installed in the virtual environment you have created. Simplistically, that means you need to have activated the venv so that the shell prompt will begin something like

Code:

(<pa1010_venv_name>) <RDS_id>@<RDS_hostname>:


Worked example follows, showing a sample script failing and then subsequently working..

Code:

david@rp58book101064fnvme:~/Support/RDS $ cat rds_gps_test.py from pa1010d import PA1010Dprint("Imported pa1010d module withou error.")david@rp58book101064fnvme:~/Support/RDS $ which python/usr/bin/pythondavid@rp58book101064fnvme:~/Support/RDS $ python rds_gps_test.py Traceback (most recent call last):  File "/home/david/Support/RDS/rds_gps_test.py", line 1, in <module>    from pa1010d import PA1010DModuleNotFoundError: No module named 'pa1010d'david@rp58book101064fnvme:~/Support/RDS $ source pa1010/bin/activate(pa1010) david@rp58book101064fnvme:~/Support/RDS $ which python/home/david/Support/RDS/pa1010/bin/python(pa1010) david@rp58book101064fnvme:~/Support/RDS $ python rds_gps_test.py Imported pa1010d module withou error.(pa1010) david@rp58book101064fnvme:~/Support/RDS $ (pa1010) david@rp58book101064fnvme:~/Support/RDS $ 

Statistics: Posted by B.Goode — Sat Nov 16, 2024 8:23 am



Viewing all articles
Browse latest Browse all 5240

Trending Articles