I can't use any Anki version

It’s first time I download the Anki Desktop.
I have tried in the past too, but I still get the same issue. I open the app and it is blank. It only shows the toolbar.
I checked the database as suggested, but it says it’s fine. I tried to downgrade the version or get the alternative version. The same problem occurs.

Here is the report:

Error
An error occurred. Please use Tools > Check Database to see if that fixes the problem.
If problems persist, please report the problem on our support site. Please copy and paste the information below into your report.
Anki 2.1.46 (94913ec2) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=False sv=1
Add-ons, last update check: 2021-08-25 18:29:11

Exception while serving /_anki/js/webview.js
Traceback (most recent call last):
File “waitress\channel.py”, line 397, in service
File “waitress\task.py”, line 168, in service
File “waitress\task.py”, line 446, in execute
File “waitress\task.py”, line 307, in write
File “waitress\channel.py”, line 366, in write_soon
File “waitress\server.py”, line 331, in pull_trigger
File “waitress\trigger.py”, line 96, in pull_trigger
File “waitress\trigger.py”, line 203, in _physical_pull
OSError: [WinError 10038] An operation was attempted on something that is not a socket
Exception while serving /_anki/js/webview.js
Traceback (most recent call last):
File “waitress\channel.py”, line 397, in service
File “waitress\task.py”, line 168, in service
File “waitress\task.py”, line 446, in execute
File “waitress\task.py”, line 307, in write
File “waitress\channel.py”, line 366, in write_soon
File “waitress\server.py”, line 331, in pull_trigger
File “waitress\trigger.py”, line 96, in pull_trigger
File “waitress\trigger.py”, line 203, in _physical_pull
OSError: [WinError 10038] An operation was attempted on something that is not a socket
Exception while serving /_anki/js/vendor/jquery.min.js
Traceback (most recent call last):
File “waitress\channel.py”, line 397, in service
File “waitress\task.py”, line 168, in service
File “waitress\task.py”, line 446, in execute
File “waitress\task.py”, line 307, in write
File “waitress\channel.py”, line 366, in write_soon
File “waitress\server.py”, line 331, in pull_trigger
File “waitress\trigger.py”, line 96, in pull_trigger
File “waitress\trigger.py”, line 203, in _physical_pull
OSError: [WinError 10038] An operation was attempted on something that is not a socket
Exception while serving /_anki/js/vendor/jquery.min.js
Traceback (most recent call last):
File “waitress\channel.py”, line 397, in service
File “waitress\task.py”, line 168, in service
File “waitress\task.py”, line 446, in execute
File “waitress\task.py”, line 307, in write
File “waitress\channel.py”, line 366, in write_soon
File “waitress\server.py”, line 331, in pull_trigger
File “waitress\trigger.py”, line 96, in pull_trigger
File “waitress\trigger.py”, line 203, in _physical_pull
OSError: [WinError 10038] An operation was attempted on something that is not a socket
Exception when servicing <waitress.channel.HTTPChannel connected 127.0.0.1:4147 at 0x207acea14f0>
Traceback (most recent call last):
File “waitress\channel.py”, line 397, in service
File “waitress\task.py”, line 168, in service
File “waitress\task.py”, line 446, in execute
File “waitress\task.py”, line 307, in write
File “waitress\channel.py”, line 366, in write_soon
File “waitress\server.py”, line 331, in pull_trigger
File “waitress\trigger.py”, line 96, in pull_trigger
File “waitress\trigger.py”, line 203, in _physical_pull
OSError: [WinError 10038] An operation was attempted on something that is not a socket

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “waitress\task.py”, line 84, in handler_thread
File “waitress\channel.py”, line 424, in service
File “waitress\task.py”, line 168, in service
File “waitress\task.py”, line 358, in execute
File “waitress\task.py”, line 307, in write
File “waitress\channel.py”, line 366, in write_soon
File “waitress\server.py”, line 331, in pull_trigger
File “waitress\trigger.py”, line 96, in pull_trigger
File “waitress\trigger.py”, line 203, in _physical_pull
OSError: [WinError 10038] An operation was attempted on something that is not a socket
Exception when servicing <waitress.channel.HTTPChannel connected 127.0.0.1:4146 at 0x207acea14c0>
Traceback (most recent call last):
File “waitress\channel.py”, line 397, in service
File “waitress\task.py”, line 168, in service
File “waitress\task.py”, line 446, in execute
File “waitress\task.py”, line 307, in write
File “waitress\channel.py”, line 366, in write_soon
File “waitress\server.py”, line 331, in pull_trigger
File “waitress\trigger.py”, line 96, in pull_trigger
File “waitress\trigger.py”, line 203, in _physical_pull
OSError: [WinError 10038] An operation was attempted on something that is not a socket

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “waitress\task.py”, line 84, in handler_thread
File “waitress\channel.py”, line 424, in service
File “waitress\task.py”, line 168, in service
File “waitress\task.py”, line 358, in execute
File “waitress\task.py”, line 307, in write
File “waitress\channel.py”, line 366, in write_soon
File “waitress\server.py”, line 331, in pull_trigger
File “waitress\trigger.py”, line 96, in pull_trigger
File “waitress\trigger.py”, line 203, in _physical_pull
OSError: [WinError 10038] An operation was attempted on something that is not a socket
Exception when servicing <waitress.channel.HTTPChannel connected 127.0.0.1:4148 at 0x207acea1820>
Traceback (most recent call last):
File “waitress\channel.py”, line 397, in service
File “waitress\task.py”, line 168, in service
File “waitress\task.py”, line 446, in execute
File “waitress\task.py”, line 307, in write
File “waitress\channel.py”, line 366, in write_soon
File “waitress\server.py”, line 331, in pull_trigger
File “waitress\trigger.py”, line 96, in pull_trigger
File “waitress\trigger.py”, line 203, in _physical_pull
OSError: [WinError 10038] An operation was attempted on something that is not a socket

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “waitress\task.py”, line 84, in handler_thread
File “waitress\channel.py”, line 424, in service
File “waitress\task.py”, line 168, in service
File “waitress\task.py”, line 358, in execute
File “waitress\task.py”, line 307, in write
File “waitress\channel.py”, line 366, in write_soon
File “waitress\server.py”, line 331, in pull_trigger
File “waitress\trigger.py”, line 96, in pull_trigger
File “waitress\trigger.py”, line 203, in _physical_pull
OSError: [WinError 10038] An operation was attempted on something that is not a socket
Exception when servicing <waitress.channel.HTTPChannel connected 127.0.0.1:4149 at 0x207acea1a30>
Traceback (most recent call last):
File “waitress\channel.py”, line 397, in service
File “waitress\task.py”, line 168, in service
File “waitress\task.py”, line 446, in execute
File “waitress\task.py”, line 307, in write
File “waitress\channel.py”, line 366, in write_soon
File “waitress\server.py”, line 331, in pull_trigger
File “waitress\trigger.py”, line 96, in pull_trigger
File “waitress\trigger.py”, line 203, in _physical_pull
OSError: [WinError 10038] An operation was attempted on something that is not a socket

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “waitress\task.py”, line 84, in handler_thread
File “waitress\channel.py”, line 424, in service
File “waitress\task.py”, line 168, in service
File “waitress\task.py”, line 358, in execute
File “waitress\task.py”, line 307, in write
File “waitress\channel.py”, line 366, in write_soon
File “waitress\server.py”, line 331, in pull_trigger
File “waitress\trigger.py”, line 96, in pull_trigger
File “waitress\trigger.py”, line 203, in _physical_pull
OSError: [WinError 10038] An operation was attempted on something that is not a socket
Exception while serving /_anki/js/vendor/jquery-ui.min.js
Traceback (most recent call last):
File “waitress\channel.py”, line 397, in service
File “waitress\task.py”, line 168, in service
File “waitress\task.py”, line 446, in execute
File “waitress\task.py”, line 307, in write
File “waitress\channel.py”, line 366, in write_soon
File “waitress\server.py”, line 331, in pull_trigger
File “waitress\trigger.py”, line 96, in pull_trigger
File “waitress\trigger.py”, line 203, in _physical_pull
OSError: [WinError 10038] An operation was attempted on something that is not a socket
Exception while serving /_anki/js/deckbrowser.js
Traceback (most recent call last):
File “waitress\channel.py”, line 397, in service
File “waitress\task.py”, line 168, in service
File “waitress\task.py”, line 446, in execute
File “waitress\task.py”, line 307, in write
File “waitress\channel.py”, line 366, in write_soon
File “waitress\server.py”, line 331, in pull_trigger
File “waitress\trigger.py”, line 96, in pull_trigger
File “waitress\trigger.py”, line 203, in _physical_pull
OSError: [WinError 10038] An operation was attempted on something that is not a socket
Exception when servicing <waitress.channel.HTTPChannel connected 127.0.0.1:9620 at 0x207acea1b80>
Traceback (most recent call last):
File “waitress\channel.py”, line 397, in service
File “waitress\task.py”, line 168, in service
File “waitress\task.py”, line 446, in execute
File “waitress\task.py”, line 307, in write
File “waitress\channel.py”, line 366, in write_soon
File “waitress\server.py”, line 331, in pull_trigger
File “waitress\trigger.py”, line 96, in pull_trigger
File “waitress\trigger.py”, line 203, in _physical_pull
OSError: [WinError 10038] An operation was attempted on something that is not a socket

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “waitress\task.py”, line 84, in handler_thread
File “waitress\channel.py”, line 424, in service
File “waitress\task.py”, line 168, in service
File “waitress\task.py”, line 358, in execute
File “waitress\task.py”, line 307, in write
File “waitress\channel.py”, line 366, in write_soon
File “waitress\server.py”, line 331, in pull_trigger
File “waitress\trigger.py”, line 96, in pull_trigger
File “waitress\trigger.py”, line 203, in _physical_pull
OSError: [WinError 10038] An operation was attempted on something that is not a socket
Exception when servicing <waitress.channel.HTTPChannel connected 127.0.0.1:9621 at 0x207acea1df0>
Traceback (most recent call last):
File “waitress\channel.py”, line 397, in service
File “waitress\task.py”, line 168, in service
File “waitress\task.py”, line 446, in execute
File “waitress\task.py”, line 307, in write
File “waitress\channel.py”, line 366, in write_soon
File “waitress\server.py”, line 331, in pull_trigger
File “waitress\trigger.py”, line 96, in pull_trigger
File “waitress\trigger.py”, line 203, in _physical_pull
OSError: [WinError 10038] An operation was attempted on something that is not a socket

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “waitress\task.py”, line 84, in handler_thread
File “waitress\channel.py”, line 424, in service
File “waitress\task.py”, line 168, in service
File “waitress\task.py”, line 358, in execute
File “waitress\task.py”, line 307, in write
File “waitress\channel.py”, line 366, in write_soon
File “waitress\server.py”, line 331, in pull_trigger
File “waitress\trigger.py”, line 96, in pull_trigger
File “waitress\trigger.py”, line 203, in _physical_pull
OSError: [WinError 10038] An operation was attempted on something that is not a socket

