ModuleNotFoundError:没有名为“hotshot”的模块

2024-06-28 23:44:52 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试将python2.7代码移植到python3.7代码

我在一个文件中看到一个“导入热镜头”,但是

ModuleNotFoundError: No module named 'hotshot'

我在网上找不到那个模块。这是一个python2.7特定的包被替换成其他包吗?我和cStringIO有过那个案子

附加信息:这是在Django项目中实现的。也许是老的Django lib?我正在尝试将此代码从django1.8移植到2.2

我想做的是: -pip install—升级hotshot

No matching distribution found for hotshot

在Python包索引上查找hotshot

No library with that name

它是用来做什么的?唯一使用它的行是

prof = hotshot.Profile(final_log_file)

整个项目代码可从以下位置获得: https://github.com/EbookFoundation/fef-questionnaire, 使用“hotshot”的文件是探查器.py". 另外,没有“hotshot.py“在整个项目中归档。在


Tags: 模块文件项目djangono代码pynamed
1条回答
网友
1楼 · 发布于 2024-06-28 23:44:52

终于找到了一些东西。hotshot是一个Python分析器(https://docs.python.org/2/library/profile.html

https://docs.python.org/2/library/hotshot.html

hotshot was an experimental C module that focused on minimizing the overhead of profiling, at the expense of longer data post-processing times. It is no longer maintained and may be dropped in a future version of Python.

我只需将hotshot替换为与Python 3兼容的更新的Python profiler: https://docs.python.org/3/library/profile.html

所以profile或{}。在

相关问题 更多 >