简体   繁体   English

在Windows上安装适用于Python的SCIP不再起作用

[英]Install SCIP for Python on Windows does not work anymore

I had a working SCIP installation on Python using the following thread: SCIP Python Installation Issue Windows with pip 我使用以下线程在Python上进行了有效的SCIP安装: SCIP Python安装发行带有pip的Windows

Now I have a new laptop and tried to re-install SCIP again but it does not work (I tried on several machines with the identical result). 现在,我有一台新的笔记本电脑,并尝试再次重新安装SCIP,但是它不起作用(我在多台计算机上尝试了相同的结果)。 The software versions have changed so I refer to the new versions below. 软件版本已更改,因此我在下面参考新版本。


Installation (Environment): 安装(环境):

  • OS: Windows 10 作业系统:Windows 10
  • Anaconda Version 5.0.1| Anaconda版本5.0.1 | Release Date: October 25, 2017; 发行日期:2017年10月25日; Python 3.6 (64 bit) Python 3.6(64位)
  • PyCharm, 2017.3 (Community Edition) PyCharm,2017.3(社区版)
  • Library PySCIPOpt (pip install pyscipopt) 库PySCIPOpt(pip安装pyscipopt)
  • Unpacked the files from SCIPOPTDIR.rar in directory C:\\SCIPOPT 从SCIPOPTDIR.rar的目录C:\\ SCIPOPT中解压缩文件
  • Set the environment variables: 设置环境变量:
    • Added the Variable SCIPOPTDIR with the Value of the installation directory (ie C:\\SCIPOPT) 在安装目录的值(即C:\\ SCIPOPT)中添加了变量SCIPOPTDIR
    • Added in the PATH Variable the entry %SCIPOPTDIR%\\lib 在PATH变量中添加了条目%SCIPOPTDIR%\\ lib

Error Message: 错误信息:

File "C:/Users/i070009/PycharmProjects/OptimizationModels/RunTestOfSCIPLibrary.py", line 1, in 文件“ C:/Users/i070009/PycharmProjects/OptimizationModels/RunTestOfSCIPLibrary.py”,第1行,在

from pyscipopt import Model, quicksum 从pyscipopt导入模型,quicksum

ModuleNotFoundError: No module named 'pyscipopt' ModuleNotFoundError:没有名为“ pyscipopt”的模块


If I use a jupyter Notebook (from pyscipopt import Model, quicksum) I get the following error message: 如果我使用jupyter Notebook(从pyscipopt导入模型,quicksum),将收到以下错误消息:

ImportError Traceback (most recent call last) in () ----> 1 from pyscipopt import Model, quicksum pyscipopt import Model(quicksum)中()----> 1中的ImportError Traceback(最近一次调用最后一次)

C:\\ProgramData\\Anaconda3\\lib\\site-packages\\pyscipopt__init__.py in () 1 # export user-relevant objects: ()中的C:\\ ProgramData \\ Anaconda3 \\ lib \\ site-packages \\ pyscipopt__init __。py 1#导出与用户相关的对象:

  2 from pyscipopt.Multidict import multidict

----> 3 from pyscipopt.scip import Model ----> 3从pyscipopt.scip导入模型

  4 from pyscipopt.scip      import Branchrule

  5 from pyscipopt.scip      import Conshdlr

ImportError: DLL load failed: The specified module could not be found. ImportError:DLL加载失败:找不到指定的模块。

My guess is that the module is not found but since I added the PATH variables (and it worked on my old laptop) I'm puzzled why it does not work. 我的猜测是找不到该模块,但是由于我添加了PATH变量(并且该模块在我的旧笔记本电脑上可以使用),我很困惑为什么它不起作用。 It might be a really simple problem. 这可能是一个非常简单的问题。 I'm just not seeing it! 我只是没有看到它! Thanks for any help on this topic! 感谢您对这个主题的任何帮助!

This is already handled here: https://github.com/SCIP-Interfaces/PySCIPOpt/issues/110 这已经在这里处理: https : //github.com/SCIP-Interfaces/PySCIPOpt/issues/110

One needs to make sure that the bin directory is available in the PATH on Windows so both the binary as well as the dll/lib are found during installation and execution of PySCIPOpt. 需要确保bin目录在Windows的PATH可用,以便在安装和执行PySCIPOpt时找到二进制文件以及dll / lib。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM