Forum Archive

Running Python 3 scripts in StaSh

esanker

Hi,

Is there a way to run Python 3 scripts in StaSh? I tried using the #!python3 shebang and it did not work. Thanks.

JonB

if you remove the python2 shebang from launch_stash, you can run stash using the py3 interpreter. Not all commands work in py3, but many do. this lets you run scripts in the py3 interpreter.

esanker

I will try that. Thanks, JonB!

shtek

remove the python2 shebang from launch_stash.py, stash could not start.
seems that stash only supports python2.

I got this error:


Traceback (most recent call last):
  File "/private/var/mobile/.../Pythonista3/Documents/stash_extensions/launch_stash.py", line 28, in <module>
    from stash import stash
  File "/private/var/mobile/.../Pythonista3/Documents/site-packages/stash/stash.py", line 12, in <module>
    from ConfigParser import ConfigParser
ImportError: No module named 'ConfigParser'

JonB

ahh. there is a py3 branch of stash, though has not been kept up to date.

There is also a python3 command in @bennr01's branch.
See end of https://github.com/ywangd/stash/issues/179 for link/instuctions