Ambriel / advanced_copy_fields

Anki 2.0+ Plugin for performing various field copy/move operations
3 stars 1 forks source link

The addon won't start after updating to the newest version. #3

Closed EugeneTarasenko closed 10 months ago

EugeneTarasenko commented 10 months ago
Screen Shot 2023-12-23 at 20 56 58
Anki 23.10.1 (fac9e0ee) Python 3.9.15 Qt 5.14.2 PyQt 5.14.1
Platform: macOS-12.7.2-x86_64-i386-64bit
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2023-12-23 16:47:13

When loading Advanced Copy Fields:
Traceback (most recent call last):
  File "aqt.addons", line 245, in loadAddons
  File "/Users/eugen/Library/Application Support/Anki2/addons21/1898445115/__init__.py", line 1, in <module>
    from . import advanced_copy_fields
  File "/Users/eugen/Library/Application Support/Anki2/addons21/1898445115/advanced_copy_fields.py", line 18, in <module>
    from PyQt6 import QtCore, QtGui, QtWidgets
ModuleNotFoundError: No module named 'PyQt6'
Lilneo786 commented 10 months ago

You can try installing PyQt6 to resolve this issue.

pip install PyQt6

After installing PyQt6, restart Anki and see if the issue is resolved.

OR:

Downgrade PyQt Version: If the add-on is not compatible with PyQt6, you may need to downgrade PyQt to a version that the add-on supports. You can uninstall PyQt6 and install an older version like PyQt5:

pip uninstall PyQt6
pip install PyQt5
EugeneTarasenko commented 10 months ago

@Lilneo786 How can I install the previous version of the addon? It was working perfectly.

Screen Shot 2023-12-23 at 21 07 38
Lilneo786 commented 10 months ago

Follow instructions here: https://changes.ankiweb.net/ to reinstall

EugeneTarasenko commented 10 months ago

Could you please share the files for the previous version of the Advanced Copy Fields to install it from computer?

Screen Shot 2023-12-23 at 22 02 43 292643146-17e80a10-f385-43ff-a89e-f3748880078a
Lilneo786 commented 10 months ago

https://apps.ankiweb.net/downloads/archive/ Has all the versions

I think this is the version you need: https://github.com/ankitects/anki/releases?q=2.1.23&expanded=true

Lilneo786 commented 10 months ago

https://github.com/ankitects/anki/releases/download/23.10.1/anki-23.10.1-windows-qt6.exe

Is the direct link

EugeneTarasenko commented 10 months ago

I meant the previous version of the Advanced Copy Fields addon, not Anki. This one:

Screen Shot 2023-12-23 at 21 07 38
Lilneo786 commented 10 months ago

Sorry for the misunderstanding. They have a fork for that version that isnt working for you and the instructions to download it is here: https://ankiweb.net/shared/info/287110490

can find the code here: https://github.com/andkinnamon/Advanced-Copy-Fields-Qt6

Ambriel commented 10 months ago

Thank you for helping @EugeneTarasenko on this, @Lilneo786. I would have had to do some research since I've not been active on this project for a while. I'll update the documentation on my page to help others in the future.

Python is a pretty flexible language. I am thinking there should be a way to implement simultaneous QT5 and QT6 support, but I'd have to look at it when I get more free time unless someone beats me to it.

EugeneTarasenko commented 10 months ago

@Ambriel Thank you for providing the source files. However, could you please explain what steps I should take with these files to install them into Anki? None of the files can be selected after clicking the 'Install from file...' button.

292643592-1a930e3c-2257-4b66-ae7d-366c96894764 Screen Shot 2023-12-26 at 04 04 15
Lilneo786 commented 10 months ago

You have to file compile the file, but I highly recommend reading the "README.MD" file first for accurate instructions.

EugeneTarasenko commented 10 months ago

@Lilneo786 There is no information inside the "README.MD" except these two lines of text:

AdvancedCopyFields

Anki 2.1.x Plugin for performing various field copy/move operations

Ambriel commented 10 months ago

@EugeneTarasenko, Remove the contents (not the folder itself) of the Advanced Copy Fields already on your computer and then paste the unzipped contents of the old release into it.

Make sure you don't copy/cut any folder in which the old files are enclosed, just the files.

You will have to restart Anki for the changes to take place.

Note: If you need to find the folder where ACF is stored, you will click on the add-on name from within the Add-ons dialog, and click "View Files"

Ambriel commented 10 months ago

And you can remove the manifest file, I believe, to stop it from trying to update.

EugeneTarasenko commented 10 months ago

@EugeneTarasenko, Remove the contents (not the folder itself) of the Advanced Copy Fields already on your computer and then paste the unzipped contents of the old release into it.

Make sure you don't copy/cut any folder in which the old files are enclosed, just the files.

You will have to restart Anki for the changes to take place.

Note: If you need to find the folder where ACF is stored, you will click on the add-on name from within the Add-ons dialog, and click "View Files"

@Ambriel Unfortunately, Anki throws an error upon startup after following the steps you provided.:

Screen Shot 2023-12-26 at 04 39 17
EugeneTarasenko commented 10 months ago

@Ambriel, I downloaded the files exactly from the link you provided. This one:

Screen Shot 2023-12-26 at 05 06 41
EugeneTarasenko commented 10 months ago

How can I compile the source code to install it from a file myself? Could you please provide some information on this?

Ambriel commented 10 months ago

Yep, you're right. Somewhere along time I started to mix in the PyQT6 libraries that are not on Anki. The older advanced_copy_fields.py is using PyQT5. I need to delete my release because it's not right.

Here, try replacing the file on your computer with the one in this package.

advanced_copy_fields-v0.3.0.zip

EugeneTarasenko commented 10 months ago

@Ambriel Yes, it finally works correctly 🍾. Thank you very much for your help. I truly appreciate it.

Ambriel commented 10 months ago

@Ambriel Yes, it finally works correctly 🍾. Thank you very much for your help. I truly appreciate it.

You're welcome, and thank you! This, I'm sure, will also save some other people some drama. I'm working on creating the correct release for QT5

MAJMAJ-med commented 10 months ago

@Ambriel, Could you clarify the install instructions you provided? I am also trying to get the older release imported for my v2.1 Anki.

EugeneTarasenko commented 10 months ago

@MAJMAJ-med 1) Install the latest version of Advanced Copy Fields addon from AnkiWeb (1898445115) 2) Find the location of the files of the addon on your computer:

Screen Shot 2023-12-26 at 23 43 19

3) Replace the files with these ones: advanced_copy_fields-v0.3.0.zip 4) Restart Anki

MAJMAJ-med commented 10 months ago

Thank you @EugeneTarasenko this worked. The hang up was that I had to upgrade my Anki to v23 to install the addon from AnkiWeb then downgrade to Anki 2.1 and change the name of the folder to prevent the Anki version check.

Ambriel commented 10 months ago

Awesome! Thank you for that @EugeneTarasenko! You're awesome!

Closing this thread. If any issues with something in the future, please open a new concern!

Thank you.