Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 03-18-2024, 02:37 PM   #1
chipbeaulieu
Junior Member
chipbeaulieu began at the beginning.
 
Posts: 7
Karma: 10
Join Date: May 2023
Device: Mac
Plugin Start Up Error - "symbol not found"

I have a Mac ARM laptop with macOS Sonoma installed. I am trying to run some plugins that used to work but now fail on startup when I try to use gumbo. A simple plugin without gumbo still works fine.

#Import:
import sigil_gumbo_bs4_adapter as gumbo

This is the error I get:
File "/Applications/Sigil.app/Contents/plugin_launchers/python/sigil_gumbo_bs4_adapter.py", line 35, in <module>
import sigil_gumboc as gumboc
File "/Applications/Sigil.app/Contents/plugin_launchers/python/sigil_gumboc.py", line 132, in <module>
SourcePosition.EMPTY = SourcePosition.in_dll(_dll, 'kGumboEmptySourcePosition')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^
ValueError: dlsym(RTLD_DEFAULT, kGumboEmptySourcePosition): symbol not found
Error: dlsym(RTLD_DEFAULT, kGumboEmptySourcePosition): symbol not found

Any suggestions for correcting this would be appreciated.
chipbeaulieu is offline   Reply With Quote
Old 03-18-2024, 02:53 PM   #2
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,156
Karma: 5450818
Join Date: Nov 2009
Device: many
This error typically means that libsigilgumbo.dylib is not being properly found by the plugin code.

Are you running an Arm64 build of Sigil or an x86_64 build of Sigil under automatic translation?

Also make sure you are using Sigil 2.0.2 and none of the earlier versions.

I will give this a try on my own MacOS arm64 machine.

Last edited by KevinH; 03-18-2024 at 03:14 PM.
KevinH is offline   Reply With Quote
Advert
Old 03-18-2024, 03:07 PM   #3
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,156
Karma: 5450818
Join Date: Nov 2009
Device: many
Okay, I just ran the following snippet inside my own testme3 plugin and it worked just fine:

Code:
    # examples for using the bs4/gumbo parser to process xhtml
    print("\nExercising: the gumbo bs4 adapter")
    import sigil_gumbo_bs4_adapter as gumbo_bs4
    samp = """
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml/" xml:lang="en" lang="en-US">
<head><title>testing & entities</title></head>
<body>
  <p class="first second">this&nbsp;is*the*<i><b>copyright</i></b> symbol "&copy;"</p>
  <p xmlns:xlink="http://www.w3.org/xlink" class="second" xlink:href="http://www.ggogle.com">this used to test atribute namespaces</p>
</body>
</html>
"""
    soup = gumbo_bs4.parse(samp)
    for node in soup.find_all(attrs={'class':'second'}):
        print(node)
and it produced the correct output:

Exercising: the gumbo bs4 adapter
<p class="first second">this is the <i><b>copyright</b></i> symbol "©"</p>
<p xmlns:xlink="http://www.w3.org/xlink" class="second" xlink:href="http://www.ggogle.com">this used to test atribute namespaces</p>

---

I would be careful importing that library as "gumbo" as google gumbo and sigil's gumbo are not identical in case of a collision.


The next place to look is to make sure the libsigilgumbo.dylib is in its proper place inside the app.

In Terminal.app (assuming you install Sigil in /Applications) try the following:

ls /Applications/Sigil.app/Contents/lib/

It should show as output: libhunspell.dylib libsigilgumbo.dylib


Are you by chance using an external 3.12 (or newer) Python3 version for your plugins instead of the internal embedded version in my Release builds? If so, drop back to Python 3.11.x as there are breaking changes in Python 3.12.x that may impact using cdll to load sigilgumbo.

Are you by chance building your own version of Sigil?

Last edited by KevinH; 03-18-2024 at 03:12 PM.
KevinH is offline   Reply With Quote
Old 03-18-2024, 05:03 PM   #4
chipbeaulieu
Junior Member
chipbeaulieu began at the beginning.
 
