Python WHL naming and platforms

Experimenting with Pypy, I wanted to try Panda3D - while its WHL builds OK,
attempting to install it generates an error about the platform -

$ pip install ./panda3d-1.10.0-cp35-cp35m-linux_x86_64.whl
panda3d-1.10.0-cp35-cp35m-linux_x86_64.whl is not a supported wheel on this platform.

Pypys CPython support keeps improving so I wanted to try it anyway - on the Panda3D forum I got a suggestion to try renaming the package.
A post on tensorflow[1] shows how to get pips supported python platforms, here's a snippet to list them:

$ python -c "import pip; print('\n'.join(['-'.join(platform) for platform in pip.pep425tags.get_supported()]))"

Here is some output for pypy3

$ python -c "import pip; print('\n'.join(['-'.join(platform) for platform in pip.pep425tags.get_supported()]))" | sort

Unfortunately, the WHL doesn't work yet, even after renaming:

$ cp panda3d-1.10.0-cp35-cp35m-linux_x86_64.whl panda3d-1.10.0-pp3510-pypy3_510-linux_x86_64.whl
$ pip install ./panda3d-1.10.0-pp3510-pypy3_510-linux_x86_64.whl
Processing ./panda3d-1.10.0-pp3510-pypy3_510-linux_x86_64.whl
Installing collected packages: panda3d
Successfully installed panda3d-1.10.0
$ python -c "from panda3d.core import *"
Traceback (most recent call last):
File "", line 1, in 
ImportError: /home/stu/.virtualenvs/pypy-nightly-py3.5/site-packages/panda3d/ undefined symbol: PyExc_ImportError

While this doesn't work, it's enough info to report a bug [2] - if that gets fixed then there are bound to be others, alternately it might just work.


Script to get Pypy nightly builds

Started a script to download Pypy nightly builds and create virtualenvs for them.

Virtualenvs are at ~/.virtualenvs where virtualenvwrapper can find them and named by pypy branch - e.g.

Downloads only happen when there are new builds, and will resume if they were interrupted.

Install favourite Windows apps with a Chocolatey Gist

I'm a big fan of the chocolatey package manager for Windows. While not perfect, it still saves a bunch of time.

Many people build meta-packages that install everything they need, but I feel this pollutes the package namespace. As an alternative, I've prototyped a gist that can be pasted and run to install packages I use.

Being a batch file, it's not as clean as.. well almost anything. Powershell would be a sane choice here, but I don't use Windows enough to justify learning it. There's also something quite fun about twisting batch files to do what you want. Hopefully this is useful for anyone that wants to use gist to store their own package list.

Dronetronics VJ Set, Taipei.

Here is a pic from my first VJ outing, for Dronetronics, in Taipei, back in December. IMG_0340_4-cropped Lars from Dronetronics got in contact 2 hours before the gig, to see if I had anything for a gig at a studio not far away.   I quickly repurposed my smilies test vis (see previous post) to be suitable for Drone Music.
  • Removing the smilies
  • Added functionality to change the graphic when a button was pressed
  • Removed the OSC control - due to how sensitive the APC Mini sliders were, it looked quite amateurish (as they pick up every jolt as you move).
  • Put in new graphics (here, I only had time to find some black and white ideograms of a skull and a 'warning') sign plus an "X" I drew in the two minutes before the gig.
  • Added an option for graphics to wrap around (in the taxi on the way to the gig).
In the end, it was a great learning experience VJing for the first time, from the tech through to the setup. With thanks to Dronetronics and the studio crew at UUMouth Studio.   Sourcecode for the vis will go up shortly.

Progress: end-to-end music vis working

Initial versions of all the parts of my music vis / VJ tool are now in place: The midi controller connected to a python program, which sends OSC to the separate music vis (still the smilies). Now, I need to go back and rebuild/polish some of the more prototypey bits of the code so they can uploaded. Unfortunately the USB socket died on my physical midi controller, so controlling with a (prototype) emulator I built in this video. I've learned a lot more about the linux graphics stack than I ever wanted to, once these are polished it'll finally be time to make some different visuals.

PSA – Use ‘SNA’ if you are on optimus

"Optimus" is the tech where your laptop has an Intel AND an Nvidia card, the amount of problems this can cause are more than the sum of the parts on Linux. Trying to run apps on the Nvidia card had all sorts of issues until I switched the intel card on 'SNA' ("the successor to UXA"). It seems like every few years intel changes how their graphics cards work, and the new hotness is SNA. Before this, glitches included black windows, and apps just freezing until I resized their windows, or if you ran more than one GL app. As per the answer here at add the following to your /etc/X11/xorg.conf
Section "Device"
 Identifier "Intel Graphics"
 Driver "intel"
 Option "AccelMethod" "sna"
