MMCorePy python3?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

MMCorePy python3?

StevenF
Hello Micromanager community,

quick question, i know the micromanger python wiki page states that it's
only 2.7 is compatible, but since 2.7 is soon to be no longer supported and
the page was written a while back i was wondering if MMCorePy is 3.6
compatible? I've tried to import it from a python 3.6 but i get this error:
*ImportError: DLL load failed: The specified module could not be found.*
I don't know if this error comes from some incompatibilities or if it's
unrelated.
If not could the port to the new version be done?

Anyway thanks for the help in advance.

Cheers,

Steven



--
Sent from: http://micro-manager.3463995.n2.nabble.com/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: MMCorePy python3?

Kyle Douglass-2
Hi Steven,

On Tue, Jul 31, 2018, 15:23 StevenF <[hidden email]> wrote:
Hello Micromanager community,

quick question, i know the micromanger python wiki page states that it's
only 2.7 is compatible, but since 2.7 is soon to be no longer supported and
the page was written a while back i was wondering if MMCorePy is 3.6
compatible?


One solution would be to compile MM against your desired version of Python; I personally have done this with Python 3.6 on Linux and it seems to work. On Windows, you need to modify a Visual Studio property file before compiling (see the link below for hints).

As for making this a default in the Micro-Manager nightly builds, the version of Python on the build machine needs to be updated. I think this is probably out of the hands of the community and something only the developers can do.


Cheers,
Kyle

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: MMCorePy python3?

StevenF
Hey Kyle,

Thanks for the quick reply! If it worked for you then it should work fine
with me!
They'll have to switch eventually anyway!

Thanks again,

Steven




--
Sent from: http://micro-manager.3463995.n2.nabble.com/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: MMCorePy python3?

StevenF
This post was updated on .
EDIT RAW text erased all the error messages :/

So I have been in the past few days trying to build the MMCorePy wrapper for
python 3.6 but unfortunately i am confronting with a lot of hurdles. Those
issues aren't really easy to debug. Furthermore it's pretty difficult for me
to narrow down if these issues are coming from the wrapper, python 3.6 or
other things!

I know the python wrapper isn't as used as others wrappers, but i would be
very grateful if the dev team could provide me/us with an official python
3.6 wrapper!

Here is a recap of some of the issues i am having.
If i take a compiled version like one that can be found in the above links,
when trying to import the library i get :

C:\Program Files\Micro-Manager-2.0gamma\MMCorePy.py in swig_import_helper()
     19         if fp is not None:
     20             try:
---> 21                 _mod = imp.load_module('_MMCorePy', fp, pathname, description)
     22             finally:
     23                 fp.close()

~\Anaconda3\lib\imp.py in load_module(name, file, filename, details)
    241                 return load_dynamic(name, filename, opened_file)
    242         else:
--> 243             return load_dynamic(name, filename, file)
    244     elif type_ == PKG_DIRECTORY:
    245         return load_package(name, filename)

~\Anaconda3\lib\imp.py in load_dynamic(name, path, file)
    341         spec = importlib.machinery.ModuleSpec(
    342             name=name, loader=loader, origin=path)
--> 343         return _load(spec)
    344
    345 else:

ImportError: DLL load failed: The specified module could not be found.


after further investigation it seems that the error revolves around the imp
library and is in fact this error

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-8-15a1f8a98202> in <module>()
----> 1 _load(spec)

~\Anaconda3\lib\importlib\_bootstrap.py in _load(spec)

~\Anaconda3\lib\importlib\_bootstrap.py in _load_unlocked(spec)

~\Anaconda3\lib\importlib\_bootstrap.py in module_from_spec(spec)

~\Anaconda3\lib\importlib\_bootstrap_external.py in create_module(self, spec)

~\Anaconda3\lib\importlib\_bootstrap.py in _call_with_frames_removed(f, *args, **kwds)

ImportError: DLL load failed: Access is denied.


Again i don't know if these errors come from me, Windows, faulty building or
errors from the wrapper.

