---
title: "File \"h5py\\\\h5.pyx\", line 1, in init h5py.h5\\n', 'ImportError: DLL load failed:"
author: "johnsmith9th"
date: "2023-04-07T16:46:37Z"
tags: []
categories: ["编程语言"]
slug: "file-h5py-h5-pyx-line-1-in-init-h5py-h5-n-importerror-dll-load-failed"
draft: false
lastmod: "2023-04-07T16:46:37Z"
id: 2539220
url: "https://johnsmith9th.iteye.com/blog/2539220"
---

python命令行调用没有问题，但是通过pybind11和embeded python去调用则报如题错误，最后是通过打印os.environ\['path']发现问题， 问题在于matlab库强制将自己的路径设置为path里的头一个，导致动态库加载顺序是先加载matlab路径下的hdf5.dll，和预期的conda下的h5py下的dll版本相左。