I have been successfully using the BlueStacks and Kindle for Android method since last June, since the Kindle for PC path no longer works for new book publications. To be honest, I've switched to Kobo purchases as much as possible, although occasionally I'll still purchase from A.
Following Post 1 and 374, I installed BS, and then used adb connect [localhost

ort], followed by adb backup, to "confirm and backup" my kindle data, and then using DeD and then NoD, I installed the plugins, added my Kindle keyfile, and was able to download ebooks in BS/KforA, export the *.EBOK files, and import into Calibre.
Two-three weeks ago, I purchased a newer book from A which required the BS/KforA method. Starting BS prompted an update message, which I did. However, apparently that broke some path or filelink, since after updating BS, I proceeded to download the Kindle book, export the *.EBOK files, and in Calibre imported the *.PRC files, which were encrypted.
I followed the same original setup to get a new ADB backup of the keyfile (in a different folder location). However, when attempting to add the new Kindle for Android keyfile in the Preferences/Plugin Customization menu, Calibre returned the error msg:
calibre, version 7.8.0
ERROR: Cannot open file or folder as it is in use: <p>Could not open the file: "C:\Users\egand\AppData\Local\Temp\tmp0yafmwaf ". It is already opened in the following programs:<div>The main calibre program: C:\Program Files\Calibre2\calibre.exe
calibre 7.8 embedded-python: True
Windows-10-10.0.22631-SP0 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.22631')
Python 3.11.5
Windows: ('10', '10.0.22631', 'SP0', 'Multiprocessor Free')
Interface language: None
EXE path: C:\Program Files\Calibre2\calibre.exe
Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (2, 10, 0) && DeDRM (10, 0, 9) && AZW6 Image Merge (1, 0, 0) && Package KFX (from KFX Input) (2, 10, 0) && Barnes & Noble (1, 5, 4) && Clean Metadata (0, 0, 6) && Consolidate All Library Metadata (2, 0, 46) && Embed Comic Metadata (1, 6, 6) && Ex Libris (1, 0, 19) && Extract ISBN (1, 6, 2) && Fantastic Fiction (1, 7, 0) && Fantastic Fiction Adults (1, 3, 1) && Find Duplicates (1, 10, 9) && GetFileName (0, 2, 0) && Goodreads (1, 8, 1) && Import List (1, 9, 4) && KFX metadata reader (from KFX Input) (2, 10, 0) && From KFX (2, 10, 0) && KFX Input (2, 10, 0) && Set KFX metadata (from KFX Output) (2, 7, 0) && KFX Output (2, 7, 0) && KindleUnpack - The Plugin (0, 83, 1) && Kobo Books (1, 9, 2) && Library Codes (1, 0, 65) && LibraryThing Match (0, 2, 2) && Manage Series (1, 5, 2) && Obok DeDRM (10, 0, 9) && Quality Check (1, 13, 10) && Reading List (1, 15, 3) && Search The Internet (1, 11, 2) && Smashwords Metadata (1, 0, 2) && Standard Ebooks (1, 0, 0) && User Category (1, 6, 1) && View Manager (1, 10, 3) && Wikidata (2, 0, 0) && Wikidata gui (2, 0, 0)
Traceback (most recent call last):
File "C:\Users\egand\AppData\Roaming\calibre\plugins\De DRM.zip\config.py", line 1424, in get_android_file
File "C:\Users\egand\AppData\Roaming\calibre\plugins\De DRM.zip\androidkindlekey.py", line 251, in get_serials
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\egand\\AppData\\Local\\Temp\\tmp0yafmw af'
I then deleted the old keyfile, exited and restarted Calibre with no difference to the result. I restarted the whole computer, and ran into the same problem.
It appears there's an old instance of this keyfile still in use somewhere in Calibre? Any suggestions about how to clear up the logjam?
Thanks in advance
Ed