I had installed my Python 3.6 and streamlit must have installed in this folder and used therefore Python 3.6 even if I later installed 3.9. It now seems logical. I followed your advice and made a virtual env but now I run in the following problem:
File "/usr/local/lib/python3.9/ctypes/__init__.py", line 8, in <module>
from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
I had this on a windows machine once and fixed it by installing the c libraries. I tried ot do something similar on my linux machine. This is what I used to install Python 3.9, I was under the impression that it would include the steps to install the required c libraries:
$ wget https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tgz
$ tar zxvf Python-3.9.0.tgz
$ cd Python-3.9.0
$ sudo yum -y install gcc gcc-c++
$ sudo yum -y install zlib zlib-devel
$ sudo yum -y install libffi-devel
$ sudo ./configure --prefix=/opt/python3
$ sudo make
$ sudo yum install openssl-devel
$ sudo make install
any suggestions how to make the <No module named ‘_ctypes’> error go away?