Probably something else running on your machine. Possible debug steps: I have been trying reconnect but ain't happening

1 Like

I’m not sure but maybe Anki 2.1.15 will work out-of-the-box.

Also try running Anki from pip to provide a bit more maybe useful information, or maybe it’ll be a dead end.

To do it,

  1. Install Python 3.8 or 3.9 from https://www.python.org/

    During the installation process, mark the checkbox “Add Python 3.8 to PATH”.

  2. Open a Command Prompt window (“cmd”).

  3. Install Anki - https://github.com/ankitects/anki/blob/main/docs/development.md#pre-built-python-wheels

  4. Open C:\pyenv\Lib\site-packages\waitress\trigger.py in any text editor (Sublime Text, Visual Studio Code, Notepad++, …) and replace lines #202-203

            def _physical_pull(self):
                self.trigger.send(b"x")
    

    with:

            def _physical_pull(self):
                print(self.trigger)
                self.trigger.send(b"x")
    
  5. Save the edited file and run Anki with \pyenv\scripts\anki

The console window will contain a couple of lines similar to

<socket.socket fd=1360, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=(‘127.0.0.1’, 55433), raddr=(‘127.0.0.1’, 55432)>

but in your case it probably will be something else, maybe

<socket.socket [closed] fd=-1, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0>

I’m not sure what to do next in this case. Maybe try to turn off your antivirus or firewall, if you use any, or maybe try to run a few tests by downloading a slight modified version of waitress/tests/test_server.py at 4b6b5832f3a30d82dc8cb359cf04d2a8edf6712b · Pylons/waitress · GitHub from https://gist.github.com/kelciour/8186c66d891f20866fa24053bc074aca and run it with cmd using \pyenv\Scripts\python "<path to the file>\test_server.py" -v

For example, by typing first \pyenv\Scripts\python , then drag-and-dropping test_server.py from the Explorer and adding -v

1 Like

I have tried to run anki as intructioned in your link

I typed set ANKIDEV=1 & cd \program files\anki & anki-console in cmd.

It opens and shows the buttons, still it doesn’t work. I tried to create a new deck, once I hit enter, nothing appeared and then all the buttons were not working. Strangely, the toolbar was still working.

I downloaded the version suggested by you. When I try to add a new deck, I press the button “add” and it doesn’t work. Meanwhile the option buttons for the deck are working properly.
Why is that?

If you installed some add-ons, try to start Anki while holding down the shift key.

If you installed anki-2.1.15-windows.exe, try installing anki-2.1.15-windows-alternate.exe and anki 2.0.52 - https://github.com/ankitects/anki/releases/tag/2.0.52.

