python - TFTPy 导入,没有名为 tftpy 的模块

标签 python pip python-import importerror

我使用 pip 和 pip3 安装了 TFTPy。 然后我按照 TFTPy 文档上的示例进行操作,如下所示:

import tftpy

server = tftpy.TftpServer('/tftpboot')
server.listen('0.0.0.0', 69) 

但我收到错误

ImportError: No module named tftpy

我还尝试使用from tftpy import tftpy。我尝试使用 Python 2、Python 2.7 和 Python 3,但仍然遇到相同的错误。

感谢所有帮助

最佳答案

您可以使用命令pip install tftpy来安装tftpy。如果您的设备上没有 pip,请使用以下命令:

yum -y install python-pip
pip install --upgrade pip
pip install tftpy

关于python - TFTPy 导入,没有名为 tftpy 的模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52513626/

相关文章:

python - 为什么 PyObject* 可以指向 python 中的任何对象?

python - 从 HTTPie 的请求中删除默认的 HTTP header

python-3.x - pip 安装成功后,aws cli 无法在 Jupyter 中工作?

python - 为什么一个 __import__ 语句会影响下一个语句的有效性?

python - 为什么 Django 日志记录会跳过日志条目?

python - Dataframe 使用当前列值选择特定列的所有空行

python - 使用 pip 安装 tweepy 模块

python - 使用调试 Python 安装在 Windows 上构建 Python-C-Extension

python-3.x - python 导入作为变量名

python - 哪个是处理 ImportError - 引发错误或导入链的更好方法?