kkloberdanz / pygauss

Python bindings for gauss -- General Algorithmic Unified Statistical Solvers
MIT License
0 stars 0 forks source link

Cannot run gauss #3

Open Ford666 opened 4 years ago

Ford666 commented 4 years ago

I'm running on a Win 10 professional version computer. I can install gauss successfully in windows command prompt via pip install gauss --user But when I tried to import gauss in ipython kernel, the following error occurs:

pip install gauss --user
Collecting gauss
  Using cached gauss-0.0.9-py3-none-any.whl (14 kB)
Installing collected packages: gauss
Successfully installed gauss-0.0.9

C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64>ipython
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 7.8.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import gauss
---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-1-a2ef1b28a019> in <module>
----> 1 import gauss

~\AppData\Roaming\Python\Python37\site-packages\gauss\__init__.py in <module>
----> 1 from .vec import Vec
      2 from . import linear

~\AppData\Roaming\Python\Python37\site-packages\gauss\vec.py in <module>
      1 import ctypes
----> 2 from . import core
      3
      4
      5 _number_types = (int, float)

~\AppData\Roaming\Python\Python37\site-packages\gauss\core.py in <module>
     12
     13
---> 14 _libgauss = _load_libgauss()
     15 _libgauss.gauss_vec_dot_f64.restype = ctypes.c_double
     16 _libgauss.gauss_vec_l1norm_f64.restype = ctypes.c_double

~\AppData\Roaming\Python\Python37\site-packages\gauss\core.py in _load_libgauss()
      7     full_path = os.path.dirname(os.path.abspath(__file__))
      8     lib_path = "{}/lib/libgauss.so".format(full_path)
----> 9     lib = ctypes.cdll.LoadLibrary(lib_path)
     10     lib.gauss_init()
     11     return lib

c:\program files (x86)\microsoft visual studio\shared\python37_64\lib\ctypes\__init__.py in LoadLibrary(self, name)
    432
    433     def LoadLibrary(self, name):
--> 434         return self._dlltype(name)
    435
    436 cdll = LibraryLoader(CDLL)

c:\program files (x86)\microsoft visual studio\shared\python37_64\lib\ctypes\__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error)
    354
    355         if handle is None:
--> 356             self._handle = _dlopen(self._name, mode)
    357         else:
    358             self._handle = handle

OSError: [WinError 193] %1 is not a valid Win32 application

It claims that the gauss library is not allowed to run in windows or it contains error. I don't know why and just want to report the issue for your information, thanks.

kkloberdanz commented 4 years ago

Hi, thanks for submitting the issue. Gauss in in a state of active development at the moment and I haven't yet added Windows support. I plan to do so in the future. The Python package I published will currently only work on Linux.

Ford666 commented 4 years ago

@kkloberdanz Okay....noted with thanks, hopefully we can use it in windows platform soon.