注意:这只影响运行在Python 3.8及更高版本的Windows平台上的Gurobi 9.1.0及更早版本。
当通过conda安装Gurobi时,也就是说,
Conda安装-c gurobi
你可能会收到类似的错误:
os.add_dll_directory (os.path.join (os.getenv(“GUROBI_HOME”),“本”))TypeError:
预期的str、字节或os。PathLike对象,而不是NoneType
处理:该错误可以通过以下两种方法修复:
- 安装完整的Gurobi包,如下所示:如何为Python安装Gurobi ?
- 定义环境变量GUROBI_HOME手动。