Installing Django with Pythonista and Stash gets errors : name 'sys' is not defined with « import sys » in script

I try to install Django with the Pythonista 3.4 on Ipad Pro (M4) with Stash (after running launch_stash.py):

[~/Documents]$ pip install django

And I have these errors:

site-packages/stash/bin/pip.py:35: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  from distutils.util import convert_path
Querying PyPI ... 
Downloading package ...
Opening: https://files.pythonhosted.org/packages/63/e0/6a5b5ea350c5bd63fe94b05e4c146c18facb51229d9dee42aa39f9fc2214/Django-5.2-py3-none-any.whl
Save as: /private/var/mobile/Containers/Data/Application/31B610E4-119A-4907-8E17-35502B9C7701/tmp//Django-5.2-py3-none-any.whl (8301361 bytes)
[====================] 100.00% | 7.9MiB          
stash: ^C
KeyboardInterrupt: Exit: 0

Installing wheel: Django-5.2-py3-none-any.whl...
stash: <class 'NameError'>: name 'sys' is not defined

I already have import sys in my launch_stash.py

I tried to add import sys in console AFTER running launch_stash.py with import sys inside. Also, I tried to force the different versions of django to install. I still have the errors :

[~/Documents]$ pip install django
Querying PyPI ... 
Downloading package ...
Opening: https://files.pythonhosted.org/packages/63/e0/6a5b5ea350c5bd63fe94b05e4c146c18facb51229d9dee42aa39f9fc2214/Django-5.2-py3-none-any.whl

Save as: /private/var/mobile/Containers/Data/Application/31B610E4-119A-4907-8E17-35502B9C7701/tmp//Django-5.2-py3-none-any.whl (8301361 bytes)
[====================] 100.00% | 7.9MiB          
stash: ^C
KeyboardInterrupt: Exit: 0

Error: failed to download package from https://files.pythonhosted.org/packages/63/e0/6a5b5ea350c5bd63fe94b05e4c146c18facb51229d9dee42aa39f9fc2214/Django-5.2-py3-none-any.whl
stash: ^C
KeyboardInterrupt: Exit: 1

Also I have this annoying error : stash: ^C KeyboardInterrupt: Exit: 1

It appears first time just after running launch_stash.py:

stash: ^C
KeyboardInterrupt: Exit: 0

StaSh v0.7.5 on python 3.10.4
Warning: you are running StaSh in python3. Some commands may not work correctly in python3.
Please help us improving StaSh by reporting bugs on github.
Tip: A background job can be issued by appending & at the end of a normal command, e.g. httpserver &
[~/Documents]$ pip install django
…

I thought at the beginning that this is problem with my connected Apple Magic Keyboard. I tried without and still have the same error.

Could you help me please with the installation?

Back to Top