Vypython: AttributeError: 'box' object has no attribute 'idx' - python-3.x

I am new to vpython and trying to learn. However, right after installing the module with "pip install vpython" and making a python file that contains this :
from vpython import *
box()
I am greeted with an error:
Traceback (most recent call last):
File "C:/Users/remis/Downloads/Test Vpython.py", line 2, in <module>
box()
File "C:\Users\remis\AppData\Local\Programs\Python\Python38\lib\site-packages\vpython\vpython.py", line 1099, in __init__
super(box, self).setup(args)
File "C:\Users\remis\AppData\Local\Programs\Python\Python38\lib\site-packages\vpython\vpython.py", line 579, in setup
super(standardAttributes, self).__init__()
File "C:\Users\remis\AppData\Local\Programs\Python\Python38\lib\site-packages\vpython\vpython.py", line 236, in __init__
from .no_notebook import _
File "C:\Users\remis\AppData\Local\Programs\Python\Python38\lib\site-packages\vpython\no_notebook.py", line 271, in <module>
__w = threading.Thread(target=__server.serve_forever)
NameError: name '__server' is not defined
Exception ignored in: <function standardAttributes.__del__ at 0x00000182B9D4EAF0>
Traceback (most recent call last):
File "C:\Users\remis\AppData\Local\Programs\Python\Python38\lib\site-packages\vpython\vpython.py", line 1092, in __del__
super(standardAttributes, self).__del__()
File "C:\Users\remis\AppData\Local\Programs\Python\Python38\lib\site-packages\vpython\vpython.py", line 317, in __del__
cmd = {"cmd": "delete", "idx": self.idx}
AttributeError: 'box' object has no attribute 'idx'
I don't see any help online, can I get some please?

Related

When i run webdriver, the following error happens

Traceback (most recent call last):
File "C:\Users\Njoroge\OneDrive\Desktop\FollowerBot-main\FollowerBot-main\get_instagram_followers.py", line 46, in <module>
ig.setup()
File "C:\Users\Njoroge\OneDrive\Desktop\FollowerBot-main\FollowerBot-main\get_instagram_followers.py", line 13, in setup
Setup.init(self)
File "C:\Users\Njoroge\OneDrive\Desktop\FollowerBot-main\FollowerBot-main\init.py", line 15, in init
self.browser = uc.Chrome(options=chrome_options, version_main=108)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python311\Lib\site-packages\undetected_chromedriver\__init__.py", line 53, in __new__
instance.__init__(*args, **kwargs)
TypeError: WebDriver.__init__() got an unexpected keyword argument 'version_main'
help please, i think its about my chrome version but its up to date.

Attribute error: comtypes has no module named ISpeech

Traceback (most recent call last):
File "C:\Users\ammar\AppData\Local\Programs\Python\Python310\lib\site-packages\pyttsx3\__init__.py", line 20, in init
eng = _activeEngines[driverName]
File "C:\Users\ammar\AppData\Local\Programs\Python\Python310\lib\weakref.py", line 137, in __getitem__
o = self.data[key]()
KeyError: None
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "h:\My Drive\Semester 6\Artificial Intelligence\JARVIS\jarvis.py", line 7, in <module>
engine = pt.init()
File "C:\Users\ammar\AppData\Local\Programs\Python\Python310\lib\site-packages\pyttsx3\__init__.py", line 22, in init
eng = Engine(driverName, debug)
File "C:\Users\ammar\AppData\Local\Programs\Python\Python310\lib\site-packages\pyttsx3\engine.py", line 30, in __init__
self.proxy = driver.DriverProxy(weakref.proxy(self), driverName, debug)
File "C:\Users\ammar\AppData\Local\Programs\Python\Python310\lib\site-packages\pyttsx3\driver.py", line 52, in __init__
self._driver = self._module.buildDriver(weakref.proxy(self))
File "C:\Users\ammar\AppData\Local\Programs\Python\Python310\lib\site-packages\pyttsx3\drivers\sapi5.py", line 30, in buildDriver
return SAPI5Driver(proxy)
File "C:\Users\ammar\AppData\Local\Programs\Python\Python310\lib\site-packages\pyttsx3\drivers\sapi5.py", line 35, in __init__
self._tts = comtypes.client.CreateObject('SAPI.SPVoice')
File "C:\Users\ammar\AppData\Local\Programs\Python\Python310\lib\site-packages\comtypes\client\__init__.py", line 250, in CreateObject
return _manage(obj, clsid, interface=interface)
File "C:\Users\ammar\AppData\Local\Programs\Python\Python310\lib\site-packages\comtypes\client\__init__.py", line 188, in _manage
obj = GetBestInterface(obj)
File "C:\Users\ammar\AppData\Local\Programs\Python\Python310\lib\site-packages\comtypes\client\__init__.py", line 112, in GetBestInterface
interface = getattr(mod, itf_name)
AttributeError: module 'comtypes.gen.SpeechLib' has no attribute 'ISpeechVoice'
I have also tried re-installing Python and upgrading comtypes but everytime I get the same error. The program was working fine before I installed opencv-python. I have tried uninstalling it too but it doesn't make any difference.

