Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old Yesterday, 11:35 PM   #1
jsky
Member
jsky began at the beginning.
 
jsky's Avatar
 
Posts: 11
Karma: 10
Join Date: May 2025
Device: kindle
playwright import error

I want to import playwright inside Calibre, and use code:
Code:
import sys
sys.path.append("/Volumes/DATA/pys/miniconda3/envs/calibre726/lib/python3.11")
sys.path.append("/Volumes/DATA/pys/miniconda3/envs/calibre726/lib/python3.11/lib-dynload")
sys.path.append("/Volumes/DATA/pys/miniconda3/envs/calibre726/lib/python3.11/site-packages")

from playwright.async_api import async_playwright
but import error:
Code:
calibre-customize -b .
Failed to initialize plugin: New Douban Books (2, 1, 0)
Failed to initialize plugin: '/Users/zhuhao/Library/Preferences/calibre/plugins/New Douban Books.zip'
NoTrans: db hooked
NoTrans: usb hooked
NoTrans: app hooked
NoTrans: mtp hooked
NoTrans: save_to_disk hooked
Traceback (most recent call last):
  File "runpy.py", line 198, in _run_module_as_main
    return _run_code(code, main_globals, None,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "runpy.py", line 88, in _run_code
    exec(code, run_globals)
  File "site.py", line 42, in <module>
    # foo package configuration
      ^^^^^^
  File "site.py", line 38, in main
    with three subdirectories, foo, bar and spam, and two path
               ^^^^^^
  File "/Volumes/DATA/pys/calibre-7.26.0/src/calibre/customize/ui.py", line 882, in main
    build_plugin(opts.build_plugin)
  File "/Volumes/DATA/pys/calibre-7.26.0/src/calibre/customize/ui.py", line 841, in build_plugin
    plugin = add_plugin(t.name)
             ^^^^^^^^^^^^^^^^^^
  File "/Volumes/DATA/pys/calibre-7.26.0/src/calibre/customize/ui.py", line 526, in add_plugin
    plugin = load_plugin(path_to_zip_file)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Volumes/DATA/pys/calibre-7.26.0/src/calibre/customize/ui.py", line 76, in load_plugin
    return loader.load(path_to_zip_file)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Volumes/DATA/pys/calibre-7.26.0/src/calibre/customize/zipplugin.py", line 311, in load
    m = importlib.import_module(plugin_module)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "importlib/__init__.py", line 126, in import_module
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "/Volumes/DATA/pys/calibre-7.26.0/src/calibre/customize/zipplugin.py", line 210, in exec_module
    exec(compiled, module.__dict__)
  File "calibre_plugins.newamazon.__init__", line 34, in <module>
  File "/Volumes/DATA/pys/calibre-7.26.0/src/calibre/customize/zipplugin.py", line 210, in exec_module
    exec(compiled, module.__dict__)
  File "calibre_plugins.newamazon.playwright_browser", line 17, in <module>
  File "/Volumes/DATA/pys/miniconda3/envs/calibre726/lib/python3.11/site-packages/playwright/async_api/__init__.py", line 25, in <module>
    import playwright.async_api._generated
  File "/Volumes/DATA/pys/miniconda3/envs/calibre726/lib/python3.11/site-packages/playwright/async_api/_generated.py", line 21, in <module>
    from playwright._impl._accessibility import Accessibility as AccessibilityImpl
  File "/Volumes/DATA/pys/miniconda3/envs/calibre726/lib/python3.11/site-packages/playwright/_impl/_accessibility.py", line 17, in <module>
    from playwright._impl._connection import Channel
  File "/Volumes/DATA/pys/miniconda3/envs/calibre726/lib/python3.11/site-packages/playwright/_impl/_connection.py", line 42, in <module>
    from playwright._impl._greenlets import EventGreenlet
  File "/Volumes/DATA/pys/miniconda3/envs/calibre726/lib/python3.11/site-packages/playwright/_impl/_greenlets.py", line 17, in <module>
    import greenlet
  File "/Volumes/DATA/pys/miniconda3/envs/calibre726/lib/python3.11/site-packages/greenlet/__init__.py", line 29, in <module>
    from ._greenlet import _C_API # pylint:disable=no-name-in-module
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: dlopen(/Volumes/DATA/pys/miniconda3/envs/calibre726/lib/python3.11/site-packages/greenlet/_greenlet.cpython-311-darwin.so, 0x0002): tried: '/Volumes/DATA/pys/miniconda3/envs/calibre726/lib/python3.11/site-packages/greenlet/_greenlet.cpython-311-darwin.so' (code signature in <281F2F14-3E6E-38A4-AFAB-566D14E8C77E> '/Volumes/DATA/pys/miniconda3/envs/calibre726/lib/python3.11/site-packages/greenlet/_greenlet.cpython-311-darwin.so' not valid for use in process: mapping process and mapped file (non-platform) have different Team IDs), '/System/Volumes/Preboot/Cryptexes/OS/Volumes/DATA/pys/miniconda3/envs/calibre726/lib/python3.11/site-packages/greenlet/_greenlet.cpython-311-darwin.so' (no such file), '/Volumes/DATA/pys/miniconda3/envs/calibre726/lib/python3.11/site-packages/greenlet/_greenlet.cpython-311-darwin.so' (code signature in <281F2F14-3E6E-38A4-AFAB-566D14E8C77E> '/Volumes/DATA/pys/miniconda3/envs/calibre726/lib/python3.11/site-packages/greenlet/_greenlet.cpython-311-darwin.so' not valid for use in process: mapping process and mapped file (non-platform) have different Team IDs)
I am using Mac M1,who knows how to solve it?
jsky is offline   Reply With Quote
Old Today, 12:23 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,364
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Apple's stupid security theatre wont let you do that. You cant import code signed code signed by different teams. In any case you dont need to use playwright in calibre, calibre comes with its own chromium instance you can use.
kovidgoyal is online now   Reply With Quote
Old Today, 06:30 AM   #3
jsky
Member
jsky began at the beginning.
 
jsky's Avatar
 
Posts: 11
Karma: 10
Join Date: May 2025
Device: kindle
Thx
How to use the calibre's own chromium instance?
jsky is offline   Reply With Quote
Old Today, 07:47 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,364
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Google Qt WebEngine or look at scraper/webengine_backend.py for a basic example.
kovidgoyal is online now   Reply With Quote
Old Today, 09:41 AM   #5
jsky
Member
jsky began at the beginning.
 
jsky's Avatar
 
Posts: 11
Karma: 10
Join Date: May 2025
Device: kindle
Thx
Could the next version of Calibre integrate Playwright? After all, Playwright may offers more new features.
jsky is offline   Reply With Quote
Old Today, 10:57 AM   #6
Quoth
Still reading
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 14,069
Karma: 105206895
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
Quote:
Originally Posted by jsky View Post
Thx
Could the next version of Calibre integrate Playwright? After all, Playwright may offers more new features.
Are you sure it does what you think it does?
https://playwright.dev

It doesn't sound appropriate for Calibre.
Quoth is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
import error kcarscadden Library Management 11 10-23-2020 09:48 PM
Free (Kindle) Sean O'Casey: A Life [20th C Irish Political Playwright Biography] ATDrake Deals and Resources (No Self-Promotion or Affiliate Links) 0 07-19-2017 06:35 PM
Export/Import all Calibre data - import error IanKBrown Calibre 5 02-15-2017 08:32 PM
Import on Filename changes mid import due to book error Vortex Calibre 3 12-05-2014 11:49 AM
Import failed Error:404 when attempting to import from Calibre to Stanza dvond Apple Devices 0 05-13-2011 03:00 PM


All times are GMT -4. The time now is 11:58 AM.


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