Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while installing (markdown() takes 1 positional argument but 2 were given) #5958

Closed
JvnB opened this issue Sep 22, 2018 · 17 comments · Fixed by #5967
Closed

Error while installing (markdown() takes 1 positional argument but 2 were given) #5958

JvnB opened this issue Sep 22, 2018 · 17 comments · Fixed by #5967

Comments

@JvnB
Copy link

JvnB commented Sep 22, 2018

  • [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

@JvnB JvnB changed the title Error while installing Error while installing (markdown() takes 1 positional argument but 2 were given) Sep 22, 2018
@jcmcken
Copy link

jcmcken commented Sep 22, 2018

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

@nunohelibeires
Copy link
Contributor

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

@JvnB
Copy link
Author

JvnB commented Sep 23, 2018

@jcmcken fix worked

@victornoel
Copy link
Contributor

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.

@victornoel
Copy link
Contributor

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

This is where this should be fixed.

@victornoel
Copy link
Contributor

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.

@JvnB
Copy link
Author

JvnB commented Sep 24, 2018

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

@victornoel
Copy link
Contributor

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

@victornoel
Copy link
Contributor

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

@shobhitverma
Copy link

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

arpit-agarwal pushed a commit to ThalesGroup/incubator-superset that referenced this issue Sep 25, 2018
@hamidmahmoodnbs
Copy link

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 [admin@fab.org]: admin@fab.org
Password:
Repeat for confirmation:

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

@victornoel
Copy link
Contributor

victornoel commented Sep 26, 2018

@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

@hamidmahmoodnbs
Copy link

hamidmahmoodnbs commented Sep 26, 2018 via email

@shaikidris
Copy link
Contributor

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.

@abshammeri
Copy link

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.

@victornoel
Copy link
Contributor

@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

@ujwal-narayan
Copy link

ujwal-narayan commented Oct 4, 2018

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.

betodealmeida pushed a commit to lyft/incubator-superset that referenced this issue Oct 12, 2018
victornoel added a commit to victornoel/incubator-superset that referenced this issue Nov 12, 2018
- Improve Docker image
  - smaller
  - faster to build
  - deterministict dependencies (see apache#5958)
- Rework process to simplify setting things up
  - updated documentation
  - less commands to type
  - no files to move and modify
  - optional loading of samples
- Still working in standalone mode (without volumes for superset)
mistercrunch pushed a commit that referenced this issue Nov 27, 2018
- Improve Docker image
  - smaller
  - faster to build
  - deterministict dependencies (see #5958)
- Rework process to simplify setting things up
  - updated documentation
  - less commands to type
  - no files to move and modify
  - optional loading of samples
- Still working in standalone mode (without volumes for superset)
bipinsoniguavus pushed a commit to ThalesGroup/incubator-superset that referenced this issue Dec 26, 2018
- Improve Docker image
  - smaller
  - faster to build
  - deterministict dependencies (see apache#5958)
- Rework process to simplify setting things up
  - updated documentation
  - less commands to type
  - no files to move and modify
  - optional loading of samples
- Still working in standalone mode (without volumes for superset)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants