Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stash does not run with Pythonista v3.4 Beta #462

Open
mkb79 opened this issue Jan 18, 2023 · 8 comments
Open

stash does not run with Pythonista v3.4 Beta #462

mkb79 opened this issue Jan 18, 2023 · 8 comments

Comments

@mkb79
Copy link
Contributor

mkb79 commented Jan 18, 2023

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.

@mkb79
Copy link
Contributor Author

mkb79 commented Jan 18, 2023

I‘ve tried to patch stash myself and opened a new PR #463

@cclauss
Copy link
Collaborator

cclauss commented Mar 15, 2023

tl;dr: Solution is #462 (comment)

@cclauss
Copy link
Collaborator

cclauss commented Mar 16, 2023

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

  1. Reboot Pythonista
  2. Copy the contents of https://raw.githubusercontent.com/ywangd/stash/dev/system/shcommon.py
  3. On Pythonista, paste that content into Python Modules/site-packages/stash/system/shcommon.py
  4. 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.

@sbbosco
Copy link

sbbosco commented Mar 16, 2023

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'))

@ikiziki
Copy link

ikiziki commented Apr 22, 2023

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?

@ikiziki
Copy link

ikiziki commented Apr 23, 2023

image

Here's a screenshot of the error

@sbbosco
Copy link

sbbosco commented Apr 23, 2023

@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:

@ikiziki
Copy link

ikiziki commented Apr 23, 2023

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants