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

Kivy and Beautifulsoup with Buildozer fail on Python 3. #529

Closed
fomalhaut88 opened this issue Jul 18, 2017 · 2 comments
Closed

Kivy and Beautifulsoup with Buildozer fail on Python 3. #529

fomalhaut88 opened this issue Jul 18, 2017 · 2 comments

Comments

@fomalhaut88
Copy link

I am trying to build a kivy app written in Python 3 having beautifulsoup library. I have followed these steps:

  1. I installed buildozer for Python 3 according to the doc: https://pypi.python.org/pypi/buildozer
  2. I downloaded and unpacked crystax
  3. I modifyed requirements and android.ndk_path in buildozer.spec:
    requirements = python3crystax,beautifulsoup4,kivy==master
    android.ndk_path = ~/Programs/crystax-ndk-10.3.2
  4. I ran buildozer:
    buildozer android debug deploy

Everything was built successfully. But when I run the app on my mobile it falls with error:

I/python (15014): 'You are trying to run the Python 2 version of Beautiful Soup under Python 3. This will not work.'<>'You need to convert the code, either by installing it (python setup.py install) or by running 2to3 (2to3 -w bs4).'
I/python (15014): ^
I/python (15014): SyntaxError: invalid syntax

It looks like buildozer installed beautifulsoup for Python 2 instead. But I specified nothing about Python 2 when I was installing and configuring buildozer. Also I had looked at .buildozer directory and found the directory venv that contains Python 2.7 only. It seems to be weird, because I have done everything to avoid Python 2.

How can I make my app build and work correctly?

Thanks for advance.

@mark-marinas
Copy link

I am not sure if you already found the anwer, but here's what i did to make it work.

  1. go to your app folder, then cd to .buildozer/android/platform/python-for-anroid-master/pythonforanrdoid
  2. look for the files with 2.7, (you can just use grep), and replace 2.7 with yoiur python version (3.5 in mycase).
  3. go back to your app folder, do a buildozer android clean
  4. build as you normally would.

@inclement
Copy link
Member

Closing as stale, python3 support has changed a lot since then. Please make a new issue for any issues on master.

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

No branches or pull requests

3 participants