Trying to run Kivy with buildozer on Ubuntu 16.04,
(startup-demo-project pong) I get an error
on command
buildozer android debug deploy
After:
....
[DEBUG]: BUILD SUCCESSFUL
....
at the end of the build there is an error message:
....
IOError: [Errno 2] No such file or directory: u'/home/std/Dokumente/python
/Kivy/.buildozer/android/platform/build/dists/myapp/build/outputs
/apk/myapp-debug.apk'
My installation is according to:
http://buildozer.readthedocs.io/en/latest/installation.html
for Ubuntu 16.04.
Also
buildozer serve
does not show anything useful, only:
Directory listing for /
as response to call:
http://localhost:8000
Buildozer console says:
192.168.178.22 - - [15/Apr/2018 21:43:12] "GET / HTTP/1.1" 200 -
192.168.178.22 - - [15/Apr/2018 21:43:12] code 404, message File not found
Annotation:
I changed the log_level = 2 for more information, but could not figure out where to find the relevant log file or where to get more information about the error.
Problem
IOError: [Errno 2] No such file or directory: u'/home/std/Dokumente/python /Kivy/.buildozer/android/platform/build/dists/myapp/build/outputs /apk/myapp-debug.apk'
Solution
Use sudo to change and recompile android.py for Python 2.7. Please do the following at terminal window:
Step 1
Change directory
cd /usr/local/lib/python2.7/dist-packages/buildozer/targets
Step 2
Make backup copies of android.py and android.pyc
sudo cp android.py android-orig.py
sudo cp android.pyc android-orig.pyc
Step 3
Use an editor to make changes to android.py
sudo gedit android.py
Step 4
Insert the following import before import sys
from distutils.version import LooseVersion
Step 5
Add the following codes after line 791 (# XXX found how the apk name is really built from the title). Note: __sdk_dir (double underscore). Please refer to print screens below for details.
__sdk_dir = self.android_sdk_dir
build_tools_versions = os.listdir(join(__sdk_dir, 'build-tools'))
build_tools_versions = sorted(build_tools_versions, key=LooseVersion)
build_tools_version = build_tools_versions[-1]
gradle_files = ["build.gradle", "gradle", "gradlew"]
is_gradle_build = any((
exists(join(dist_dir, x)) for x in gradle_files)) and build_tools_version >= '25.0'
if is_gradle_build:
Step 6
Save the changes.
Step 7
Compile android.py
At shell prompt
sudo python -m py_compile a--ndroid.py
or invoke Python Interpreter Interactive Shell
sudo python
>>> import py_compile
>>> py_compile.compile('android.py')
Step 8
At your project folder, run
buildozer android debug
Pictures
Changes Part 1 - from distutils.version import LooseVersion
Changes Part 2
Compile android.py
After Changes # local Buildozer - App deployed to Acer Android tablet
After Changes # Buildozer VM - Successful APK
Before Changes # local Buildozer - IOError: [Errno 2] No such file or directory
Before Changes # Buildozer VM - IOError: [Errno 2] No such file or directory
Related
I have an issue globally on my iMac ( M1 incase it matters )
where the commands exit with import ansible module is missing
So I tried installing a tmp dir with virtual env and tried using Ansible from there w/o luck.
I'll start from the error:
$ ../venv/bin/ansible-inventory
ERROR: [Errno 21] Is a directory: '/private/tmp/testansible/z'
File structure is like this:
~/$ cd /tmp
tmp$ mkdir testansible && cd $_
testansible$ mkdir z
testansible$ virtualenv venv
testansible$ venv/bin/pip3 install ansible
Then in a different directory i'm trying to use it:
testansible$ cd z
z$ ../venv/bin/ansible-config init > ansible.cfg
Then running any ansible command gave me tons of errors:
ERROR: Invalid settings supplied for DEFAULT_GATHER_TIMEOUT
ERROR: Invalid settings supplied for DEFAULT_NULL_REPRESENTATION
ERROR: Invalid settings supplied for DEFAULT_REMOTE_PORT
ERROR: Invalid settings supplied for GALAXY_IGNORE_INVALID_SIGNATURE_STATUS_CODES
Which is strange by itself because their comments says that if there's no value - it will take some default from somewhere
Each one I "resolved" by commenting them out
Then the command worked:
z$ ../venv/bin/ansible-config init > ansible.cfg
But every other ansible command i'm trying to execute gives the same error:
z$ ../venv/bin/ansible -i inventory.hosts
ERROR: [Errno 21] Is a directory: '/private/tmp/testansible/z'
z$ ../venv/bin/ansible-inventory -i inventory.hosts
ERROR: [Errno 21] Is a directory: '/private/tmp/testansible/z'
Any ideas ?
Edit
Thanks to the comment below the issue was this line in the ansible.cfg file:
# (path) File to which Ansible will log on the controller. When empty logging is disabled.
log_path=
Commenting out this line - and the ansible commands started working.
I'm not sure , why across the file it says: When empty logging is disabled - but it's not disabled, it throws an exception. so as all the above variables, they don't really have a default value - they are just getting in the way
I want to install the app I found on a github page (https://github.com/googlei18n/fontview), how do I do it? I tried opening the 'build.py' file through mac terminal but it doesn't work, as well as pyton luncher- it freezes.
Kajas-MacBook-Pro:~ Kaja1$ cd fontview-master
Kajas-MacBook-Pro:fontview-master Kaja1$ cd src
Kajas-MacBook-Pro:src Kaja1$ cd fontview
Kajas-MacBook-Pro:fontview
Kaja1$ python2.7 build.py && ./build/FontView.app/Contents/MacOS/fontview
/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file 'build.py': [Errno 2] No such file or directory
You are in the wrong directory. Change back to the folder fontview-master and run the command from there.
It seems like it should be fairly easy to set up automatic releases of my python project (on GitHub) to PyPi: https://docs.travis-ci.com/user/deployment/pypi/
So, I added the following to my .travis.yml:
deploy:
provider: pypi
user: DanHickstein
on:
tags: true
password:
secure: GHhpt4Ssv2VQh6...
It almost works, but I get the following error of TravisCI:
Preparing deploy
Authenticated as DanHickstein
Deploying application
python: can't open file 'setup.py': [Errno 2] No such file or directory
ValueError: Cannot find file (or expand pattern): 'dist/*'
python: can't open file 'setup.py': [Errno 2] No such file or directory
I cannot fathom why setup.py cannot be found. It is right there in the same directory as .travis.yml...
The problem is the following line in the install stage:
- cd ~/
Make sure you are back in the root of your projects directory before deploying, maybe in the before_deploy stage.
Try to build atom/electron on Windows 7, but failed.
OS Environment:
Windows 7
VS 2013 Update 5
Python 2.7
Node.js 4.2.3
Git 2.6.4
atom/electron - Latest pull (2015.12.17)
It failed when running the bootstrap script "$ python bootstrap.py -v", the screenshot is here:
Trying to find a way through, any help will be appreciated.
-- dean
Found a way...:
Situation failed one: "can't open file"
According to the official documentation: Build Instructions (Windows)
$ python script\bootstrap.py -v
the result will be:
D:\Program Files\Python27\python.exe: can't open file 'scriptbootstrap.py': [Errno 2] No such file or directory
Situation failed two: "WindowsError: [Error 3]...."
Pay attention to this:
$ cd script
$ python bootstrap.py -v
I cd into the script folder, and run the bootstrap script, and failed.
Situation OK: Use "/" instead of "\"
See the screenshot below:
Explanations are welcome...
--dean
My goal it's to install a HLS server to stream a live video.
So i found https://github.com/jbochi/hls-loop this script.
But my install fail.
I am on Linux Ubuntu 14.04
apt-get install python-dev --> It's OK
pip install flask --> It's OK
python hls-loop.py --> ERROR python: can't open file 'hls-loop.py': [Errno 2] No such file or directory
Also i found this packet https://github.com/dayvson/hls-endless but build fail too :(
If you found a another script to install HLS live stream server, , I'm more than interrested!
Thx
After you clone the repository to your local directory using:
git clone https://github.com/jbochi/hls-loop.git
Your directory structure will look something like:
| - <current_dir> /
| | -- hls-loop /
| | | -- hls-loop.py
| | | -- ...
You have to install Flask using pip as that's a dependency for the hls-loop project. I'd recommend taking a look at virtualenv to isolate the project dependencies for each of your applications.
From your current directory you could run the application using something like python hls-loop/hls-loop.py. This causes and error in read_file_durations() due to how they are reading their static file. Because of that you will have to run the application from the same directory as the script:
cd hls-loop
python hls-loop.py
If you wanted you could create a fix for this so it doesn't matter where you run the application from by doing something like this:
import os
def read_file_durations():
basedir = os.path.abspath(os.path.dirname(__name__))
file_durations = os.path.join(basedir, "static/bipbop_4x3/gear1/prog_index.m3u8")
with open(file_durations) as f:
...
Hopefully that clears some stuff up for you.
You will need to git clone https://github.com/jbochi/hls-loop, then cd hls-loop, then you can run python hls-loop.py.