python pip在Windows 7上安装rrdtool时出错

时间:2016-12-08 18:18:40

标签: python windows pip install 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\

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

我需要使用rrdtool解析一些rrd文件并创建图形,但我无法使用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\

1 个答案:

答案 0 :(得分:0)

您可以从website手动下载 然后转到.tar.gz文件夹并执行命令pip install python-rrdtool-1.4.7.tar.gz

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