I Can't create a window in pyglet

I have just installed pyglet on my machine. But I can't seem to create a window
here's what I tried
import pyglet
window = pyglet.window.Window()
pyglet.app.run()
and it gives me this error when I run
Traceback (most recent call last):
File "c:/Users/Public/Documents/vscode/python/Games/Pyglet/main.py", line 3, in <module>
window = pyglet.window.Window()
File "C:\Users\DELL\AppData\Roaming\Python\Python38\site-packages\pyglet\window\win32\__init__.py", line 132, in __init__
super(Win32Window, self).__init__(*args, **kwargs)
File "C:\Users\DELL\AppData\Roaming\Python\Python38\site-packages\pyglet\window\__init__.py", line 648, in __init__
self._create()
File "C:\Users\DELL\AppData\Roaming\Python\Python38\site-packages\pyglet\window\win32\__init__.py", line 274, in _create
self.context.attach(self.canvas)
File "C:\Users\DELL\AppData\Roaming\Python\Python38\site-packages\pyglet\gl\win32.py", line 238, in attach
raise gl.ContextException('Unable to share contexts.')
pyglet.gl.ContextException: Unable to share contexts.

Whenever i tried to connect my psql through flask i got an contrib error

flask.cli.NoAppException
NoAppException: While importing "application", an ImportError was raised:
Traceback (most recent call last):
File "/home/shwet/.local/lib/python2.7/site-packages/flask/cli.py", line 240, in locate_app
__import__(module_name)
File "/home/shwet/sr/WebDevlopment/lecture3/project1/application.py", line 17, in <module>
Session(app)
File "/home/shwet/.local/lib/python2.7/site-packages/flask_session/__init__.py", line 54, in __init__
self.init_app(app)
File "/home/shwet/.local/lib/python2.7/site-packages/flask_session/__init__.py", line 61, in init_app
app.session_interface = self._get_interface(app)
File "/home/shwet/.local/lib/python2.7/site-packages/flask_session/__init__.py", line 93, in _get_interface
config['SESSION_USE_SIGNER'], config['SESSION_PERMANENT'])
File "/home/shwet/.local/lib/python2.7/site-packages/flask_session/sessions.py", line 313, in __init__
from werkzeug.contrib.cache import FileSystemCache
ImportError: No module named contrib.cache

Yahoo_Finance Package for Python - Share() does not work anymore

Since today I am experiencing some errors caused by the yahoo_finance package version 1.4.
Here is a code example that is causing the error:
from yahoo_finance import Share
Apple = Share("AAPL")
Results in the following Error:
Traceback (most recent call last):
File "C:\Users\Julian\Anaconda3\lib\site-packages\yahoo_finance\__init__.py", line 120, in _request
_, results = response['query']['results'].popitem()
AttributeError: 'NoneType' object has no attribute 'popitem'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Julian\Anaconda3\lib\site-packages\yahoo_finance\__init__.py", line 123, in _request
raise YQLQueryError(response['error']['description'])
KeyError: 'error'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Julian\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2881, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-3-44fc1f59aa21>", line 1, in <module>
Apple = Share("AAPL")
File "C:\Users\Julian\Anaconda3\lib\site-packages\yahoo_finance\__init__.py", line 178, in __init__
self.refresh()
File "C:\Users\Julian\Anaconda3\lib\site-packages\yahoo_finance\__init__.py", line 142, in refresh
self.data_set = self._fetch()
File "C:\Users\Julian\Anaconda3\lib\site-packages\yahoo_finance\__init__.py", line 181, in _fetch
data = super(Share, self)._fetch()
File "C:\Users\Julian\Anaconda3\lib\site-packages\yahoo_finance\__init__.py", line 134, in _fetch
data = self._request(query)
File "C:\Users\Julian\Anaconda3\lib\site-packages\yahoo_finance\__init__.py", line 125, in _request
raise YQLResponseMalformedError()
yahoo_finance.YQLResponseMalformedError: Response malformed.
Do you experience similar issues or is this only an issue for me personally?
Thank you for your replies.
If yes - what are potential fixes for this issue?

Resources