Installing Superset from Scratch - apache-superset

There was a problem during installation superset from Scratch:
command: sudo superset fab create-admin
Error:
ImportError: cannot import name 'TypedDict' from 'typing' (/usr/lib/python3.7/typing.py)

From the path in the error message (/usr/lib/python3.7/typing.py), it appears you are using Python 3.7. At the time of writing, Apache Superset requires Python 3.8, 3.9, or 3.10.
Sources: 1 2 3

Related

django-admin --version displays error in virtual environment

After installing Django version 1.9 in a virtual environment using the following command in Windows:
django-admin --version
I receive a long error, ending with:
File "C:\Users\DELL\env\Lib\site-packages\django\db\models\sql\query.py", line 11, in <module>
from collections import Counter, Iterator, Mapping, OrderedDict
ImportError: cannot import name 'Iterator' from 'collections' (C:\Users\DELL\AppData\Local\Programs\Python\Python311\Lib\collections\__init__.py)
Python is installed, and the virtual environment was activated.
Django was installed using pip install django==1.9
What should I do to run the command django-admin --version?
Django 1.9 requires Python 2.7, 3.4, or 3.5..make sure you have installed python version from one of these..
(I have copied the answer that I got)
You are using a very old version of Django and, as a result, your Python is incompatible with it. Django is trying to import Iterator from a Python module, but it was moved long ago from collections to collections.abc and that is why it gives you the ImportError.
You can either upgrade you Django to the current version or change your Python to below version 3.3

I have installed python 3.6 but ubuntu still gives python 2.7 when checked for the version. How do I switch to 3.6?

I have successfully installed the latest Python version 3.6 but when checked for the present version of python using "python -V" command it gives Python 2.7 as output. How can I switch to Python 3.6?
add an alias to .bash_rc and .bash_profile in your home directory after other alias lines near the bottom and the export PATH line respectively as follows:
alias python='/usr/bin/python3.6'
This will direct your profile to use python 3.6 in this example everytime you use python and no need to specify python3. It will not correct the ansible default path however which I am still searching for an answer on how to change that from python2.7 to python3.6.

Unable to import docx in python3

I have installed both python2 and python3 in my windows machine. I wanted to use the python-docx, so I installed it using pip install . But I am unable to use it in python3. I get these results when i try to import in Python2:
]1
In Python3 :
]2
Python packages are installed in a particular Python installation. You have two Python installations and it looks like python-docx is installed in only one of them. What you need to work out is how to target the Python 3 installation for the python-docx install.
This question seems to address how to manage that.

Running Django using python3 in Fedora

I have two versions of python installed in my fedora system. I installed django through pip command utility. Now to confirm my django installation through python3 using the following command
import django
print(django.get-version())
It is giving the message django not found.
But when I run it using the python2.7 shell it verifies that django has been installed. I want to run django using python3 what changes should I make?

Installing django on two existing versions on python

I have both python 2.7 and 3.2 installed on my computer and I wanted to install django. And when I did it automatically installed django 1.4 on python 3. Is there a way I can install it on python 2.7?
You can mention explicitly the python version while installing.
First download the source from django website.
Now extract it to any location and open the terminal and go to the location into the folder. There must be a file named setup.py that is the installation file.Now type:
For Python 3.2
python3.2 setup.py install
For Python 2.7
python2.7 setup.py install
The real answer here is that you should be using virtual environments, as they both solve this particular problem, and are the industry standard because they solve many problems.
Simple process:
install python-virtualenv :
$>sudo apt-get install python-virtualenv # on Ubuntu
create a virtual-env against the Python you want, and activate it
$> virtualenv -p /usr/bin/pythonX ve
$> source ve/bin/activate
install django into this virtual-env
$> pip install django
...
PROFIT!