Same goes when i try to build the wrapper myself, after downloading missing
.h libraries i am now confronted with more that 20 errors :

1>MMCorePy_wrap.cxx
1>c:\users\lifeware\anaconda3\include\pyhash.h(92): warning C4510: '<unnamed-tag>' : default constructor could not be generated
1>        c:\users\lifeware\anaconda3\include\pyhash.h(87) : see declaration of '<unnamed-tag>'
1>c:\users\lifeware\anaconda3\include\pyhash.h(92): warning C4512: '<unnamed-tag>' : assignment operator could not be generated
1>        c:\users\lifeware\anaconda3\include\pyhash.h(87) : see declaration of '<unnamed-tag>'
1>c:\users\lifeware\anaconda3\include\pyhash.h(92): warning C4610: struct '<unnamed-tag>' can never be instantiated - user defined constructor required
1>MMCorePy_wrap.cxx(1074): warning C4100: 'self' : unreferenced formal parameter
1>MMCorePy_wrap.cxx(2449): error C3861: 'PyCObject_Import': identifier not found
1>MMCorePy_wrap.cxx(2519): error C3861: 'PyCObject_FromVoidPtr': identifier not found
1>MMCorePy_wrap.cxx(2542): error C3861: 'PyCObject_AsVoidPtr': identifier not found
1>MMCorePy_wrap.cxx(2547): error C3861: 'PyCObject_FromVoidPtr': identifier not found
1>MMCorePy_wrap.cxx(4914): error C2664: 'PySlice_GetIndices' : cannot convert parameter 1 from 'PySliceObject *' to 'PyObject *'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>MMCorePy_wrap.cxx(4923): error C2664: 'PySlice_GetIndices' : cannot convert parameter 1 from 'PySliceObject *' to 'PyObject *'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>MMCorePy_wrap.cxx(4932): error C2664: 'PySlice_GetIndices' : cannot convert parameter 1 from 'PySliceObject *' to 'PyObject *'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>MMCorePy_wrap.cxx(5011): error C2664: 'PySlice_GetIndices' : cannot convert parameter 1 from 'PySliceObject *' to 'PyObject *'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>MMCorePy_wrap.cxx(5020): error C2664: 'PySlice_GetIndices' : cannot convert parameter 1 from 'PySliceObject *' to 'PyObject *'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>MMCorePy_wrap.cxx(5029): error C2664: 'PySlice_GetIndices' : cannot convert parameter 1 from 'PySliceObject *' to 'PyObject *'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>MMCorePy_wrap.cxx(5111): error C2664: 'PySlice_GetIndices' : cannot convert parameter 1 from 'PySliceObject *' to 'PyObject *'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>MMCorePy_wrap.cxx(5120): error C2664: 'PySlice_GetIndices' : cannot convert parameter 1 from 'PySliceObject *' to 'PyObject *'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>MMCorePy_wrap.cxx(5129): error C2664: 'PySlice_GetIndices' : cannot convert parameter 1 from 'PySliceObject *' to 'PyObject *'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>MMCorePy_wrap.cxx(5268): error C2664: 'PySlice_GetIndices' : cannot convert parameter 1 from 'PySliceObject *' to 'PyObject *'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>MMCorePy_wrap.cxx(5277): error C2664: 'PySlice_GetIndices' : cannot convert parameter 1 from 'PySliceObject *' to 'PyObject *'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>MMCorePy_wrap.cxx(5286): error C2664: 'PySlice_GetIndices' : cannot convert parameter 1 from 'PySliceObject *' to 'PyObject *'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>MMCorePy_wrap.cxx(31738): error C3861: 'PyString_Check': identifier not found
1>MMCorePy_wrap.cxx(31740): error C3861: 'PyString_Size': identifier not found
1>MMCorePy_wrap.cxx(31746): error C3861: 'PyString_AsString': identifier not found
1>Done building project "MMCorePy_wrap.vcxproj" -- FAILED.


Thanks in advance,

Steven



--
Sent from: http://micro-manager.3463995.n2.nabble.com/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
micro-manager-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/micro-manager-general