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

Created on 22 Sep 2018  Â·  17Comments  Â·  Source: apache/incubator-superset

  • [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 [[email protected]]: [email protected]
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

Most helpful comment

@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

All 17 comments

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',

I am also getting this error and already tried the docker and the py venv installation... help needed indeed

@jcmcken fix worked

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.

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

This is where this should be fixed.

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.

Thanks, nb. it was not only the docker image in which the problems occured. Normal installation had the same problem.

@JvnB you are right, this should be fixed in setup.py by putting a constraint on the markdown dependency (<3.0.0).

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

That was very helpful. Trying superset for the first time and already the first bug has resolution on github. Great job!

I am facing the same error when I am installing superset using pip install superset. When I create-admin the following error occurs. I am using python3.6 and pip 18. Please help me

$ fabmanager create-admin --app superset
Username [admin]: admin
User first name [admin]: admin
User last name [user]: user
Email [[email protected]]: [email protected]
Password:
Repeat for confirmation:

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

@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

Thanks Victor I have installed the older version of superset 0.22.0. It is
working fine for me.

Thanks

On Wed, Sep 26, 2018 at 4:33 PM Victor Noël notifications@github.com
wrote:

@hamidmahmoodnbs https://github.com/hamidmahmoodnbs you need to either
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

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/apache/incubator-superset/issues/5958#issuecomment-424681953,
or mute the thread
https://github.com/notifications/unsubscribe-auth/Ag596Y2jqwQuaKVEejAtiROxuvCgG1okks5ue2XsgaJpZM4W1V1t
.

Thanks Victor, we were trying it on ubuntu box for the first time and did not have a good experience with the setup, nonetheless the forced markdown version helped.

Thanks @victornoel , but not sure what is the purpose of setup.py if we already have requirements.txt? I agree with you that the docker needs a revision too.

@abshammeri you should read on the matter, for example https://caremad.io/posts/2013/07/setup-vs-requirement/

I have submitted a PR to improve the docker image: #5966

Had got the same error even with mardown<3.0. The issue was with the Flask version with Flask App Builder which superset is built on. pip install flask==0.12.1 fixed the issue for me.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vylc picture vylc  Â·  3Comments

deity-bram picture deity-bram  Â·  3Comments

thoralf-gutierrez picture thoralf-gutierrez  Â·  3Comments

fly-high-bj picture fly-high-bj  Â·  3Comments

kalimuthu123 picture kalimuthu123  Â·  3Comments