ywangd / stash

StaSh - Shell for Pythonista
MIT License
1.93k stars 227 forks source link

Git fails to run at all #357

Open VincentCCandela opened 5 years ago

VincentCCandela commented 5 years ago

After a fresh install of Pythonista and Stash, when I run git I get the output:

[~/Documents]$ git Opening: https://github.com/jsbain/gittle/archive/master.zip

Save as: /private/var/mobile/Containers/Data/Application/B6E83203-4A0E-4C04-B8C3-D99525B426CF/tmp//gittle.zip (??? bytes) 28334 mv: Error: Destination path '/private/var/mobile/Containers/Shared/AppGroup/2BC0A6FB-75F4-42EB-A4BC-4590A3FD623E/Pythonista3/Documents/site-packages/stash/lib/gittle/gittle' already exists Opening: https://github.com/FriendCode/funky/archive/master.zip

Save as: /private/var/mobile/Containers/Data/Application/B6E83203-4A0E-4C04-B8C3-D99525B426CF/tmp//funky.zip (??? bytes) 8474 mv: Error: Destination path '/private/var/mobile/Containers/Shared/AppGroup/2BC0A6FB-75F4-42EB-A4BC-4590A3FD623E/Pythonista3/Documents/site-packages/stash/lib/funky/funky' already exists <class 'ModuleNotFoundError'>: No module named 'urlparse' [~/Documents]$

jsbain commented 5 years ago

git really wants to run in py2. add a #!python2 to the top of launch_stash, or maybe create a copy called launch_stash2...

ForceBru commented 5 years ago

git really wants to run in py2. add a #!python2 to the top of launch_stash, or maybe create a copy called launch_stash2...

Yep, adding #!python2 to launch_stash.py worked, except when running merely git an error pops up saying that it couldn't import the utils module.

To fix that, run stashconf py_traceback 1, then git and note the error. On StaSh 0.7.2 it says something like "Cannot import utils on line from . import utils". Go to the file where this error originates (it's gittle.py or something like that) and change this line to import utils, then restart Pythonista, and now git should work fine. If it still doesn't, delete the dulwich, funky and gittle folders from site-packages/stash/lib and redo the process described above.

tony-sol commented 3 years ago

have same issue, running via py3

birkelbot commented 1 year ago

It looks like they removed Python 2 support from Pythonista. I tried adding #!python2 to the top of launch_stach.py, and it is still running in Python 3. Additionally, the “Run in Python 2” and “Run in Python 3” buttons are gone from the “Run Options…” menu. Is there any other workaround to using StaSh on Pythonista (and in particular, with git)?

cclauss commented 1 year ago

Python 2 died 1,368 days ago on 1/1/2020 so please do not expect anyone to support it.

birkelbot commented 1 year ago

I get a warning when launching StaSh: Warning: you are running StaSh in python3. Some commands may not work correctly in python3.

IMG_0197

After searching this on Google, it looks like the common response is “you need to run StaSh on Python 2 if you want all the features to work.”

I tried to call git status to see if I could interact with Git in StaSh, and I got the exact same error as the OP.

IMG_0198

So, this lead me to ask my question. Is there some other way to get Git to work in StaSh, or is it no longer supported? Why is there a warning when I launch StaSh if Python 3 is the one and only version of Python that one could use with StaSh?