wargo icon indicating copy to clipboard operation
wargo copied to clipboard

Work even if default python points to python 3

Open lord opened this issue 8 years ago • 4 comments

Someone on reddit points out that we should work even if the system python points to 3, as long as there's a python2 or python2.7 installed.

lord avatar Oct 22 '17 22:10 lord

I'm using Arch Linux:

$ python --version
Python 3.6.2
$ python2 --version 
Python 2.7.14

https://wiki.archlinux.org/index.php/Python

vinc avatar Oct 23 '17 08:10 vinc

I think that emsdk is supposed to work with Python 3, but the version that setup.js is downloading from https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz has a bug preventing that.

There's an open issue related to this problem at https://github.com/juj/emsdk/issues/103

And indeed it works if I clone the master:

$ git clone https://github.com/juj/emsdk ~/.emsdk
$ cd ~/.emsdk
$ ./emsdk install sdk-1.37.22-64bit
Fetching all tags from Emscripten Github repository...
Done. 109 tagged releases available, latest is 1.37.22.
Fetching all tags from Binaryen Github repository...
Done. 36 tagged Binaryen releases available, latest is 1.37.22.
Fetching all precompiled Nightly versions..
...

vinc avatar Oct 23 '17 16:10 vinc

:+1: nice find, thanks! I'll update the script next chance I get.

lord avatar Oct 24 '17 21:10 lord

It doesn't look like this has been fixed in wargo / upstream quite yet, but a quick method to bypass the issue on Arch Linux and other distros defaulting to python3 is to override the python version using a local PATH environment variable change, detailed here:

https://wiki.archlinux.org/index.php/python#Python_2

mkdir ~/bin
ln -s /usr/bin/python2 ~/bin/python
ln -s /usr/bin/python2-config ~/bin/python-config
export PATH=~/bin:$PATH

With this workaround in place, wargo successfully builds for me on Arch Linux, and it's limited to the current shell so it doesn't hose anything else on the system.

zeta0134 avatar Nov 07 '17 02:11 zeta0134