<p dir="auto">A clear and concise description of what the bug is.</p>
<h3 dir="auto">Process</h3>
<ol dir="auto">
<li>Using Ubuntu 22.04.5, MiniConda, Python3.8</li>
<li>install superset</li>
<li>superset db upgrade</li>
</ol>
<h3 dir="auto">Actual results</h3>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):
  File &quot;/home/chick/miniconda3/envs/py38/bin/superset&quot;, line 5, in &lt;module&gt;
    from superset.cli.main import superset
  File &quot;/home/chick/miniconda3/envs/py38/lib/python3.8/site-packages/superset/__init__.py&quot;, line 21, in &lt;module&gt;
    from superset.app import create_app
  File &quot;/home/chick/miniconda3/envs/py38/lib/python3.8/site-packages/superset/app.py&quot;, line 23, in &lt;module&gt;
    from superset.initialization import SupersetAppInitializer
  File &quot;/home/chick/miniconda3/envs/py38/lib/python3.8/site-packages/superset/initialization/__init__.py&quot;, line 33, in &lt;module&gt;
    from superset.extensions import (
  File &quot;/home/chick/miniconda3/envs/py38/lib/python3.8/site-packages/superset/extensions/__init__.py&quot;, line 32, in &lt;module&gt;
    from superset.utils.cache_manager import CacheManager
  File &quot;/home/chick/miniconda3/envs/py38/lib/python3.8/site-packages/superset/utils/cache_manager.py&quot;, line 24, in &lt;module&gt;
    from superset.utils.core import DatasourceType
  File &quot;/home/chick/miniconda3/envs/py38/lib/python3.8/site-packages/superset/utils/core.py&quot;, line 76, in &lt;module&gt;
    from cryptography.hazmat.backends.openssl.x509 import _Certificate
ModuleNotFoundError: No module named 'cryptography.hazmat.backends.openssl.x509'"><pre class="notranslate">Traceback (most recent call last):
  File <span class="pl-s"><span class="pl-pds">"</span>/home/chick/miniconda3/envs/py38/bin/superset<span class="pl-pds">"</span></span>, line 5, <span class="pl-k">in</span> <span class="pl-k">&lt;</span>module<span class="pl-k">&gt;</span>
    from superset.cli.main import superset
  File <span class="pl-s"><span class="pl-pds">"</span>/home/chick/miniconda3/envs/py38/lib/python3.8/site-packages/superset/__init__.py<span class="pl-pds">"</span></span>, line 21, <span class="pl-k">in</span> <span class="pl-k">&lt;</span>module<span class="pl-k">&gt;</span>
    from superset.app import create_app
  File <span class="pl-s"><span class="pl-pds">"</span>/home/chick/miniconda3/envs/py38/lib/python3.8/site-packages/superset/app.py<span class="pl-pds">"</span></span>, line 23, <span class="pl-k">in</span> <span class="pl-k">&lt;</span>module<span class="pl-k">&gt;</span>
    from superset.initialization import SupersetAppInitializer
  File <span class="pl-s"><span class="pl-pds">"</span>/home/chick/miniconda3/envs/py38/lib/python3.8/site-packages/superset/initialization/__init__.py<span class="pl-pds">"</span></span>, line 33, <span class="pl-k">in</span> <span class="pl-k">&lt;</span>module<span class="pl-k">&gt;</span>
    from superset.extensions import (
  File <span class="pl-s"><span class="pl-pds">"</span>/home/chick/miniconda3/envs/py38/lib/python3.8/site-packages/superset/extensions/__init__.py<span class="pl-pds">"</span></span>, line 32, <span class="pl-k">in</span> <span class="pl-k">&lt;</span>module<span class="pl-k">&gt;</span>
    from superset.utils.cache_manager import CacheManager
  File <span class="pl-s"><span class="pl-pds">"</span>/home/chick/miniconda3/envs/py38/lib/python3.8/site-packages/superset/utils/cache_manager.py<span class="pl-pds">"</span></span>, line 24, <span class="pl-k">in</span> <span class="pl-k">&lt;</span>module<span class="pl-k">&gt;</span>
    from superset.utils.core import DatasourceType
  File <span class="pl-s"><span class="pl-pds">"</span>/home/chick/miniconda3/envs/py38/lib/python3.8/site-packages/superset/utils/core.py<span class="pl-pds">"</span></span>, line 76, <span class="pl-k">in</span> <span class="pl-k">&lt;</span>module<span class="pl-k">&gt;</span>
    from cryptography.hazmat.backends.openssl.x509 import _Certificate
ModuleNotFoundError: No module named <span class="pl-s"><span class="pl-pds">'</span>cryptography.hazmat.backends.openssl.x509<span class="pl-pds">'</span></span></pre></div>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Ubuntu 22.04.5,</li>
<li>MiniConda,</li>
<li>Python3.8</li>
</ul>
<p dir="auto">Trying to install Superset 2.0.1 in a fresh Python 3.8.10 virtual environment fails with ModuleNotFoundError.</p>
<h4 dir="auto">How to reproduce the bug</h4>
<div class="highlight highlight-text-shell-session notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# su - superset
$ python3.8 -m venv venv
$ source ./venv/bin/activate
$ pip install --upgrade setuptools pip wheel
$ pip install apache-superset==2.0.1
$ export PYTHONPATH=/home/superset
$ export FLASK_APP=superset
$ superset
Traceback (most recent call last):
  File &quot;/home/superset/venv/bin/superset&quot;, line 5, in &lt;module&gt;
    from superset.cli.main import superset
  File &quot;/home/superset/venv/lib/python3.8/site-packages/superset/__init__.py&quot;, line 21, in &lt;module&gt;
    from superset.app import create_app
  File &quot;/home/superset/venv/lib/python3.8/site-packages/superset/app.py&quot;, line 23, in &lt;module&gt;
    from superset.initialization import SupersetAppInitializer
  File &quot;/home/superset/venv/lib/python3.8/site-packages/superset/initialization/__init__.py&quot;, line 33, in &lt;module&gt;
    from superset.extensions import (
  File &quot;/home/superset/venv/lib/python3.8/site-packages/superset/extensions/__init__.py&quot;, line 32, in &lt;module&gt;
    from superset.utils.cache_manager import CacheManager
  File &quot;/home/superset/venv/lib/python3.8/site-packages/superset/utils/cache_manager.py&quot;, line 24, in &lt;module&gt;
    from superset.utils.core import DatasourceType
  File &quot;/home/superset/venv/lib/python3.8/site-packages/superset/utils/core.py&quot;, line 76, in &lt;module&gt;
    from cryptography.hazmat.backends.openssl.x509 import _Certificate
ModuleNotFoundError: No module named 'cryptography.hazmat.backends.openssl.x509'"><pre class="notranslate"># <span class="pl-s1">su - superset</span>
$ <span class="pl-s1">python3.8 -m venv venv</span>
$ <span class="pl-s1"><span class="pl-c1">source</span> ./venv/bin/activate</span>
$ <span class="pl-s1">pip install --upgrade setuptools pip wheel</span>
$ <span class="pl-s1">pip install apache-superset==2.0.1</span>
$ <span class="pl-s1"><span class="pl-k">export</span> PYTHONPATH=/home/superset</span>
$ <span class="pl-s1"><span class="pl-k">export</span> FLASK_APP=superset</span>
$ <span class="pl-s1">superset</span>
<span class="pl-c1">Traceback (most recent call last):</span>
<span class="pl-c1">  File "/home/superset/venv/bin/superset", line 5, in &lt;module&gt;</span>
<span class="pl-c1">    from superset.cli.main import superset</span>
<span class="pl-c1">  File "/home/superset/venv/lib/python3.8/site-packages/superset/__init__.py", line 21, in &lt;module&gt;</span>
<span class="pl-c1">    from superset.app import create_app</span>
<span class="pl-c1">  File "/home/superset/venv/lib/python3.8/site-packages/superset/app.py", line 23, in &lt;module&gt;</span>
<span class="pl-c1">    from superset.initialization import SupersetAppInitializer</span>
<span class="pl-c1">  File "/home/superset/venv/lib/python3.8/site-packages/superset/initialization/__init__.py", line 33, in &lt;module&gt;</span>
<span class="pl-c1">    from superset.extensions import (</span>
<span class="pl-c1">  File "/home/superset/venv/lib/python3.8/site-packages/superset/extensions/__init__.py", line 32, in &lt;module&gt;</span>
<span class="pl-c1">    from superset.utils.cache_manager import CacheManager</span>
<span class="pl-c1">  File "/home/superset/venv/lib/python3.8/site-packages/superset/utils/cache_manager.py", line 24, in &lt;module&gt;</span>
<span class="pl-c1">    from superset.utils.core import DatasourceType</span>
<span class="pl-c1">  File "/home/superset/venv/lib/python3.8/site-packages/superset/utils/core.py", line 76, in &lt;module&gt;</span>
<span class="pl-c1">    from cryptography.hazmat.backends.openssl.x509 import _Certificate</span>
<span class="pl-c1">ModuleNotFoundError: No module named 'cryptography.hazmat.backends.openssl.x509'</span></pre></div>
<p dir="auto">But clearly <code class="notranslate">cryptography</code> is installed:</p>
<div class="highlight highlight-text-shell-session notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ pip install cryptography
Requirement already satisfied: cryptography in ./venv/lib/python3.8/site-packages (39.0.0)
Requirement already satisfied: cffi&gt;=1.12 in ./venv/lib/python3.8/site-packages (from cryptography) (1.15.1)
Requirement already satisfied: pycparser in ./venv/lib/python3.8/site-packages (from cffi&gt;=1.12-&gt;cryptography) (2.21)"><pre class="notranslate">$ <span class="pl-s1">pip install cryptography</span>
<span class="pl-c1">Requirement already satisfied: cryptography in ./venv/lib/python3.8/site-packages (39.0.0)</span>
<span class="pl-c1">Requirement already satisfied: cffi&gt;=1.12 in ./venv/lib/python3.8/site-packages (from cryptography) (1.15.1)</span>
<span class="pl-c1">Requirement already satisfied: pycparser in ./venv/lib/python3.8/site-packages (from cffi&gt;=1.12-&gt;cryptography) (2.21)</span></pre></div>
<h3 dir="auto">Expected results</h3>
<p dir="auto">Superset runs.</p>
<h3 dir="auto">Actual results</h3>
<p dir="auto">ModuleNotFoundError from Python.</p>
<h3 dir="auto">Environment</h3>
<p dir="auto">System is Ubuntu 20.04 "focal" with Python 3.8.10.</p>
<h3 dir="auto">Checklist</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the superset logs for python stacktraces and included it here as text if there are any.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have reproduced the issue with at least the latest released version of superset.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the issue tracker for the same issue and I haven't found one similar.</li>
</ul>
<h3 dir="auto">Additional context</h3>
<p dir="auto">The system is currently running Superset 2.0.0 fine in another virtualenv.</p>