python在Windows 7上安装rrdtool时出错

我运行的是Windows 7 64位,Python v2.7.10和pip v9.0.1

我试图安装rrdtool,但我得到一个错误

PS C:\Windows\system32> pip install rrdtool Collecting rrdtool Using cached rrdtool-0.1.11.tar.gz Complete output from command python setup.py egg_info: test_rrdtool.c c:\users\person\appdata\local\temp\tmp_python_rrdtoolvwty3u\test_rrdtool.c(2) : fatal error C1083: Cannot open incl ude file: 'rrd.h': No such file or directory Error: Unable to compile the binary module. Do you have the rrdtool header and libraries installed? ---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in c:\users\person\appdata\local\temp\pip-build-pyontu\rrdt ool\ 

我也尝试安装python-rrdtool,但得到一个错误

  PS C:\Users\person\Downloads> pip install python-rrdtool Collecting python-rrdtool Using cached python-rrdtool-1.4.7.tar.gz Installing collected packages: python-rrdtool Running setup.py install for python-rrdtool ... error Complete output from command c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\person\ \appdata\\local\\temp\\pip-build-ykegvz\\python-rrdtool\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.re ad().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record c:\users\person\appdata\lo cal\temp\pip-w44bef-record\install-record.txt --single-version-externally-managed --compile: running install running build running build_ext running build_configure building 'rrdtoolmodule' extension creating build creating build\temp.win-amd64-2.7 creating build\temp.win-amd64-2.7\Release creating build\temp.win-amd64-2.7\Release\rrdtool-1.4.7 creating build\temp.win-amd64-2.7\Release\rrdtool-1.4.7\bindings creating build\temp.win-amd64-2.7\Release\rrdtool-1.4.7\bindings\python C:\Users\person\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /O x /MD /W3 /GS- /DNDEBUG -Irrdtool-1.4.7/src -Ic:\python27\include -Ic:\python27\PC /Tcrrdtool-1.4.7/bindings/python/rrdt oolmodule.c /Fobuild\temp.win-amd64-2.7\Release\rrdtool-1.4.7/bindings/python/rrdtoolmodule.obj rrdtoolmodule.c rrdtool-1.4.7/bindings/python/rrdtoolmodule.c(41) : fatal error C1083: Cannot open include file: '../../rrd_config.h ': No such file or directory error: command 'C:\\Users\\person\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin \\amd64\\cl.exe' failed with exit status 2 ---------------------------------------- Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\person\\appdata\\local\\temp\\p ip-build-ykegvz\\python-rrdtool\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n ');f.close();exec(compile(code, __file__, 'exec'))" install --record c:\users\person\appdata\local\temp\pip-w44bef-reco rd\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\person\appdat a\local\temp\pip-build-ykegvz\python-rrdtool\ 

我使用pipe理员权限运行安装,但得到相同的错误。

我需要使用rrdtoolparsing一些rrd文件并创buildgraphics,但是我不能使用pip来安装此存档。

我是一个Python的新手,所以我不知道如何去做这件事。

我试图使用从https://pypi.python.org/pypi/python-rrdtool/1.4.7下载的tar.gz文件安装它仍然有一个错误

 PS C:\Users\person\Downloads> pip install .\python-rrdtool-1.4.7.tar.gz Processing c:\users\person\downloads\python-rrdtool-1.4.7.tar.gz Installing collected packages: python-rrdtool Running setup.py install for python-rrdtool ... error Complete output from command c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\person\ \appdata\\local\\temp\\pip-hpkobh-build\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r \n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record c:\users\person\appdata\local\temp\pip-b3z 3rd-record\install-record.txt --single-version-externally-managed --compile: running install running build running build_ext running build_configure building 'rrdtoolmodule' extension creating build creating build\temp.win-amd64-2.7 creating build\temp.win-amd64-2.7\Release creating build\temp.win-amd64-2.7\Release\rrdtool-1.4.7 creating build\temp.win-amd64-2.7\Release\rrdtool-1.4.7\bindings creating build\temp.win-amd64-2.7\Release\rrdtool-1.4.7\bindings\python C:\Users\person\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /O x /MD /W3 /GS- /DNDEBUG -Irrdtool-1.4.7/src -Ic:\python27\include -Ic:\python27\PC /Tcrrdtool-1.4.7/bindings/python/rrdt oolmodule.c /Fobuild\temp.win-amd64-2.7\Release\rrdtool-1.4.7/bindings/python/rrdtoolmodule.obj rrdtoolmodule.c rrdtool-1.4.7/bindings/python/rrdtoolmodule.c(41) : fatal error C1083: Cannot open include file: '../../rrd_config.h ': No such file or directory error: command 'C:\\Users\\person\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin \\amd64\\cl.exe' failed with exit status 2 ---------------------------------------- Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\person\\appdata\\local\\temp\\p ip-hpkobh-build\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exe c(compile(code, __file__, 'exec'))" install --record c:\users\person\appdata\local\temp\pip-b3z3rd-record\install-recor d.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\person\appdata\local\temp\pip -hpkobh-build\ 

Solutions Collecting From Web of "python在Windows 7上安装rrdtool时出错"

您可以从网站手动下载,然后使用.tar.gz进入文件夹并执行命令pip install python-rrdtool-1.4.7.tar.gz

您也可以尝试从这里下载并解压并启动.exe文件。