Anki AssertionError learning - python

Hi I have a problem with anki when using it I get the following error.
Anki 2.1.49 (dc80804a) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=False sv=2
Add-ons, last update check: 2021-12-02 12:41:47
Caught exception:
Traceback (most recent call last):
File “aqt\webview.py”, line 41, in cmd
File “aqt\webview.py”, line 142, in _onCmd
File “aqt\webview.py”, line 595, in _onBridgeCmd
File “aqt\reviewer.py”, line 503, in _linkHandler
File “aqt\reviewer.py”, line 423, in _answerCard
File “aqt\reviewer.py”, line 430, in _after_answering
File “aqt\reviewer.py”, line 211, in nextCard
File “aqt\reviewer.py”, line 317, in _showQuestion
File “anki\cards.py”, line 184, in autoplay
File “anki\decks.py”, line 309, in config_dict_for_deck_id
AssertionError

Related

ray.tune.error.TuneError: The Ray Tune run failed

This is from the ray package official code, it works well on Linux systems but appears some errors on windows. All of the ray version is 2.2.0.
import numpy as np
import ray
from ray import air, tune
from ray.air import session
from ray.air.integrations.wandb import setup_wandb
from ray.air.integrations.wandb import WandbLoggerCallback
def train_function(config):
for i in range(30):
loss = config["mean"] + config["sd"] * np.random.randn()
session.report({"loss": loss})
def tune_with_callback():
"""Example for using a WandbLoggerCallback with the function API"""
tuner = tune.Tuner(
train_function,
tune_config=tune.TuneConfig(
metric="loss",
mode="min"
),
run_config=air.RunConfig(
callbacks=[
WandbLoggerCallback(project="Wandb_example")
]
),
param_space={
"mean": tune.grid_search([1, 2, 3, 4, 5]),
"sd": tune.uniform(0.2, 0.8),
},
)
tuner.fit()
if __name__ == '__main__':
tune_with_callback()
And this is printed log with running above python code:
2022-12-30 11:50:41,732 INFO worker.py:1538 -- Started a local Ray instance.
2022-12-30 11:50:46,508 INFO wandb.py:250 -- Already logged into W&B.
Traceback (most recent call last):
File "C:\Users\shaohan.tian\scoop\apps\miniconda3\current\envs\steel\lib\site-packages\ray\tune\execution\trial_runner.py", line 928, in _wait_and_handle_event
self._on_pg_ready(next_trial)
File "C:\Users\shaohan.tian\scoop\apps\miniconda3\current\envs\steel\lib\site-packages\ray\tune\execution\trial_runner.py", line 1018, in _on_pg_ready
if not _start_trial(next_trial) and next_trial.status != Trial.ERROR:
File "C:\Users\shaohan.tian\scoop\apps\miniconda3\current\envs\steel\lib\site-packages\ray\tune\execution\trial_runner.py", line 1010, in _start_trial
self._callbacks.on_trial_start(
File "C:\Users\shaohan.tian\scoop\apps\miniconda3\current\envs\steel\lib\site-packages\ray\tune\callback.py", line 317, in on_trial_start
callback.on_trial_start(**info)
File "C:\Users\shaohan.tian\scoop\apps\miniconda3\current\envs\steel\lib\site-packages\ray\tune\logger\logger.py", line 135, in on_trial_start
self.log_trial_start(trial)
File "C:\Users\shaohan.tian\scoop\apps\miniconda3\current\envs\steel\lib\site-packages\ray\air\integrations\wandb.py", line 527, in log_trial_start
self._trial_processes[trial].start()
File "C:\Users\shaohan.tian\scoop\apps\miniconda3\current\envs\steel\lib\multiprocessing\process.py", line 121, in start
self._popen = self._Popen(self)
File "C:\Users\shaohan.tian\scoop\apps\miniconda3\current\envs\steel\lib\multiprocessing\context.py", line 224, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "C:\Users\shaohan.tian\scoop\apps\miniconda3\current\envs\steel\lib\multiprocessing\context.py", line 327, in _Popen
return Popen(process_obj)
File "C:\Users\shaohan.tian\scoop\apps\miniconda3\current\envs\steel\lib\multiprocessing\popen_spawn_win32.py", line 93, in __init__
reduction.dump(process_obj, to_child)
File "C:\Users\shaohan.tian\scoop\apps\miniconda3\current\envs\steel\lib\multiprocessing\reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
File "C:\Users\shaohan.tian\scoop\apps\miniconda3\current\envs\steel\lib\site-packages\ray\air\integrations\wandb.py", line 367, in __reduce__
raise RuntimeError("_WandbLoggingProcess is not pickleable.")
RuntimeError: _WandbLoggingProcess is not pickleable.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\shaohan.tian\scoop\apps\miniconda3\current\envs\steel\lib\site-packages\ray\tune\tuner.py", line 272, in fit
return self._local_tuner.fit()
File "C:\Users\shaohan.tian\scoop\apps\miniconda3\current\envs\steel\lib\site-packages\ray\tune\impl\tuner_internal.py", line 420, in fit
analysis = self._fit_internal(trainable, param_space)
File "C:\Users\shaohan.tian\scoop\apps\miniconda3\current\envs\steel\lib\site-packages\ray\tune\impl\tuner_internal.py", line 532, in _fit_internal
analysis = run(
File "C:\Users\shaohan.tian\scoop\apps\miniconda3\current\envs\steel\lib\site-packages\ray\tune\tune.py", line
726, in run
runner.step()
File "C:\Users\shaohan.tian\scoop\apps\miniconda3\current\envs\steel\lib\site-packages\ray\tune\execution\trial_runner.py", line 981, in step
self._wait_and_handle_event(next_trial)
File "C:\Users\shaohan.tian\scoop\apps\miniconda3\current\envs\steel\lib\site-packages\ray\tune\execution\trial_runner.py", line 960, in _wait_and_handle_event
raise TuneError(traceback.format_exc())
ray.tune.error.TuneError: Traceback (most recent call last):
File "C:\Users\shaohan.tian\scoop\apps\miniconda3\current\envs\steel\lib\site-packages\ray\tune\execution\trial_runner.py", line 928, in _wait_and_handle_event
self._on_pg_ready(next_trial)
File "C:\Users\shaohan.tian\scoop\apps\miniconda3\current\envs\steel\lib\site-packages\ray\tune\execution\trial_runner.py", line 1018, in _on_pg_ready
if not _start_trial(next_trial) and next_trial.status != Trial.ERROR:
File "C:\Users\shaohan.tian\scoop\apps\miniconda3\current\envs\steel\lib\site-packages\ray\tune\execution\trial_runner.py", line 1010, in _start_trial
self._callbacks.on_trial_start(
File "C:\Users\shaohan.tian\scoop\apps\miniconda3\current\envs\steel\lib\site-packages\ray\tune\callback.py", line 317, in on_trial_start
callback.on_trial_start(**info)
File "C:\Users\shaohan.tian\scoop\apps\miniconda3\current\envs\steel\lib\site-packages\ray\tune\logger\logger.py", line 135, in on_trial_start
self.log_trial_start(trial)
File "C:\Users\shaohan.tian\scoop\apps\miniconda3\current\envs\steel\lib\site-packages\ray\air\integrations\wandb.py", line 527, in log_trial_start
self._trial_processes[trial].start()
File "C:\Users\shaohan.tian\scoop\apps\miniconda3\current\envs\steel\lib\multiprocessing\process.py", line 121, in start
self._popen = self._Popen(self)
File "C:\Users\shaohan.tian\scoop\apps\miniconda3\current\envs\steel\lib\multiprocessing\context.py", line 224, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "C:\Users\shaohan.tian\scoop\apps\miniconda3\current\envs\steel\lib\multiprocessing\context.py", line 327, in _Popen
return Popen(process_obj)
File "C:\Users\shaohan.tian\scoop\apps\miniconda3\current\envs\steel\lib\multiprocessing\popen_spawn_win32.py", line 93, in __init__
reduction.dump(process_obj, to_child)
File "C:\Users\shaohan.tian\scoop\apps\miniconda3\current\envs\steel\lib\multiprocessing\reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
File "C:\Users\shaohan.tian\scoop\apps\miniconda3\current\envs\steel\lib\site-packages\ray\air\integrations\wandb.py", line 367, in __reduce__
raise RuntimeError("_WandbLoggingProcess is not pickleable.")
RuntimeError: _WandbLoggingProcess is not pickleable.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\shaohan.tian\Desktop\laptop_python_run\wandb_test.py", line 36, in <module>
tune_with_callback()
File "C:\Users\shaohan.tian\Desktop\laptop_python_run\wandb_test.py", line 33, in tune_with_callback
tuner.fit()
File "C:\Users\shaohan.tian\scoop\apps\miniconda3\current\envs\steel\lib\site-packages\ray\tune\tuner.py", line 274, in fit
raise TuneError(
ray.tune.error.TuneError: The Ray Tune run failed. Please inspect the previous error messages for a cause. After
fixing the issue, you can restart the run from scratch or continue this run. To continue this run, you can use `tuner = Tuner.restore("C:\Users\shaohan.tian\ray_results\train_function_2022-12-30_11-50-36")`.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\shaohan.tian\scoop\apps\miniconda3\current\envs\steel\lib\multiprocessing\spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "C:\Users\shaohan.tian\scoop\apps\miniconda3\current\envs\steel\lib\multiprocessing\spawn.py", line 126, in _main
self = reduction.pickle.load(from_parent)
EOFError: Ran out of input
I tried modifying versions of ray and wandb, but it was of no use. Could you help me to solve it?

Why does python p5 give so much errors and warnings?

I'm trying to use the Python Processing port by Abhik Pal and Manindra Mohrarna. It seems to work fine, but it gives lots of warnings and errors and it really bothers me.
WARNING: Traceback (most recent call last):
File "C:\Users\gabri\Documents\Programmazione\Python\p5Sketchbook\test.py", line 10, in <module>
run()
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\p5\sketch\userspace.py", line 155, in run
p5.sketch = Sketch(setup_method, draw_method, handlers, frame_rate)
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\p5\sketch\base.py", line 60, in __init__
app.Canvas.__init__(
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\app\canvas.py", line 211, in __init__
self.create_native()
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\app\canvas.py", line 228, in create_native
self._app.backend_module.CanvasBackend(self, **self._backend_kwargs)
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\app\backends\_glfw.py", line 298, in __init__
self._on_resize(self._id, size[0], size[1])
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\app\backends\_glfw.py", line 394, in _on_resize
self._vispy_canvas.events.resize(
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\util\event.py", line 453, in __call__
self._invoke_callback(cb, event)
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\util\event.py", line 471, in _invoke_callback
_handle_exception(self.ignore_callback_errors,
<< caught exception here: >>
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\util\event.py", line 469, in _invoke_callback
cb(event)
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\p5\sketch\base.py", line 157, in on_resize
p5.renderer.reset_view()
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\p5\sketch\renderer2d.py", line 82, in reset_view
self.texture_prog['modelview'] = self.modelview_matrix.T.flatten()
TypeError: 'NoneType' object does not support item assignment
ERROR: Invoking <bound method Sketch.on_resize of <Sketch (Glfw) at 0x1fba232bfd0>> for ResizeEvent
Exception ignored on calling ctypes callback function: <function CanvasBackend._on_close at 0x000001FBA2375EA0>
Traceback (most recent call last):
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\glfw\__init__.py", line 660, in callback_wrapper
return func(*args, **kwargs)
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\app\backends\_glfw.py", line 400, in _on_close
self._vispy_canvas.close()
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\app\canvas.py", line 463, in close
self.events.close()
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\util\event.py", line 453, in __call__
self._invoke_callback(cb, event)
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\util\event.py", line 469, in _invoke_callback
cb(event)
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\p5\sketch\base.py", line 148, in on_close
exit()
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\_sitebuiltins.py", line 26, in __call__
raise SystemExit(code)
SystemExit: None
Traceback (most recent call last):
File "C:\Users\gabri\Documents\Programmazione\Python\p5Sketchbook\test.py", line 10, in <module>
run()
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\p5\sketch\userspace.py", line 167, in run
exit()
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\p5\sketch\userspace.py", line 250, in exit
p5.exit(*args, **kwargs)
AttributeError: module 'p5.core.p5' has no attribute 'exit'
Process returned 1 (0x1) execution time : 20.330 s
What does this mean? Why does it happen and is there a way to fix this?

Crash Mitmproxy when turn on mode transparent

I was learning about mitmproxy and trying to run it, I realized that when I ran the following command (admin rights):
mitmdump --mode transparent --ssl-insecure
it would cause mitmproxy crash:
Please lodge a bug report at: https://github.com/mitmproxy/mitmproxy
192.168.1.223:51720: clientdisconnect
192.168.1.223:51722: clientconnect
192.168.1.223:51722: GET https://140.82.113.26/_sockets/u/53718521/ws?session=eyJ2IjoiVjMiLCJ1Ijo1MzcxODUyMSwicyI6NTUzMzc5MDA2LCJjIjoxOTU3MjMyNzE1LCJ0IjoxNTkzNzU3MDg3fQ%3D%3D--4fceba1ee908439bbfbb6dd7ff882aa7f445a82584e481ea2c0a372f3b277360&shared=true
<< 101 Switching Protocols 0b
192.168.1.223:51722: Traceback (most recent call last):
File "c:\python\python38-32\lib\site-packages\mitmproxy\proxy\server.py", line 121, in handle
root_layer()
File "c:\python\python38-32\lib\site-packages\mitmproxy\proxy\modes\transparent_proxy.py", line 19, in __call__
layer()
File "c:\python\python38-32\lib\site-packages\mitmproxy\proxy\protocol\tls.py", line 285, in __call__
layer()
File "c:\python\python38-32\lib\site-packages\mitmproxy\proxy\protocol\http1.py", line 83, in __call__
layer()
File "c:\python\python38-32\lib\site-packages\mitmproxy\proxy\protocol\http.py", line 190, in __call__
if not self._process_flow(flow):
File "c:\python\python38-32\lib\site-packages\mitmproxy\proxy\protocol\http.py", line 449, in _process_flow
layer = WebSocketLayer(self, f)
File "c:\python\python38-32\lib\site-packages\mitmproxy\proxy\protocol\websocket.py", line 71, in __init__
data = self.connections[self.server_conn].send(request)
File "c:\python\python38-32\lib\site-packages\wsproto\connection.py", line 109, in send
raise LocalProtocolError("Event {} cannot be sent.".format(event))
wsproto.utilities.LocalProtocolError: Event Request(host='140.82.113.26', target='/_sockets/u/53718521/ws?session=eyJ2IjoiVjMiLCJ1Ijo1MzcxODUyMSwicyI6NTUzMzc5MDA2LCJjIjoxOTU3MjMyNzE1LCJ0IjoxNTkzNzU3MDg3fQ%3D%3D--4fceba1ee908439bbfbb6dd7ff882aa7f445a82584e481ea2c0a372f3b277360&shared=true', extensions=[<PerMessageDeflate client_max_window_bits=15; client_no_context_takeover; server_max_window_bits=15; server_no_context_takeover>], extra_headers=[], subprotocols=[]) cannot be sent.
Traceback (most recent call last):
File "c:\python\python38-32\lib\site-packages\mitmproxy\proxy\server.py", line 121, in handle
root_layer()
File "c:\python\python38-32\lib\site-packages\mitmproxy\proxy\modes\transparent_proxy.py", line 19, in __call__
layer()
File "c:\python\python38-32\lib\site-packages\mitmproxy\proxy\protocol\tls.py", line 285, in __call__
layer()
File "c:\python\python38-32\lib\site-packages\mitmproxy\proxy\protocol\http1.py", line 83, in __call__
layer()
File "c:\python\python38-32\lib\site-packages\mitmproxy\proxy\protocol\http.py", line 190, in __call__
if not self._process_flow(flow):
File "c:\python\python38-32\lib\site-packages\mitmproxy\proxy\protocol\http.py", line 449, in _process_flow
layer = WebSocketLayer(self, f)
File "c:\python\python38-32\lib\site-packages\mitmproxy\proxy\protocol\websocket.py", line 71, in __init__
data = self.connections[self.server_conn].send(request)
File "c:\python\python38-32\lib\site-packages\wsproto\connection.py", line 109, in send
raise LocalProtocolError("Event {} cannot be sent.".format(event))
wsproto.utilities.LocalProtocolError: Event Request(host='140.82.113.26', target='/_sockets/u/53718521/ws?session=eyJ2IjoiVjMiLCJ1Ijo1MzcxODUyMSwicyI6NTUzMzc5MDA2LCJjIjoxOTU3MjMyNzE1LCJ0IjoxNTkzNzU3MDg3fQ%3D%3D--4fceba1ee908439bbfbb6dd7ff882aa7f445a82584e481ea2c0a372f3b277360&shared=true', extensions=[<PerMessageDeflate client_max_window_bits=15; client_no_context_takeover; server_max_window_bits=15; server_no_context_takeover>], extra_headers=[], subprotocols=[]) cannot be sent.
mitmproxy has crashed!
Can someone help me with this problem? Thanks!
By the way, the version information I'm using is as follows:
Mitmproxy: 5.1.1
Python: 3.8.2
OpenSSL: OpenSSL 1.1.1g 21 Apr 2020
Platform: Windows-10-10.0.18362-SP0

Python pandas script throwing error in python 3.8

Below code is working fine in python version 3.6.6 but when python upgraded to 3.8.1 I am getting error
num = Data["Description"].size
Below error I am getting in Python 3.8.1 version
"Elogmsg" : "Traceback (most recent call last):\n File \"/usr/local/lib/python3.8/site-packages/pandas/core/indexes/base.py\",
line 2897, in get_loc\n return self._engine.get_loc(key)\n File \"pandas/_libs/index.pyx\",
line 107, in pandas._libs.index.IndexEngine.get_loc\n File \"pandas/_libs/index.pyx\",
line 131, in pandas._libs.index.IndexEngine.get_loc\n File \"pandas/_libs/hashtable_class_helper.pxi\",
line 1607, in pandas._libs.hashtable.PyObjectHashTable.get_item\n File \"pandas/_libs/hashtable_class_helper.pxi\",
line 1614, in pandas._libs.hashtable.PyObjectHashTable.get_item\nKeyError: 'Description'\n\nDuring handling of the above exception,
another exception occurred:\n\nTraceback (most recent call last):\n File \"/var/www/Python/Project/march.py\",
line 161, in main\n num = Data["Description"].size\n File \"/usr/local/lib/python3.8/site-packages/pandas/core/frame.py\",
line 2995, in __getitem__\n indexer = self.columns.get_loc(key)\n File \"/usr/local/lib/python3.8/site-packages/pandas/core/indexes/base.py\",
line 2899, in get_loc\n return self._engine.get_loc(self._maybe_cast_indexer(key))\n File \"pandas/_libs/index.pyx\",
line 107, in pandas._libs.index.IndexEngine.get_loc\n File \"pandas/_libs/index.pyx\",
line 131, in pandas._libs.index.IndexEngine.get_loc\n File \"pandas/_libs/hashtable_class_helper.pxi\",
line 1607, in pandas._libs.hashtable.PyObjectHashTable.get_item\n File \"pandas/_libs/hashtable_class_helper.pxi\",
line 1614, in pandas._libs.hashtable.PyObjectHashTable.get_item\nKeyError: 'Description'\n",
Can anyone help me why code is not working in 3.8.1 python version

Jupyter terminats/exits with an error

Recently, whenever I terminate Jupyter by hitting CTRL-C I get the following error:
Traceback (most recent call last):
File "/Users/username/anaconda3/bin/jupyter-notebook", line 6, in <module>
sys.exit(notebook.notebookapp.main())
File "/Users/username/anaconda3/lib/python3.5/site-packages/jupyter_core/application.py", line 267, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/Users/username/anaconda3/lib/python3.5/site-packages/traitlets/config/application.py", line 658, in launch_instance
app.start()
File "/Users/username/anaconda3/lib/python3.5/site-packages/notebook/notebookapp.py", line 1247, in start
self.io_loop.start()
File "/Users/username/anaconda3/lib/python3.5/site-packages/zmq/eventloop/ioloop.py", line 177, in start
super(ZMQIOLoop, self).start()
File "/Users/username/anaconda3/lib/python3.5/site-packages/tornado/ioloop.py", line 862, in start
^C File "/Users/username/anaconda3/lib/python3.5/site-packages/zmq/eventloop/ioloop.py", line 122, in poll
z_events = self._poller.poll(1000*timeout)
File "/Users/username/anaconda3/lib/python3.5/site-packages/zmq/sugar/poll.py", line 99, in poll
return zmq_poll(self.sockets, timeout=timeout)
File "zmq/backend/cython/_poll.pyx", line 123, in zmq.backend.cython._poll.zmq_poll (zmq/backend/cython/_poll.c:2186)
File "zmq/backend/cython/_poll.pyx", line 116, in zmq.backend.cython._poll.zmq_poll (zmq/backend/cython/_poll.c:2036)
File "zmq/backend/cython/checkrc.pxd", line 12, in zmq.backend.cython.checkrc._check_rc (zmq/backend/cython/_poll.c:2418)
File "/Users/username/anaconda3/lib/python3.5/site-packages/conda/gateways/signals.py", line 15, in conda_signal_handler
raise CondaSignalInterrupt(signum)
conda.exceptions.CondaSignalInterrupt: Signal interrupt SIGINT
I tried to search a little for some hint what's the cause or reason but for vain. Therefore, I ask you. Do you know what's the reason?

Categories