如何配置AmazonEC2实例以支持python分析器?

如何配置AmazonEC2实例以支持python分析器?,python,amazon-web-services,Python,Amazon Web Services,我有AWS EC2实例在运行,python分析器在那里被破坏了 Traceback (most recent call last): File "test.py", line 6, in <module> cProfile.run("test()") File "/usr/lib/python2.6/cProfile.py", line 36, in run result = prof.print_stats(sort) File "/usr/lib/pyth

我有AWS EC2实例在运行,python分析器在那里被破坏了

Traceback (most recent call last):
  File "test.py", line 6, in <module>
  cProfile.run("test()")
  File "/usr/lib/python2.6/cProfile.py", line 36, in run
    result = prof.print_stats(sort)
  File "/usr/lib/python2.6/cProfile.py", line 80, in print_stats
    import pstats
ImportError: No module named pstats
有什么帮助吗?重申一下,我已经尝试向sources.list文件添加了不同的行,并且 什么都没有用,所以请不要只是搜索和张贴一个链接,除非你已经解决
这个问题你自己解决好了,谢谢

我发现缺少的模块是一个普通的python模块,所以您所要做的就是 它位于Python路径的某个位置


我删除它并不是希望它能帮助其他人。

Python探查器位于社区支持的Ubuntu“multiverse”中,因此要安装Python探查器,只需在APT源文件中取消对multiverse行的注释即可。如果您像我一样尝试自动化服务器安装,那么这些命令应该可以工作:

$ sudo sed -i '/natty[^ ]* multiverse/s/^# //' /etc/apt/sources.list
$ sudo apt-get update
$ sudo apt-get install python-profiler

祝你好运

您可以直接下载python profiler包并运行dpkg

$ sudo sed -i '/natty[^ ]* multiverse/s/^# //' /etc/apt/sources.list
$ sudo apt-get update
$ sudo apt-get install python-profiler