In the standard packaging method, there is no main.pyo; yourapp is a python file - not a directory

30 views
Skip to first unread message

Mehmet Yilmaz Codes

unread,
Jul 30, 2015, 10:36:02 AM7/30/15
to Kivy users support
There are two issues I am coming across with the kivy-sdk-packager

  1. # if an app is available, use it

     

    if [ -d "${SCRIPT_PATH}/yourapp" ]; then

            cd
    "${SCRIPT_PATH}/yourapp"

           
    if [ -f "main.pyo" ]; then

                   
    exec ${SCRIPT_PATH}/python -OO -m main "$@"

           
    else

                   
    exec ${SCRIPT_PATH}/python -m main "$@"

           
    fi


The script creates (on osx) a file called "yourapp", not a directory

Also running the script doesn't find kivy in the venv

./script


Python 2.7.5 (default, Mar  9 2014, 22:15:05)


[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin


Type "help", "copyright", "credits" or "license" for more information.


>>> import kivy

Traceback (most recent call last):

 File "<stdin>", line 1, in <module>

ImportError: No module named kivy

>>>


Bill Janssen

unread,
Jul 30, 2015, 11:04:14 PM7/30/15
to Kivy users support, mehme...@gmail.com
I've just used the packager to build a working app.  You can't invoke it from the command line via "script", you need to invoke it with "/Applications/MyAppName/Contents/MacOS/Kivy".  That will run the script in an appropriate context.

And package-app.sh seems to be what's creating all the optimized Python files (.pyo).

Bill

Jared McFarland

unread,
Sep 13, 2015, 4:21:33 PM9/13/15
to Kivy users support
I ran into this same issue.... the package-app.sh script expects the path to the directory containing your .py (and .kv) file(s), NOT the path to your python file.  

Correct:

$ ./package-app.sh /path/to/myappfolder

Incorrect:
$ ./package-app.sh /path/to/myappfolder/myapp.py

Once you fix that, "yourapp" will be a directory that contains main.pyo
Reply all
Reply to author
Forward
0 new messages