Posts: 7
Karma: 10
Join Date: May 2023
Device: Mac
I am using the ARM version of Sigil 2.0.2. I am also using python 3.11.4 (there is a reason why I wanted to use >3.4, but I've slept since then. Maybe something to do with classes?). I'll check the rest of your note and update this thread.
chipbeaulieu is offline   Reply With Quote
Old 03-18-2024, 05:11 PM   #5
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,156
Karma: 5450818
Join Date: Nov 2009
Device: many
Using Python 3.11 should work just fine. Python 3.4 was the old minimum.
KevinH is offline   Reply With Quote
Advert
Old 03-18-2024, 05:13 PM   #6
chipbeaulieu
Junior Member
chipbeaulieu began at the beginning.
 
Posts: 7
Karma: 10
Join Date: May 2023
Device: Mac
I changed the name of the import to match yours and double checked that both dylibs you show above are in my Sigil app bundle. I am also using the precompiled version of Sigil.
chipbeaulieu is offline   Reply With Quote
Old 03-18-2024, 05:21 PM   #7
chipbeaulieu
Junior Member
chipbeaulieu began at the beginning.
 
Posts: 7
Karma: 10
Join Date: May 2023
Device: Mac
I also created a new plugin to duplicate your sample above. When I ran it, I get the following error:

Exercising: the gumbo bs4 adapter
Traceback (most recent call last):
File "/Applications/Sigil.app/Contents/plugin_launchers/python/launcher.py", line 141, in launch
target_script = __import__(script_module)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/chipbeaulieu/Library/Application Support/sigil-ebook/sigil/plugins/Test4/plugin.py", line 3, in <module>
import sigil_gumbo_bs4_adapter as gumbo_bs4
File "/Applications/Sigil.app/Contents/plugin_launchers/python/sigil_gumbo_bs4_adapter.py", line 35, in <module>
import sigil_gumboc as gumbo
File "/Applications/Sigil.app/Contents/plugin_launchers/python/sigil_gumboc.py", line 132, in <module>
SourcePosition.EMPTY = SourcePosition.in_dll(_dll, 'kGumboEmptySourcePosition')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^
ValueError: dlsym(RTLD_DEFAULT, kGumboEmptySourcePosition): symbol not found
Error: dlsym(RTLD_DEFAULT, kGumboEmptySourcePosition): symbol not found
chipbeaulieu is offline   Reply With Quote
Old 03-18-2024, 05:30 PM   #8
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,156
Karma: 5450818
Join Date: Nov 2009
Device: many
Again, that means the libsigilgumbo.dylib can not be found.

Make sure you are using the Embedded Python (check that box) and not an External python and re-run your test.

The Embedded Python version is Python 3.11.3 in Sigil 2.0.2

Last edited by KevinH; 03-18-2024 at 05:37 PM.
KevinH is offline   Reply With Quote
Old 03-18-2024, 05:33 PM   #9
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,156
Karma: 5450818
Join Date: Nov 2009
Device: many
Please zip up and attach your full Test4/plugin.py to this thread so I can try exactly what you are trying.

Or simply add your current Test4 plugin zip here so I can test with it directly.

Perhaps this is some new strange security change in Sonoma? The exact path to the sigilgumbo library is passed into the plugin so how it can not be found is a real mystery.

Last edited by KevinH; 03-18-2024 at 05:38 PM.
KevinH is offline   Reply With Quote
Old 03-18-2024, 05:39 PM   #10
chipbeaulieu
Junior Member
chipbeaulieu began at the beginning.
 
Posts: 7
Karma: 10
Join Date: May 2023
Device: Mac
One additional note: I am using VS Code for Python, and confirmed I am not using a python virtual environment.
chipbeaulieu is offline   Reply With Quote
Old 03-18-2024, 05:42 PM   #11
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,156
Karma: 5450818
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by chipbeaulieu View Post
One additional note: I am using VS Code for Python, and confirmed I am not using a python virtual environment.
Huh? I have no idea what VS Code for Python even is and why it would be needed. Most IDE's just get in the way.

Please try with the builtin Embedded Python that comes in Sigil (ie check that box).

Do not use an external Python for this test.

Last edited by KevinH; 03-18-2024 at 05:46 PM.
KevinH is offline   Reply With Quote
Old 03-18-2024, 05:47 PM   #12
chipbeaulieu
Junior Member
chipbeaulieu began at the beginning.
 
Posts: 7
Karma: 10
Join Date: May 2023
Device: Mac
Success! Using the embedded Python works with your code and now I am checking my code and will update this thread once it's working. Thanks for your help.
chipbeaulieu is offline   Reply With Quote
Reply

Tags
gumbo, python


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
"Error importing EPUB. EOCD not found. Not a ZIP archive? (Error Code 1068)" oren ePub 8 02-20-2012 08:20 AM
"Error importing EPUB. EOCD not found. Not a ZIP archive? (Error Code 1068)" oren Android Devices 1 02-20-2012 05:10 AM
Calibre plugIn Kindle Collections Error message "Value Error:month..." readee Plugins 4 10-10-2011 12:21 PM


All times are GMT -4. The time now is 02:45 PM.


MobileRead.com is a privately owned, operated and funded community.