stash does not run with Pythonista v3.4 Beta
Opened this issue ยท 8 comments
Today Pythonista v3.4 Beta was released.
When I execute launch_stash.py
the following issue appears:
Traceback (most recent call last):
File "/private/var/mobile/Containers/Shared/AppGroup/04823405-B61A-4EBC-8D72-116EB0824B40/Pythonista3/Documents/launch_stash.py", line 28, in <module>
from stash import stash
File "/private/var/mobile/Containers/Shared/AppGroup/04823405-B61A-4EBC-8D72-116EB0824B40/Pythonista3/Documents/site-packages/stash/__init__.py", line 2, in <module>
from . import core as stash
File "/private/var/mobile/Containers/Shared/AppGroup/04823405-B61A-4EBC-8D72-116EB0824B40/Pythonista3/Documents/site-packages/stash/core.py", line 23, in <module>
from .system.shcommon import (_EXTERNAL_DIRS, _STASH_CONFIG_FILES, _STASH_ROOT, _SYS_STDOUT, IN_PYTHONISTA, ON_IPAD)
File "/private/var/mobile/Containers/Shared/AppGroup/04823405-B61A-4EBC-8D72-116EB0824B40/Pythonista3/Documents/site-packages/stash/system/shcommon.py", line 20, in <module>
_properties = plistlib.readPlist(os.path.join(os.path.dirname(sys.executable), 'Info.plist'))
AttributeError: module 'plistlib' has no attribute 'readPlist'
Maybe there will be any fix in the near future?
Edit:
After fixing this issue a new one appears with these line _ShTerminal = create_objc_class('_ShTerminal', ObjCClass('SUITextView'), [keyCommands, kcDispatcher_])
. SUITextView
does not exists.
tl;dr: Solution is #462 (comment)
import requests as r; exec(r.get('https://bit.ly/get-stash').content)
Uses branch master
which has code that crashes on the current beta release of Pythonista. What command can I run to force the use of branch dev
instead of master
?
The following unfortunately installs master.zip
, not dev.zip
!
url = 'https://raw.githubusercontent.com/ywangd/stash/dev/getstash.py'; import requests as r; exec(r.get(url).content)
Downloading https://github.com/ywangd/stash/archive/master.zip ...
So on the new beta, you need to do the normal install and let it crash๐ฅ then
- Reboot Pythonista
- Copy the contents of https://raw.githubusercontent.com/ywangd/stash/dev/system/shcommon.py
- On Pythonista, paste that content into
Python Modules/site-packages/stash/system/shcommon.py
- Run
launch_stash.py
from the default directory.
It says StaSH was successfully installed but then crashes. Rebooting Pythonista and then running launch_stash.py
reveals that you modifications to shcommon.py
are gone and you have made no progress at all.
This command worked for me:
url = 'https://raw.githubusercontent.com/ywangd/stash/dev/getstash.py'; import requests as r; exec(r.get(url).text.replace('master', 'dev'))
Seems as though the most recent TestFlight beta changed the name of the site-packages folder which broke pip. I'm guessing here...
Pip install now errors when trying to install packages.
I'm not talented enough to figure out a fix myself. Can anyone point me in the right direction?
@AltKrypto A quick fix that might work for you.
edit stash/lib/libdist.py
under Python Modules / site-packages (user) to remove '-3'
if six.PY3:
#SITE_PACKAGES_DIR_NAME = "site-packages-3"
SITE_PACKAGES_DIR_NAME = "site-packages"
else:
@AltKrypto A quick fix that might work for you.
edit
stash/lib/libdist.py
under Python Modules / site-packages (user) to remove '-3'if six.PY3: #SITE_PACKAGES_DIR_NAME = "site-packages-3" SITE_PACKAGES_DIR_NAME = "site-packages" else:
That did the trick