Hello! there
I’m trying to create a sphere, so write this code in the terminal:
pip3 install vpython
from vpython import *
ball=sphere(radius=2,color=color.red)
I unfortunately got this error message:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/teenoid/.local/lib/python3.9/site-packages/vpython/vpython.py", line 1172, in __init__
super(sphere, self).setup(args)
File "/home/teenoid/.local/lib/python3.9/site-packages/vpython/vpython.py", line 599, in setup
super(standardAttributes, self).__init__()
File "/home/teenoid/.local/lib/python3.9/site-packages/vpython/vpython.py", line 259, in __init__
from .no_notebook import _
File "/home/teenoid/.local/lib/python3.9/site-packages/vpython/no_notebook.py", line 12, in <module>
from autobahn.asyncio.websocket import WebSocketServerProtocol, WebSocketServerFactory
File "/home/teenoid/.local/lib/python3.9/site-packages/autobahn/asyncio/__init__.py", line 32, in <module>
from autobahn.asyncio.websocket import \
File "/home/teenoid/.local/lib/python3.9/site-packages/autobahn/asyncio/websocket.py", line 36, in <module>
from autobahn.util import public, hltype
File "/home/teenoid/.local/lib/python3.9/site-packages/autobahn/util.py", line 49, in <module>
from OpenSSL import SSL
File "/usr/lib/python3/dist-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import crypto, SSL
File "/usr/lib/python3/dist-packages/OpenSSL/crypto.py", line 1556, in <module>
class X509StoreFlags(object):
File "/usr/lib/python3/dist-packages/OpenSSL/crypto.py", line 1577, in X509StoreFlags
CB_ISSUER_CHECK = _lib.X509_V_FLAG_CB_ISSUER_CHECK
AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'
>>> python3
Exception ignored in: <function standardAttributes.__del__ at 0xb61644f0>
Traceback (most recent call last):
File "/home/teenoid/.local/lib/python3.9/site-packages/vpython/vpython.py", line 1159, in __del__
super(standardAttributes, self).__del__()
File "/home/teenoid/.local/lib/python3.9/site-packages/vpython/vpython.py", line 340, in __del__
cmd = {"cmd": "delete", "idx": self.idx}
AttributeError: 'sphere' object has no attribute 'idx'
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'python3' is not defined
>>>
exit
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/home/teenoid/.local/lib/python3.9/site-packages/vpython/vpython.py", line 22, in Exit
a = 1.0/zero
ZeroDivisionError: float division by zero
teenoid@raspberrypi:~/Exercises $ python3
Python 3.9.2 (default, Mar 12 2021, 04:06:34)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import vpython
im>>> import numpy
>>> from vpython import *
>>> ball=sphere(radius=2,color=color.red)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/teenoid/.local/lib/python3.9/site-packages/vpython/vpython.py", line 1172, in __init__
super(sphere, self).setup(args)
File "/home/teenoid/.local/lib/python3.9/site-packages/vpython/vpython.py", line 599, in setup
super(standardAttributes, self).__init__()
File "/home/teenoid/.local/lib/python3.9/site-packages/vpython/vpython.py", line 259, in __init__
from .no_notebook import _
File "/home/teenoid/.local/lib/python3.9/site-packages/vpython/no_notebook.py", line 12, in <module>
from autobahn.asyncio.websocket import WebSocketServerProtocol, WebSocketServerFactory
File "/home/teenoid/.local/lib/python3.9/site-packages/autobahn/asyncio/__init__.py", line 32, in <module>
from autobahn.asyncio.websocket import \
File "/home/teenoid/.local/lib/python3.9/site-packages/autobahn/asyncio/websocket.py", line 36, in <module>
from autobahn.util import public, hltype
File "/home/teenoid/.local/lib/python3.9/site-packages/autobahn/util.py", line 49, in <module>
from OpenSSL import SSL
File "/usr/lib/python3/dist-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import crypto, SSL
File "/usr/lib/python3/dist-packages/OpenSSL/crypto.py", line 1556, in <module>
class X509StoreFlags(object):
File "/usr/lib/python3/dist-packages/OpenSSL/crypto.py", line 1577, in X509StoreFlags
CB_ISSUER_CHECK = _lib.X509_V_FLAG_CB_ISSUER_CHECK
AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'
>>>
exit
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/home/teenoid/.local/lib/python3.9/site-packages/vpython/vpython.py", line 22, in Exit
a = 1.0/zero
ZeroDivisionError: float division by zero
Exception ignored in: <function standardAttributes.__del__ at 0xb618d4f0>
Traceback (most recent call last):
File "/home/teenoid/.local/lib/python3.9/site-packages/vpython/vpython.py", line 1159, in __del__
super(standardAttributes, self).__del__()
File "/home/teenoid/.local/lib/python3.9/site-packages/vpython/vpython.py", line 340, in __del__
cmd = {"cmd": "delete", "idx": self.idx}
AttributeError: 'sphere' object has no attribute 'idx'
So I took the following steps to try fix this error:
- Head to Stackoverflow & followed the instructions here python - AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK' - Stack Overflow
- Typed in the below commands (that I found in the Stackoverflow post above) in my terminal:
pip install pip --upgrade
pip install pyopenssl --upgrade
sudo apt-get --reinstall install python-apt
sudo apt-get --reinstall install apt-transport-https
sudo apt-get install build-essential libssl-dev libffi-dev python-dev
Note: As a newbie, have no idea what these commands mean, I just wanted to try and see if they worked.
- I then typed this into my terminal again to see if the Stackoverflow instructions worked:
from vpython import *
ball=sphere(radius=2,color=color.red)
- I get the same error message I received the first time (the one I pasted at the top of this post)
Why am I receiving this error message? And is there a way to get my red sphere to appear with my Pi?
Thanks!