cellmodeller / CellModeller

GPU-accelerated multicellular modelling framework
http://cellmodeller.github.io/CellModeller/
Other
56 stars 48 forks source link

Mac OSX Big Sir: CellModellerGUI Error #31

Closed tchiarelli closed 2 years ago

tchiarelli commented 3 years ago

I am attempting to load the CellModeller GUI using 'python Scripts/CellModellerGUI.py'

It had been working with Catalina, but since switching to Big Sir I am getting the following error:

' raise ImportError("Unable to load OpenGL library", *err.args) ImportError: ('Unable to load OpenGL library', 'dlopen(OpenGL, 10): image not found', 'OpenGL', None)'

I was wondering you had a work around for this or advice on a fix.

Thanks!

timrudge commented 3 years ago

Hi - I am Catalina and I cannot update at the moment, so I cannot reproduce this yet and it may be due to the OS update. Could you let me know how installed cellmodeller?

On 03-02-2021, at 13:51, tchiarelli notifications@github.com wrote:

I am attempting to load the CellModeller GUI using 'python Scripts/CellModellerGUI.py'

It had been working with Catalina, but since switching to Big Sir I am getting the following error:

' raise ImportError("Unable to load OpenGL library", *err.args) ImportError: ('Unable to load OpenGL library', 'dlopen(OpenGL, 10): image not found', 'OpenGL', None)'

I was wondering you had a work around for this or advice on a fix.

Thanks!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

tchiarelli commented 3 years ago

I installed cellmodeller as you explained in issue #23 and ran the cellmodellerGUI based on those instructions as well, it was working perfectly in Catalina. As you and I are assuming, my issue is likely due to the BigSir update.

avimanyu786 commented 3 years ago

Looks similar to https://github.com/PixarAnimationStudios/USD/issues/1372.

odanieloliveira commented 3 years ago

Had the same issue after updating to Big Sur. Solution at @avimanyu786's link seems to do the trick...

YMVio commented 3 years ago

Had the same issue after updating to Big Sur. Solution at @avimanyu786's link seems to do the trick...

Did that trick work for you? It didn't work for me...

avimanyu786 commented 3 years ago

Had the same issue after updating to Big Sur. Solution at @avimanyu786's link seems to do the trick...

Did that trick work for you? It didn't work for me...

The link mentions multiple workarounds. Have you tried all of them?

@odanieloliveira Can you please mention the exact workaround that you picked? Steps on how you fixed it would be great!

odanieloliveira commented 3 years ago

Sure. What I did was the following (also explained in this link: [https://stackoverflow.com/questions/63475461/unable-to-import-opengl-gl-in-python-on-macos])

  1. Look for a file called ctypesloader.py (depending on what python you're using to run Cellmodeller it can be in different places, you can copy the relevant path to your OpenGL from the error message printed in your terminal, I'm using an anaconda environment for example, which feels a little bit more reassuring than tinkering with the system's python files, so my path would be --> /Users/user/opt/anaconda3/envs/cellmodeller/lib/python3.8/site-packages/OpenGL/platform/ctypesloader.py)

  2. In that file just look for this line and change it from:

fullName = util.find_library( name )

to

fullName = '/System/Library/Frameworks/OpenGL.framework/OpenGL'

  1. Save the file and you should be good to go.

So far I haven't noticed any malfunction after making this change or any other issues related to Big Sur. I'll let you know if I do. Hope this helps!

YMVio commented 3 years ago

Had the same issue after updating to Big Sur. Solution at @avimanyu786's link seems to do the trick...

Did that trick work for you? It didn't work for me...

The link mentions multiple workarounds. Have you tried all of them?

@odanieloliveira Can you please mention the exact workaround that you picked? Steps on how you fixed it would be great!

I just understood! There are two places you need to change. In the end it looks like this: `fullName = '/System/Library/Frameworks/OpenGL.framework/OpenGL' try: fullName = '/System/Library/Frameworks/OpenGL.framework/OpenGL' if fullName is not None: name = fullName elif os.path.isfile( os.path.join( DLL_DIRECTORY, name + '.dll' )): name = os.path.join( DLL_DIRECTORY, name + '.dll' ) except Exception as err: _log.info( '''Failed on util.find_library( %r ): %s''', name, err )

Should the call fail, we just try to load the base filename...

`

It works for me now. Hope it will help you!

avimanyu786 commented 3 years ago

Had the same issue after updating to Big Sur. Solution at @avimanyu786's link seems to do the trick...

Did that trick work for you? It didn't work for me...

The link mentions multiple workarounds. Have you tried all of them? @odanieloliveira Can you please mention the exact workaround that you picked? Steps on how you fixed it would be great!

I just understood! There are two places you need to change. In the end it looks like this: fullName = '/System/Library/Frameworks/OpenGL.framework/OpenGL' try: fullName = '/System/Library/Frameworks/OpenGL.framework/OpenGL' if fullName is not None: name = fullName elif os.path.isfile( os.path.join( DLL_DIRECTORY, name + '.dll' )): name = os.path.join( DLL_DIRECTORY, name + '.dll' ) except Exception as err: _log.info( '''Failed on util.find_library( %r ): %s''', name, err ) # Should the call fail, we just try to load the base filename... It works for me now. Hope it will help you!

Wonderful!

Gonza10V commented 2 years ago

Newest versions of MacOS does not support OpenCL as they opted for Metal. https://appleinsider.com/articles/18/06/28/why-macos-mojave-requires-metal----and-deprecates-opengl

We are working in a solution for this but in the meantime I suggest you to use a Linux partition or virtual machine to run CellModeller.