Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
374 views
in Technique[技术] by (71.8m points)

python - Encountering DLL error in OR Tools pywrapcp

I used OR Tools V7.4 to build a routing model, it runs perfectly on my computer. However due to some situation I need ir for another team member to run the code.

Between me creating the model and giving my team member that responsability OR tools updated to V7.5, and we've faced the issue that he cant import one of the modules in the library. Trying to read de release notes I've not found anything that changes in the modules (names) we have literally the same of everything, but he cant run it.

My Python is 3.7 and 64-bit

This is the code:

from __future__ import print_function
import pandas as pd; 
import requests;
import os; 
from itertools import tee; 
import numpy as np
from pprint import pprint
from functools import partial
from six.moves import xrange
from ortools.constraint_solver import pywrapcp
from ortools.constraint_solver import routing_enums_pb2.

In my computer I find no mistake, while on his I find this mistake while importing pywrapcp

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-8731fb73bd10> in <module>
      8 from functools import partial
      9 from six.moves import xrange
---> 10 from ortools.constraint_solver import pywrapcp
     11 from ortools.constraint_solver import routing_enums_pb2

~AppDataLocalContinuumanaconda3libsite-packagesortoolsconstraint_solverpywrapcp.py in <module>
     11 # Import the low-level C/C++ module
     12 if __package__ or "." in __name__:
---> 13     from . import _pywrapcp
     14 else:
     15     import _pywrapcp

ImportError: DLL load failed: No se puede encontrar el módulo especificado.

I'm pretty desperate, because I think its a pretty stupid mistake and easy to solve.

Thanks!!!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You can download the Microsoft Visual C++ Redistributable for Visual Studio 2019 here: https://aka.ms/vs/16/release/VC_redist.x64.exe

src: https://visualstudio.microsoft.com/downloads/?q=Redistributable
note: you must select x64


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...