This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Unable to launch_stash.py in pythonista 3 for IOS
- What pythonista version are you using? The latest app store version, or the beta?
- The parse error indicates that your Info.plist is corrupted. You should try removing/reinstalling pythonista. If you have pythonista 2.0 installed, you won't lose any files, otherwise you need to back up first.
- The ConfigParser error is because you are running stash with python 3.x -- stash is only compatible with python 2.x (which is why launch_stash has the #!python2 at the start.
- As a workaround, you could also comment out the offending line from shcommon.py, and just set
(thats from the beta, but it does not really matter as long as the version is > 3.0)
one more thing to look at before reinstalling pythonista:
import sys, os print(open(os.path.join(os.path.dirname(sys.executable), 'Info.plist')).readline())
you also never said what device /os versionyou are using -- has ios started switching over to binary Info.plists?
Hi @JonB ,
I appreciate your help and I hope we will find the solution soon as I can’t wait to develop some stuff in Pythonista...
Here is the Info that I thought I already said:
- Ipad 10.5
- IOS 11.1
- Pythonista 3.0 version
I reinstalled Pythonista and then first thing I did is to download “stash”, then I ran “launch_stash.py” with version python 2.7 but still....same error.
I also tryed to run what you asked, here is the output:
I tried to change what you suggested in “shcommon.py” but it didn’t fix anything:
dgelessus last edited by dgelessus
@siulman Can you try running this and post the output:
import sys, os print(repr(open(os.path.join(os.path.dirname(sys.executable), 'Info.plist'), 'rb').read(256)))
@JonB I have an idea what the issue could be. Pythonista's
Info.plistmight be a binary plist (rather than XML) in the current App Store version of Pythonista. The Python 2 version of
plistlibonly supports XML plists I think. The Python 3 version supports both and detects the format automatically.
yeah, binary plist is what i was thinking. (I think it must be an ios 11 thing?)
The solution in 2.7 would then be maybe to use objc rather than plistlib:
from objc_util import NSBundle PYTHONISTA_VERSION=str(NSBundle.mainBundle().objectForInfoDictionaryKey('CFBundleShortVersionString')) PYTHONISTA_VERSION_LONG=str(NSBundle.mainBundle().objectForInfoDictionaryKey('CFBundleVersion')) if PYTHONISTA_VERSION < '3.0': ....
@dgelessus here is the output you requested:
@JonB Any workaroung you come up with to make that work?
dgelessus last edited by
@JonB What exactly does Stash use the Pythonista version number for? If you only need to know whether you're in Pythonista 3 or not, you could probably check
sys.executable.endswith("3")instead, or see whether
Py3Kit.frameworkexists or not.
I think it just uses it to report version # at startup, and check for pythonista 3.
The code I posted above should work, in shcommon.py. objc_util is probably overkill, but already imported for stash.
I modifyed the “shcommon.py” according to the @JonB suggestions and it worked.
I was also able to “pip install netmiko” and connect to my switches to execute the commands I wanted to. I am really happy now! Thanks!
Here below snapshots.
I think this should be taken into account for a new release of the app?
Thank you very much for your help @JonB as long as @dgelessus
if you'd like. you can submit a pull request over on the stash github page. If not, I will do it this week.
helixgreen last edited by
I ran into the same problem today. After reading through this thread I realized perhaps it had to do with having both Pythonista 2 and the new Pythonista 3 installed. I uninstalled both and reinstalled 3 and it fixed the problem.