superset: Error while installing (markdown() takes 1 positional argument but 2 were given)

  • [X ] I have checked the superset logs for python stacktraces and included it here as text if any
  • [X ] I have reproduced the issue with at least the latest released version of superset
  • [X ] I have checked the issue tracker for the same issue and I haven’t found one similar

Superset version

dev and release 0.27.0

Expected results

Installed superset

Actual results

Error while installing: Was unable to import superset Error: markdown() takes 1 positional argument but 2 were given

Steps to reproduce

Followed the instructions for a fresh (docker) installation:

git clone https://github.com/apache/incubator-superset/
cd incubator-superset
cp contrib/docker/{docker-build.sh,docker-compose.yml,docker-entrypoint.sh,docker-init.sh,Dockerfile} .
cp contrib/docker/superset_config.py superset/
bash -x docker-build.sh
docker-compose up -d
docker-compose exec superset bash
bash docker-init.sh

at the last command after the username/usermail/ password are asked for input the installation fails. Reproduced on two different laptops

Additionally, when not using the docker installation. It fails at the same step: fabmanager create-admin --app superset (which is done in the docker installation in the bash docker-init.sh script)

Trace:

xxx@xxx-server:~/dev/compose/incubator-superset$ docker-compose exec superset bash
work@3d443226a074:~/incubator-superset$ bash docker-init.sh
+ fabmanager create-admin --app superset
Username [admin]: xxx
User first name [admin]: xxx
User last name [user]: xxx
Email [admin@fab.org]: xxx@xxx.com
Password: 
Repeat for confirmation: 
Loaded your LOCAL configuration at [/home/work/incubator-superset/superset/superset_config.py]
Was unable to import superset Error: markdown() takes 1 positional argument but 2 were given

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 17 (9 by maintainers)

Commits related to this issue

Most upvoted comments

@hamidmahmoodnbs you need to wait for a new release of superset. Until then you can install it like this so that the version of markdown is forced to a working version:

$ pip install "markdown<3.0.0" superset

I have submitted a PR for this problem (#5967)

I ran into this too just a few moments ago. There’s a bug in /home/work/incubator-superset/superset/utils.py within the Docker image. This patch fixes the issue:

--- /tmp/utils.py	2018-09-22 23:09:23.168916170 +0000
+++ /home/work/incubator-superset/superset/utils.py	2018-09-22 23:09:28.559916297 +0000
@@ -420,7 +420,7 @@
                           'li', 'dd', 'dt', 'img', 'a']
     safe_markdown_attrs = {'img': ['src', 'alt', 'title'],
                            'a': ['href', 'alt', 'title']}
-    s = md.markdown(s or '', [
+    s = md.markdown(s or '', extensions=[
         'markdown.extensions.tables',
         'markdown.extensions.fenced_code',
         'markdown.extensions.codehilite',

The problem is that superset depends on markdown==2.6.11 but for a reason I’m not clear about, v3 is installed in the docker image.

For the record I’m working on improving the developer experience with the docker image, and will soon make a PR that will fix this situation.

Ah yes, the docker install is using setup.py which does not specify a version for markdown.

This is where this should be fixed.