关于python相关的错误解决方法笔记

1.使用pip安装包的时候,TLS CA证书束找不到问题

该问题的解决得益于 stackoverflow论坛
在这里插入图片描述
解决方法:

  1. 找到cacert.pem位置,一般在python安装目录,如:
'D:\App_Install\Python\Lib\site-packages\pip\_vendor\certifi\cacert.pem'
  1. 更改系统环境变量:
    在这里插入图片描述
  2. 使用pip安装一个包,看是否可以使用,如:
pip install numpy
  1. 如果还是有问题可以通过以下代码对python的配置进行更改:
pip config set global.cert "D:\App_Install\Python\Lib\site-packages\pip\_vendor\certifi\cacert.pem"

然后使用如下命令查看是否已经将global.cert成功更改了:

pip config -v list

2.使用pip安装国际土壤水分阅读器ISMN包的时候会报如下错误

 Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [32 lines of output]
      reading from setup.cfg...
          HDF5_DIR environment variable not set, checking some standard locations ..
      checking C:\Users\阿龙\include...
      hdf5 headers not found in C:\Users\阿龙\include
      checking /usr/local\include...
      hdf5 headers not found in /usr/local\include
      checking /sw\include...
      hdf5 headers not found in /sw\include
      checking /opt\include...
      hdf5 headers not found in /opt\include
      checking /opt/local\include...
      hdf5 headers not found in /opt/local\include
      checking /opt/homebrew\include...
      hdf5 headers not found in /opt/homebrew\include
      checking /usr\include...
      hdf5 headers not found in /usr\include
      Traceback (most recent call last):
        File "d:\app_install\python\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "d:\app_install\python\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "d:\app_install\python\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "C:\Users\阿龙\AppData\Local\Temp\pip-build-env-gb3khdvh\overlay\Lib\site-packages\setuptools\build_meta.py", line 327, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
        File "C:\Users\阿龙\AppData\Local\Temp\pip-build-env-gb3khdvh\overlay\Lib\site-packages\setuptools\build_meta.py", line 297, in _get_build_requires
          self.run_setup()
        File "C:\Users\阿龙\AppData\Local\Temp\pip-build-env-gb3khdvh\overlay\Lib\site-packages\setuptools\build_meta.py", line 313, in run_setup
          exec(code, locals())
        File "<string>", line 277, in <module>
        File "<string>", line 226, in _populate_hdf5_info
      ValueError: did not find HDF5 headers

解决方案:首先安装netCDF4

pip install netCDF4==1.5.4

然后执行:

pip install ismn

最终问题得以解决,可以成功安装ISMN

  • 3
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值