another problem I didn’t mention, whenever I try to open an anki version, my internet is crashing for a couple minutes. but only on my pc. Why is that happening?

No idea, but it’s probably something else running on your PC and it’s just a coincidence or maybe it a bug in Windows and try installing ane pending Windows updates to make sure that your PC is up-to-date.

it’s not a coincidence. It also started to happen in downloading torrents with utorrent web a while ago

same issue is here with me

Aside from early suggestions, running Anki from cmd with set ANKIDEV=1 & cd \program files\anki & anki-console to check the output for any error messages, running Anki with Python and running test-waitress-anki.py with Python IDLE Shell to try to reproduce the issue without Anki,

test-waitress-anki.py
import os

try:
    from waitress.server import create_server
except ImportError:
    import subprocess, sys
    python_executable = sys.executable.replace('pythonw.exe', 'python.exe')
    subprocess.check_call([python_executable, "-m", "pip", "install", "waitress"])
    from waitress.server import create_server

dummy_app = object()

desired_host = os.getenv("ANKI_API_HOST", "127.0.0.1")
desired_port = int(os.getenv("ANKI_API_PORT", "0"))

server = create_server(
    dummy_app,
    host=desired_host,
    port=desired_port,
    clear_untrusted_proxy_headers=True,
)

print("[DEBUG] Serving on http://%s:%s" % (server.effective_host, server.effective_port))
print('[DEBUG] Trigger 1:', server.trigger)
print('[DEBUG] Trigger 2:', server.trigger.trigger)
print("[DEBUG] _physical_pull: start")
server.pull_trigger()
print("[DEBUG] _physical_pull: end")

https://gist.github.com/kelciour/630f003538555e863e4e591aee732203

output

изображение

the latest probably working version without this issue should be Release 2.1.26 · ankitects/anki · GitHub

