-
|
I am a newbie to python and Pythonista so please take it easy on me. I need to use pip to install 3rd party libraries/modules. “Pip” isn’t recognized, so I have read postings on this such as https://gist.github.com/boozook/d693415ac0ec0291181241ae733ebc75, using StaSh and ensurepip, and it doesn’t make sense to me. Surely pip should be a standard part of the Pythonista environment? Can the community help with a simple solution, or correct my stupidity? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 14 comments 28 replies
-
|
I'm using Pythonista 3 pip configuration tool. Installation: import requests as r; exec(r.get('https://tinyurl.com/Setup-pipTerminal').content)To launch the pip terminal, execute This tool cannot install packages that meet the following conditions.
To check if a package is available, do the following:
To update pip itself, simply run the command: The command recommended by the pip's warning is unavailable in Pythonista. |
Beta Was this translation helpful? Give feedback.
-
|
Wonderful! It all works. Appreciated @qqfunc |
Beta Was this translation helpful? Give feedback.
-
|
Small issue, which I assume is due to initialization scripts (?) - the next time I opened Pythonista (which I do love BTW), pip is unknown (again). |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
Thanks heaps @qqfunc ! That is a lucid explanation of the issue. Very greatly appreciated. Your explanation should be a standard part of the Welcome.md text as reckon that I won’t be alone on this issue. while I have run Python on a PC, this is my first go at using the IOS environment, as I wanted a very portable iPad anywhere opton. PipTerminal.py (which I had spotted but was a tad scared to run) - yep, perfect! |
Beta Was this translation helpful? Give feedback.
-
|
I think there possibly should be uv instead of pip |
Beta Was this translation helpful? Give feedback.
-
pipTerminal does not work on pythonista 3.5 |
Beta Was this translation helpful? Give feedback.
-
|
Merged CrossDarkrix/Pythonista3_pip_Configration_Tool#1 (comment) |
Beta Was this translation helpful? Give feedback.
-
|
StaSh for pythonista 3.4..3.5 WIP PR (with common pip support) Install to test using this commandimport requests as r; exec(r.get('https://gist.githubusercontent.com/o-murphy/ad7bcee38551d24ec172032792a2bf8f/raw/158346c958601cc29a9cc8070d6e501111562e52/get-stash-py3.10-beta.py').content) |
Beta Was this translation helpful? Give feedback.
-
|
The pip installation broken against with. I got some experiments with a possible solution, but it all works bad. The only one way that partially works is using --target for the pip installation and installing other packaged through it. The --prefix and shutil based solution not works anymore. |
Beta Was this translation helpful? Give feedback.
-
|
What about pip fork with patch to hardcode or resolve site-packages path in pythonista? Does it need a metadata patch? |
Beta Was this translation helpful? Give feedback.
-
|
Telegram: @bestpvaservice ➤WhatsApp:+1 (581) 615-7428 ➤If you face any problem you can contact us. we are online 24/7 hours ➤Website visit: https://bestpvaservice.com |
Beta Was this translation helpful? Give feedback.
-
|
You can try to use my app. |
Beta Was this translation helpful? Give feedback.
-
|
I decided to investigate the MarkupSafe dependency from Mako causing StaSh’s current pip.py to freeze / deadlock / infinitely loop that I mentioned in my wkwebview based alternative ui framework post (#113). After a bit of digging I found that the cause of this problem is the way it handles faking setuptools with modules stubs and it’s class OmniClass(object):
def __init__(self, *args, **kwargs):
pass
def __call__(self, *args, **kwargs):
return OmniClass()
def __getattr__(self, item):
return OmniClass()
def __getitem__(self, item):
return OmniClass()
def __mro_entries__(self, bases):
return (self.__class__,)The difficulty with this approach is that the way subsequent instance = OmniClass()
while instance is not None:
instance = instance.nextI’ve made some fixes for this by avoiding recreating different instances for the same attributes / items. As well as fixed a couple of fake setuptools modules. Things are fixed enough to enable MarkupSafe to install via the original zip path guessing mechanism, although this is not ideal, it works but I don’t claim any fitness for purpose. Perhaps having setuptools with an adjusted config / patches would help with things in the regular pip tool installation method? Stash is basing its handling of packages off older versions of the spec and distutils. https://gist.github.com/M4nw3l/a0845dd32508885455c4693848772596 |
Beta Was this translation helpful? Give feedback.

I'm using Pythonista 3 pip configuration tool.
Installation:
To launch the pip terminal, execute
pipTerminal.pyin "This iPhone / iPad".This tool cannot install packages that meet the following conditions.
.tar.gzfile: This tool requires build distributions with wheel format.whl.To check if a package is available, do the following:
<Package Name>-<Version>-py3-none-any.whl.