MOSEK / Mosek.pip

PIP MOSEK installer
MIT License
17 stars 10 forks source link

Installing on Win 8 #5

Closed tschm closed 9 years ago

tschm commented 9 years ago

Hi Ulf, I am currently experimenting with your installer on Win 8 (I know that this is a bad choice in the first place). I install it via pip (using the requirements.txt) as

git+https://github.com/MOSEK/Mosek.pip@v7.0.0#egg=mosek

I run on Win 8 64bit machine. I have Python 2.7.10 (32bit). Mosek seems to install correctly as I end up with 4 .dll files in env\Lib\site-packages\mosek + some .py files.

When I try to import mosek I get File "C:\Users\thomas\Documents\GitHub\pyopt\env\lib\site-packages\mosekinit.py", line 639, in raise ImportError('Failed to import dll "%s"' % __libname) ImportError: Failed to import dll "mosekxx7_1.dll"

ulfworsoe commented 9 years ago

Hmm... Can you see if it installed to 32bit version of Mosek? In the 32bit distro the mosek dll is mosek7_1.dll, in the 64bit version it is mosek64_7_1.dll.

tschm commented 9 years ago

I tried with both. I figured that the problem is that those .dll files (to be precise the folder they are in) don't make it into the sys.path. I tried to change the path at runtime but had no success. For now I have modified the build.bat file (the file building my python environment, downloading mosek etc.) such that it will copy those .dll files into the local path of my project. It works but it's not that elegant :-)

ulfworsoe commented 9 years ago

mosek/init.py locates mosekxx7_1.dll relative to the script file's path. The Windows DLL loader will look for dll dependencies in the same directory as the DLL it loads (or at least it should). If it works when you set the PATH it should indicate the install paths are different that I expect when loading the dlls.

On Thu, Sep 24, 2015 at 11:51 AM, Thomas Schmelzer <notifications@github.com

wrote:

I can tried with both. I figured that the problem is that those .dll files (to be precise the folder they are in) don't make it into the os.system.path. I tried to change the path at runtime but had no success. For now I have modified the build.bat file (the file building my python environment, downloading mosek etc.) such that it will copy those .dll files into the local path of my project. It works but it's not that elegant :-)

— Reply to this email directly or view it on GitHub https://github.com/MOSEK/Mosek.pip/issues/5#issuecomment-142877313.

Ulf Worsøe Mosek ApS

ulf.worsoe@mosek.com www.mosek.com

tschm commented 9 years ago

Haha, I think I found your bug (you owe me a beer):

In line 597 or your init.py:

    if ctypes.sizeof(ctypes.c_void_p) == 4:

      __libsupport.append('mosek7_0.dll')

    else:

      __libsupport.append('mosek64_7_0.dll')

You have to replace the two zeros with ones. After this change it seems to work...

ulfworsoe commented 9 years ago

I owe you a beer.

On Thu, Sep 24, 2015 at 2:34 PM, Thomas Schmelzer notifications@github.com wrote:

Haha, I think I found your bug (you owe me a beer):

In line 597 or your init.py:

if ctypes.sizeof(ctypes.c_void_p) == 4:

  __libsupport.append('mosek7_0.dll')

else:

  __libsupport.append('mosek64_7_0.dll')

You have to replace the two zeros with ones. After this change it seems to work...

— Reply to this email directly or view it on GitHub https://github.com/MOSEK/Mosek.pip/issues/5#issuecomment-142915334.

Ulf Worsøe Mosek ApS

ulf.worsoe@mosek.com www.mosek.com

tschm commented 9 years ago

Hi Ulf, can you please correct this little bug? This isn't actually related to the installer rather it's a problem of the Python part in the main mosek distribution. Thanks Thomas

ulfworsoe commented 9 years ago

It has to be fixed in the mosek distro. I have submitted the fix, and I thought that it had been built and uploaded. I'll ask the build guy.

On Tue, Sep 29, 2015 at 9:53 AM, Thomas Schmelzer notifications@github.com wrote:

Hi Ulf, can you please correct this little bug? This isn't actually related to the installer rather it's a problem of the Python part in the main mosek distribution. Thanks Thomas

— Reply to this email directly or view it on GitHub https://github.com/MOSEK/Mosek.pip/issues/5#issuecomment-143976782.

Ulf Worsøe Mosek ApS

ulf.worsoe@mosek.com www.mosek.com

ulfworsoe commented 9 years ago

This took longer that expected, but a new version that fixes the problem should be up now.