python - 无法在 Windows 10 上安装 H5PY 库 - Python

标签 python installation pip h5py

我需要安装一个名为 h5py 的 lb,但是当我尝试使用这些命令在 Powershell 中安装它时,它不起作用:

pip.exe install h5py

pip install libhdf5-dev

这是我第二次在 Windows 上工作,我不明白如何修复此错误:

PS C:\Users\UIC01685\Desktop\h5py-master> pip.exe install h5py
Collecting h5py
  Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x03483CD0>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/h5py/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x03483E30>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/h5py/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x03483F10>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/h5py/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x034DF030>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/h5py/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x034DF130>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/h5py/
  Could not find a version that satisfies the requirement h5py (from versions: )
No matching distribution found for h5py

PS C:\Users\UIC01685\Desktop\h5py-master> pip install libhdf5-dev
Collecting libhdf5-dev
  Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x03D48CF0>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/libhdf5-dev/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x03D48E50>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/libhdf5-dev/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x03D48F30>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/libhdf5-dev/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x03DA5050>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/libhdf5-dev/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x03DA5150>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/libhdf5-dev/
  Could not find a version that satisfies the requirement libhdf5-dev (from versions: )
No matching distribution found for libhdf5-dev

我也尝试通过下载源代码进行安装,但是当我运行 python.exe .\setup.py install 时出现此错误:

PS C:\Users\UIC01685\Desktop\h5py-master> python.exe .\setup.py install
Download error on https://pypi.python.org/simple/pkgconfig/: timed out -- Some packages may not be found!
Couldn't find index page for 'pkgconfig' (maybe misspelled?)
Download error on https://pypi.python.org/simple/: timed out -- Some packages may not be found!
No local packages or working download links found for pkgconfig
Traceback (most recent call last):
  File ".\setup.py", line 155, in <module>
    cmdclass = CMDCLASS,
  File "C:\LegacyApp\AMESim\R19SL1\Amesim\sys\python\win64\lib\site-packages\setuptools\__init__.py", line 128, in setup
    _install_setup_requires(attrs)
  File "C:\LegacyApp\AMESim\R19SL1\Amesim\sys\python\win64\lib\site-packages\setuptools\__init__.py", line 123, in _install_setup_requires
    dist.fetch_build_eggs(dist.setup_requires)
  File "C:\LegacyApp\AMESim\R19SL1\Amesim\sys\python\win64\lib\site-packages\setuptools\dist.py", line 513, in fetch_build_eggs
    replace_conflicting=True,
  File "C:\LegacyApp\AMESim\R19SL1\Amesim\sys\python\win64\lib\site-packages\pkg_resources\__init__.py", line 774, in resolve
    replace_conflicting=replace_conflicting
  File "C:\LegacyApp\AMESim\R19SL1\Amesim\sys\python\win64\lib\site-packages\pkg_resources\__init__.py", line 1057, in best_match
    return self.obtain(req, installer)
  File "C:\LegacyApp\AMESim\R19SL1\Amesim\sys\python\win64\lib\site-packages\pkg_resources\__init__.py", line 1069, in obtain
    return installer(requirement)
  File "C:\LegacyApp\AMESim\R19SL1\Amesim\sys\python\win64\lib\site-packages\setuptools\dist.py", line 580, in fetch_build_egg
    return cmd.easy_install(req)
  File "C:\LegacyApp\AMESim\R19SL1\Amesim\sys\python\win64\lib\site-packages\setuptools\command\easy_install.py", line 667, in easy_install
    raise DistutilsError(msg)
distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('pkgconfig')

我在一家大公司工作,有一些限制,所以我检查了我是否有代理并在我的 cmd 中运行此命令行:

netsh winhttp show proxy

它说我处于直接访问(无代理服务器)

有什么想法吗?

感谢您的帮助。

最佳答案

您的 setup.py 正在尝试下载 setup.py 中列出的一些要求,在本例中为 pkgconfig。由于使用 https 与 pypi 的连接似乎存在问题,因此失败。尝试询问您的 IT 部门(因为您在一家公司工作,他们应该知道您是否需要配置一些特殊的东西)或从 PyPi 下载 pkgconfig手动。

关于python - 无法在 Windows 10 上安装 H5PY 库 - Python,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56984682/

相关文章:

python - 虚拟环境中的 Pip 升级访问被拒绝

python - 使用 zip 文件安装 python 模块

python - Emacs 和 conda 解决方法

python - 从 anchor 标记的 xpath 节点获取 2 属性的值

python - 为 turtle 构建内置文本字段,while 语句不起作用

python - Windows 7 中托管的 GExiv2.py (Python)

flutter - 无法完成 Flutter 安装

python - Python 'pip' 工具从哪里获取它安装的包?

python - 如何清除/删除 Tkinter Text 小部件的内容?

linux - 未定义对 `clock_gettime' 的引用,修改 makefile?