I'm not sure it's entirely problem free, I have had one or two logouts, but at least I can run more than one instance of my own app without random freezing and glitching.   [EDIT] It turns out I'm still getting glitchyness and lockups running on intel, at least running things on the Nvidia card with DRI_PRIME=1 works though. [/EDIT]  

Android NDK Notes

Some notes on NDK problems I've had to overcome in the last few days, there are bound to be corrections needed, I'll try and update these based on any comments.

Environment variables

Various scripts use different ones to discover the location of the NDK - so don't be surprised when you see ANDROID_NDK, ANDROID_NDK_ROOT, ANDROID_NDK_HOME, or anything else - they mean the same thing, right now I'm using ANDROID_NDK currently.


There are lots of different versions of android_cmake, subtly incompatible, you probably will need to edit scripts. Before trying to use cmake with Android, make sure you can build some apps using the standard tools, or the scripts that come with them This is something I'll probably come back to, as I'm using gradle and right now.

Android Studio

In transition

Android used to use Eclipse and ANT, now it's in transition to Android Studio and Gradle, hence some things don't work, but they can be tweaked - this situation will probably change.

Installing NDK

Has it's own copy of the NDK, you can install it from the preferences in the Android SDK section, if you already installed a copy it won't automatically find it.

Build works when launching from terminal, but not using desktop icon

Android Studio doesn't pick up variables set in '.bashrc' - this means scripts may work if you launch it from a terminal, but not from the desktop.

Taking ages opening project, message about gradle

Android studio downloads this the first time, if you want more information load it from the terminal and you will see some info as it downloads.

Error about "JCenter" when trying to build

This can be because you have a really old version of gradle installed (ie the one that comes with Ubuntu 15.04) - if on Ubuntu you can test this by building using the "gradlew" script in your project, if this works then upgrade gradle - on Ubuntu there is a gradle PPA.

Not picking up settings in

You can add this at the top of your app.gradle
Properties properties = new Properties()
def sdkDir = properties.getProperty('sdk.dir')
def ndkDir = properties.getProperty('ndk.dir')
Then add ndkDir to your ndkBuild section
// call regular ndk-build(.cmd) script from app directory
task ndkBuild(type: Exec) {
    if (Os.isFamily(Os.FAMILY_WINDOWS)) {
        commandLine ndkDir + '/ndk-build.cmd', '-C', file('src/main').absolutePath
    } else {
        commandLine ndkDir + '/ndk-build', '-C', file('src/main').absolutePath

Including other files

You can do this like this
include $(LOCAL_PATH)/../assimp/workspaces/Android-NDK/jni/
Make sure to do these includes at the end of your own file  as they may overwrite variables like LOCAL_PATH, also $(call my-dir) returns the name of the latest included file.

No rule to make target

The build couldn't find the mentioned file, if you use a variable like LOCAL_PATH, maybe it was overwritten - see the section on includes

Outputting values from

$(info hi, LOCAL_PATH is $(LOCAL_PATH))
$(warning Uh oh...)
$(error this is the error message that will stop the build process)

Running on a real device

cannot locate symbol “srand”

Android 21 changed the location of some symbols - either set your minimum sdk to 21 and build with that, or have a lower one (e.g. 19) and build with that SDK

Everything else

Expect to do a lot of googling, expect to have to change makefiles. ... look at other projects using the libraries you use and see how they work, good luck !

Up to date on videos

Real lift has got in the way of doing much graphics work recently, however I've now caught up and uploaded a bunch of videos.. (it also took quite a while to get scripts for creating the same videos, with sound working).

Audio Reactive Critters

Graphics experiments

Rendering fat lines with Shoebot

Animating fat lines with Shoebot

Learning about 2D vectors

I have some basic code to find the length of a Bezier Curve and a point along it, I seem to have talked myself into implementing this in Cairo, so that's the next stage, from there path effects and text-on-a-path will be the next stage.

Progress so far

I've been pretty busy so far doing laying the groundwork for my audiovisual project. I've got the architecture worked out, so ones this stage 0 is complete I can start coding it. Uploaded, 2 videos using shoebot... 4 others waiting to be uploaded. Soft Released: vext This makes it easy to use things like wx, gtk, pyqt4 and other, mostly Gui and older Audio libraries in virtualenv. Have been using this successfully with Shoebot for a while. Python 3 support is still TODO, at which point can do a proper release. Working on: Finishing off a tool to make videos with 🙂 Learning About: Bezier Curves (have a Gtk demo app waiting to be uploaded) [Blocking on app to create videos] Cairo OpenGL PPA: Built a Docker Image that can build debian packages, this needs completing so they can be signed and uploaded to the PPA.

Wifi + Moving Country

If you are on linux and having trouble with WIFI in a new country it might be worth letting it know what country you are in - on debian/ubuntu edit the file /etc/default/crda and update the country code.