Python 3.4 在 Windows 7 x64 上安装 psutil

标签 python psutil

我正在尝试从 Python 3.4 的源 psutil 2.1.0 安装。我的操作系统是 Windows 7 x64。我收到错误:

c:\Python34\psutil-2.1.0>python setup.py install --verbose
running install
running bdist_egg
running egg_info
writing top-level names to psutil.egg-info\top_level.txt
writing psutil.egg-info\PKG-INFO
writing dependency_links to psutil.egg-info\dependency_links.txt
reading manifest file 'psutil.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*' found under directory 'docs
build'
writing manifest file 'psutil.egg-info\SOURCES.txt'
installing library code to build\bdist.win32\egg
running install_lib
running build_py
creating build
creating build\lib.win32-3.4
creating build\lib.win32-3.4\psutil
copying psutil\_common.py -> build\lib.win32-3.4\psutil
copying psutil\_compat.py -> build\lib.win32-3.4\psutil
copying psutil\_psbsd.py -> build\lib.win32-3.4\psutil
copying psutil\_pslinux.py -> build\lib.win32-3.4\psutil
copying psutil\_psosx.py -> build\lib.win32-3.4\psutil
copying psutil\_psposix.py -> build\lib.win32-3.4\psutil
copying psutil\_pssunos.py -> build\lib.win32-3.4\psutil
copying psutil\_pswindows.py -> build\lib.win32-3.4\psutil
copying psutil\__init__.py -> build\lib.win32-3.4\psutil
running build_ext
building '_psutil_windows' extension
error: Unable to find vcvarsall.bat

你能帮我一下吗?提前致谢

最佳答案

vcvarsall.bat 看起来像是 Microsoft Visual Studio 的依赖项。
参见:Python issue:Unable to find vcvarsall.bat

您可以尝试手动安装。从这里获取 amd64 py3.4 版本:

http://www.lfd.uci.edu/~gohlke/pythonlibs/#psutil

并安装它。如果也失败,请使用 7-Zip 打开 .exe 并将包含的文件夹解压到您的站点包中。

关于Python 3.4 在 Windows 7 x64 上安装 psutil,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23104115/

相关文章:

python - 访问 heapq 的索引和长度?

python - 在 Pandas 中,有没有办法将一个单元格除以一列中的所有其他单元格?

python - 如何通过 psutil 获取磁盘 IO 和网络使用百分比

python - 使用 Python 检测可用的网络适配器

python - 与 Pandas 的数据框串联

python - 使用 Qt Designer 表单和 PyQt5 在 QWidget 中绘制 matplotlib 图

python - 不能模拟被模拟对象的方法? pytest 中的 call_count 为 0

python - psutil.WindowsService.username() 返回空白

python - 如何在Python中将一个json文件作为输出?

python-3.5 - 模块 'psutil' 在 python 3.5 中没有属性 'process_iter'