You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "alonsogtouch (via GitHub)" <gi...@apache.org> on 2023/01/26 09:04:45 UTC

[GitHub] [superset] alonsogtouch commented on issue #22571: ModuleNotFoundError installing Superset 2.0.1 in a fresh virtual environment

alonsogtouch commented on issue #22571:
URL: https://github.com/apache/superset/issues/22571#issuecomment-1404717605

   I got the same error on Fedora 37.
   
   Just so you know I couldn't get it to work with Python default version on Fedora (3.11) since it's not compatible with lots of libraries and dependencies in Superset.
   
   In case anyone is interested I first had to build Python 3.8 from source:
   
   ```
   wget https://www.python.org/ftp/python/3.8.16/Python-3.8.16.tgz
   tar xzf Python-3.8.16.tgz Python-3.8.16/
   cd Python-3.8.16/
   ./configure --enable-optimizations --with-ensurepip=install
   sudo make altinstall
   ```
   
   This last line helps you leave your system-wide Python 3.11 intact. You can run python3.8 after that
   and create a superset virtual enrivonment using
   
   `python3.8 -m venv superset`
   
   After activating the new virtual environment and installing apache-superset with pip I got errors when I ran 
   
   `superset db upgrade`
   
    as stated in the documentation (https://superset.apache.org/docs/installation/installing-superset-from-scratch/):
   
   ```
   (superset) [alonso@fedora pythonvenvs]$ superset db upgrade
   /home/alonso/pythonvenvs/superset/lib/python3.8/site-packages/pandas/compat/__init__.py:124: UserWarning: Could not import the lzma module. Your installed Python is incomplete. Attempting to use lzma compression will result in a RuntimeError.
     warnings.warn(msg)
   Traceback (most recent call last):
     File "/home/alonso/pythonvenvs/superset/bin/superset", line 5, in <module>
       from superset.cli.main import superset
     File "/home/alonso/pythonvenvs/superset/lib/python3.8/site-packages/superset/__init__.py", line 21, in <module>
       from superset.app import create_app
     File "/home/alonso/pythonvenvs/superset/lib/python3.8/site-packages/superset/app.py", line 23, in <module>
       from superset.initialization import SupersetAppInitializer
     File "/home/alonso/pythonvenvs/superset/lib/python3.8/site-packages/superset/initialization/__init__.py", line 33, in <module>
       from superset.extensions import (
     File "/home/alonso/pythonvenvs/superset/lib/python3.8/site-packages/superset/extensions/__init__.py", line 32, in <module>
       from superset.utils.cache_manager import CacheManager
     File "/home/alonso/pythonvenvs/superset/lib/python3.8/site-packages/superset/utils/cache_manager.py", line 24, in <module>
       from superset.utils.core import DatasourceType
     File "/home/alonso/pythonvenvs/superset/lib/python3.8/site-packages/superset/utils/core.py", line 76, in <module>
       from cryptography.hazmat.backends.openssl.x509 import _Certificate
   ModuleNotFoundError: No module named 'cryptography.hazmat.backends.openssl.x509'
   ```
   
   In order to fix this I had to run the lines @zhaoyongjie provided, which I reproduce below:
   
   > @alanorth try this snippet
   > 
   > ```
   > pip uninstall cryptography
   > pip uninstall pyopenssl
   > pip install cryptography==3.4.7
   > ```
   
   After that I ran
   
   ```
   export FLASK_APP=superset
   superset db upgrade
   ```
   
   And I got the following errors:
   
   ```
     File "/home/alonso/pythonvenvs/superset/lib/python3.8/site-packages/superset/initialization/__init__.py", line 476, in configure_data_sources
       ConnectorRegistry.register_sources(module_datasource_map)
     File "/home/alonso/pythonvenvs/superset/lib/python3.8/site-packages/superset/connectors/connector_registry.py", line 42, in register_sources
       module_obj = __import__(module_name, fromlist=class_names)
     File "/home/alonso/pythonvenvs/superset/lib/python3.8/site-packages/superset/connectors/sqla/__init__.py", line 17, in <module>
       from . import models, views
     File "/home/alonso/pythonvenvs/superset/lib/python3.8/site-packages/superset/connectors/sqla/views.py", line 28, in <module>
       from wtforms.ext.sqlalchemy.fields import QuerySelectField
   ModuleNotFoundError: No module named 'wtforms.ext'
   ```
   
   @jsanko9 helped with this, I'm partly quoting the reply:
   
   > > ```
   > > pip uninstall WTForms 
   > > pip install WTForms==2.3.2
   > > ```
   
   
   With that I could successfully run
   
   `superset db upgrade`
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org