it says that C:\Users\my name>set ANKIDEV=1 & cd \program files\anki & anki-console
'anki-console' is not recognized as an internal or external command,
operable program or batch file.

Maybe your installation folder on Windows isn’t C:\Program Files\Anki. You could try to run the same command separately line by line.

  • set ANKIDEV=1

  • cd \program files\anki

  • anki-console

but it should fail on the second step (cd ...) with the message, “The system cannot find the path specified.”

In this case, locate the Anki’s installation folder (with anki.exe and anki-console.exe), open cmd from the address bar and run:

set ANKIDEV=1 & anki-console.exe

I did the steps separately and it worked. I opened the anki as said and that’s what I get:


I also tried running anki with py as indicated on the forum’s instructions and idk, it just stops like that, without actually running it:

I am a complete noob when it comes to py and programming, so excuse me haha

Can’t run any versions either (2.1.48, .49 nor beta) …running Windows 11.
Starting in CMD as admin I get this output:
Qt info:

GLImplementation:
Surface Type: OpenGL
Surface Profile: NoProfile
Surface Version: 3.0
Using Default SG Backend: yes
Using Software Dynamic GL: yes
Using Angle: no

Init Parameters:

  • application-name Anki
  • browser-subprocess-path C:\Program Files\Anki\lib\PyQt6\Qt6\bin\QtWebEngineProcess.exe
  • disable-features DnsOverHttpsUpgrade,ConsolidatedMovementXY,InstalledApp,BackgroundFetch,WebOTP,WebPayments,WebUSB,PictureInPicture
  • disable-gpu
  • disable-speech-api
  • enable-features TracingServiceInProcess
  • enable-threaded-compositing

Qt critical: ARB::createContext: wglCreateContextAttribsARB() failed (GL error code: 0x0) for format: QSurfaceFormat(version 2.0, options QFlagsQSurfaceFormat::FormatOption(), depthBufferSize 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 1, colorSpace QColorSpace(), profile QSurfaceFormat::NoProfile), shared context: 0x1 (Der Vorgang wurde erfolgreich beendet.)
Qt critical: GDI::createContext: wglCreateContext failed. (Der Vorgang wurde erfolgreich beendet.)
Qt warning: Unable to create a GL Context.
Qt fatal: Failed to initialize graphics backend for OpenGL.

Ok…solved my problem. New drivers from opengl.org → Intel helped in my case

1 Like

It looks like 2.1.26 doesn’t work too. It looked good at the beginning, the first requests were successfull (200), but then something happened that resulted in “Request timed out”. It really looks like this is the case here.

If you use any third-party antivirus or proxy, try to turn it off.

Maybe try to run Anki as administrator.

Maybe create a new Windows user and install Anki there.

This was the output after using \anki-venv\scripts\pip install aqt orjson to install Anki. In your case, \anki-venv might be \pyenv.

To run Anki, use

\anki-venv\scripts\anki

https://faqs.ankiweb.net/running-from-python.html

Anki probably won’t start and you’ll see the same error message as with 2.1.46, “OSError: [WinError 10038] An operation was attempted on something that is not a socket”.

Then maybe modify C:\anki-venv\Lib\site-packages\waitress\trigger.py and run Anki with

set ANKIDEV=1 & \anki-venv\scripts\anki

and use test_server.py to run a few checks.

https://forums.ankiweb.net/t/i-cant-use-any-anki-version/12639/3

Maybe the output will provide some additional information on what’s wrong.

2 Likes

I’m really dumb. I tried running it as said, but it won’t let me type any other command after running the anki script


after I closed anki, i typed the test command and i got this:

I also downloaded that said version of anki and the only difference between the last one installed and this one is that it Fs again with my internet connection

The first screenshot looks good. As far as I understand, running from python works and everything is fine.

About test_server.py, you’ll need to run it the same way as you start Anki, but replace anki with python, i.e. \anki-venv\scripts\python, and you’ll need to put test_server.py to the current folder (C:\Users\<username>) or use the full path.