Search code examples
pythonkivyqpython

Cant import package


I'm trying to create kivy programm with QPython and it's working fine, but when I try to import modules that I installed via pip

# qpy:2
# qpy:kivy
#
# for example - vk
# vk provides instruments
# to work with vk.com API
# 

import vk

(I launched my programm using Kivy Launcher app)

An error occurs:

[INFO              ] Logger: Record log in /storage/emulated/0/kivy/myapp/.kivy/logs/kivy_16-10-25_16.txt
[WARNING           ] [Config      ] Upgrading configuration in progress.
[WARNING           ] [Config      ] Older configuration version detected (13 instead of 14)
[INFO              ] Kivy: v1.9.1
[INFO              ] Python: v2.7.2 (default, Mar 20 2016, 23:30:13) 
[GCC 4.8]
[WARNING           ] stderr: Traceback (most recent call last):
[WARNING           ] stderr: File "main.py", line 7, in <module>
[WARNING           ] stderr:    import vk
[WARNING           ] stderr: ImportError: No module named vk

How can I install third-party package into kivy?


Solution

  • You can't. Python-for-android != pip, nor the launcher which may be the output if you set things right.

    However, read the documentation and if you understand it, you can build your own launcher. This way you can put into a custom launcher any desired package hypothetically.

    If the package isn't pure python (requires a compilation), you'll need to check if there's a recipe for that. If not, either write one, or no package. ^^