python - Trying to setup nfcpy, Returns "ModuleNotFoundError: No module named 'ndef'"
问题描述
I am trying to setup a PN532_NFC_HAT on a Raspberry Pi with nfcpy but I am having problems with modules.
What I have done so far:
I have installed nfcpy on my Raspberry Pi by simply doing this in the terminal.
$ pip install -U nfcpy
And I have verified the installation with this command
$ python -m nfc --search-tty
And so far it works, nfcpy can find my NFC Reader
Then I have cloned the examples from github with the command
pi@raspberrypi: git clone https://github.com/nfcpy/nfcpy.git
and entered the examples-folder
pi@raspberrypi:~/nfcpy/examples $
What happens:
nfcpy has some example programs but when I try to run them they return various errors.
If I for an example run this command on one of the examples, Tagtool.py
python3 tagtool.py
I get this
Traceback (most recent call last):
File "tagtool.py", line 29, in <module>
import ndef
ModuleNotFoundError: No module named 'ndef'
Other examples return errors about not finding the module named nfc.
What am I doing wrong?
解决方案
推荐阅读
- javascript - 将条件 CSS 应用于 Vue
- database - Avoiding duplicates in a reflexive many to many relationship where direction is irrelevant
- php - comparison of datetime value and system date time fails
- c# - EF add isn't adding to database
- node.js - NodeJS邮件解析器没有被执行
- mysql - 在 Ubuntu 18.04 上更改 Mysql 数据目录的问题
- r - R 添加一个新列并使用基于多个条件的字符串值填充它
- c# - 是否可以使用 DocumentFormat.OpenXML c# 将 docx 书签内的文本复制到具有 f=same 格式的新文档?
- c++ - Getting the caller's Return Address
- sql - 添加 2 个字段条件无法准确运行的条件