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.
Pythonista 3 3.4 (340006) beta: Import pandas throws error
-
@JonB There was no pandas folder in site-packages-3 but there was dataclasses.py which was probably left over from an attempt to install pandas many moons ago and it was being called by the current working pandas. It works now. Thanks for your help! Now on to getting Stash to work and converting all my old 2.7 code to 3.11. What is the easiest way to do that?
-
@jonb Is there an easy way to patch Stash with the modified files?
-
@ihf try automatic Python 2 to 3 conversion
Of course, that will not use all newer Python-3 niceties but it should allow most Python-2 scripts to run under Python 3
-
@ihf I’m not sure if @bennr has committed the PR, which would allow you to delete stash then install it fresh.
Maybe I will write a patch script next week.
In short, you can do it manually, using this as your guide
https://github.com/ywangd/stash/commit/cb9616605c30c230ec323a668b961d52c904b9cc
First, you hav to change lines 20-21 in stash/system/shcommon.py, so that it uses plistlib.load instead of readPlist. See the patch in the PR.
Next, in system/shui/pythonista _ui.py, you search and replace SUITextBox with SUITextbox_PY3. The PR used UITextBox, but the underscore PY3 should work better.
Also, find isAlive and replace with is_alive in that same file.
Finally, do the same isAlive replacement in shthreads.py.
For me, I also had to make the following change in launch_stash.py, instead of _stash.launch():
import ui @ui.in_background def launch_stash(): _stash.launch() launch_stash()
-
@jonb Thanks! I managed to copy and modify the patched files and now stash will launch. I tried invoking scp in stash and got:
[~/Documents]$ scp nw-chg.py john@192.168.3.100:/Users/john stash: <class 'SyntaxError'>: invalid hexadecimal literal (number.py, line 398)
Then I tried:
[~/Documents]$ pip install scp Querying PyPI ... Downloading package ... Opening: https://files.pythonhosted.org/packages/7c/85/595a938d24bf4c88fe3ca4424ec9d934175fee800278769c7d4257dcf11a/scp-0.14.4-py2.py3-none-any.whl Invalid url: https://files.pythonhosted.org/packages/7c/85/595a938d24bf4c88fe3ca4424ec9d934175fee800278769c7d4257dcf11a/scp-0.14.4-py2.py3-none-any.whl Error: failed to download package from https://files.pythonhosted.org/packages/7c/85/595a938d24bf4c88fe3ca4424ec9d934175fee800278769c7d4257dcf11a/scp-0.14.4-py2.py3-none-any.whl [~/Documents]$
It’s been awhile since I’ve used stash so I don’t know if this is a result of the new version.
-
@ihf there is another GitHub PR about fixing wget and others. I believe another fork has those fixes, it should be possible now to use selfupdate.
-
@JonB I will say, it's going to take a while to find and fix all of the problems with stash and 3.4
-
@jonb selfupdate says I am at the up-to-date version already; however, on another iPad I tried:
import requests as r; exec(r.get('https://bit.ly/get-stash').content)
The version it then installs does not appear to be patched to run on 3.4.
-
@ihf there is a way to tell selfupdate which fork to install from.
You could try
selfupdate mkb79:patch-Pythonista3.4
-
@JonB Did you have any luck getting a script to work? I've tried to manually edit and can't seem to get stash working properly on 3.4..