Welcome!
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.
Help on keeping a Python package compatible with Pythonista
-
I did a quick test by renaming
countfiles.py
(which was generated automatically during install) to something else and, besides an unrelated and easy to solve import issue, it seems to work now. I just need to change the entrypoint onsetup.py
, then.Thanks!
-
Unfortunately, we have run into problems again. The method of
pip install
ing directly from GitHub was working OK, but some of the recent changes insetup.py
seem to have broken compatibility with Pythonista. Now I get this error:[Count-files_4]$ cd ~/Documents/ [~/Documents]$ pip install victordomingos/Count-files Working on GitHub repository ... Opening: https://github.com/victordomingos/Count-files/archive/master.zip Save as: /private/var/mobile/Containers/Data/Application/42E7AC0F-227A-43B8-BA4C-BEE6B30E9330/tmp//master.zip (156922 bytes) 156922 [100.00%] Extracting archive file ... Running setup file ... SyntaxError('invalid syntax', ('/private/var/mobile/Containers/Data/Application/42E7AC0F-227A-43B8-BA4C-BEE6B30E9330/tmp/518fc4bef99942178e4acfbf283d866b/Count-files-master/setup.py', 15, 103, ' sys.stderr.write(f"Unsupported Python version: {sys.version_info.major}.{sys.version_info.minor}. "\n')) Failed to run setup.py Fall back to directory guessing ... Error: Cannot locate packages. Manual installation required.
Maybe it has something to do with the lack of support for Python 3 in StaSh. We will try to remove that f-string and see if it solves the problem.
Meanwhile, is there any other way to manually install a package like this, which does automatically the creation of an endpoint (which usually goes into
stash_extensions/bin
)? -
pip download generally works, followed by manual tar commands to extract, and then mv to move to where you want it
-
In this case,
setup.py
should create an endpoint script in StaSh’s path. That endpoint script was the runnable script. Is there any other way to make it create that file? -
We removed the f-string from
setup.py
, but now the default check for Python version again gets stuck because of StaSh not supporting Python 3.6. 😕[~/Documents]$ pip install victordomingos/Count-files Working on GitHub repository ... Opening: https://github.com/victordomingos/Count-files/archive/master.zip Save as: /private/var/mobile/Containers/Data/Application/42E7AC0F-227A-43B8-BA4C-BEE6B30E9330/tmp//master.zip 156933 Extracting archive file ... Running setup file ... Unsupported Python version: 2.7. Python 3.6 or later is required.
-
There is a
py3
branch on https://github.com/ywangd/stash -
Last time I tried to install StaSh for Python 3 it didn’t go very well. I seemed to be in an early development stage. And apparently it still doesn’t work, at least to me. I just downloaded and installed that version:
Traceback (most recent call last): File "/private/var/mobile/Containers/Shared/AppGroup/F3C0E711-6D38-4FDF-81F2-DC3B97E4E9F1/Pythonista3/Documents/launch_stash.py", line 31, in <module> from stash import stash File "/private/var/mobile/Containers/Shared/AppGroup/F3C0E711-6D38-4FDF-81F2-DC3B97E4E9F1/Pythonista3/Documents/site-packages/stash/stash.py", line 25, in <module> from .system.shcommon import IN_PYTHONISTA, ON_IPAD File "/private/var/mobile/Containers/Shared/AppGroup/F3C0E711-6D38-4FDF-81F2-DC3B97E4E9F1/Pythonista3/Documents/site-packages/stash/system/shcommon.py", line 50, in <module> import _outputcapture ModuleNotFoundError: No module named '_outputcapture'
-
did you forcequit pythonista after installng?
-
Hi,
StaSh supports py3 since version '0.7.0'. Try running 'selfupdate -f' to upgrade to the latest stable version (important: Version '0.7.0' requires a force update, please specify the '-f' parameter when running 'selfupdate').
There are also some unmerged changes with more bugfixes ('selfupdate -f bennr01:command_testing').
Please force-quit pythonista after updating StaSh.
If you have done this and are still experiencing problems, please paste the output of 'version' in StaSh.
Please also note that the newest version of StaSh supports botz py2 and py3 and thus uses the python version it is started with (With other words: you have to start StaSh using the py3 interpreter).@ccc said:
There is a
py3
branch on https://github.com/ywangd/stashThe 'py3' branch is outdated and unsupported. The py3 changes are already in 'master' (i think).
-
This worked. Thanks!