Pythonista 3.4: 'pip install' (alternative to StaSh) #80
Replies: 1 comment
|
Here is another tool I find helpful when installing Python packages for Pythonista3.4 using pip. It is called "pipdeptree": To get a more complete list that also includes commonly installed packages like "pip", the "-a" option can be used. The warnings level can be adjusted using the "-w" option. The "-d" limits the depth of the tree: I usually install packages using the "--no-deps" option. That keeps pip from installing packages that are already bundled with Pythonista, and which pip does not know about. "pipdeptree" still finds these "hidden" packages. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Here is a method that can be used to install Python packages using pip (including pip itself) in Pythonista 3.4:
The Idea is to use an existing pip installation on a shared resource, e.g. shared drive on a remote machine where pip is already installed.
Share a folder with a pip installation on a PC, and connect to this folder from an iPad/iPhone. (I use a shared SMB folder on a Raspberry Pi, and connect to it using the "Files" app on my iPad (Files > ... > connect to Server). An alternative could be to save the folders "pip" and "pip-25.2.dist-info" into a folder on the iCloud drive, where the iPad/iPhone can see it.)
In Pythonista: Navigate to this folder using "External Files > Open... Folder...", and open the shared folder.
Create a new empty Python script inside this folder ( "+" > "New ... Empty Script"), and give it a name (e.g. "shared_pip_sh.py"), and copy/paste the following script into it, and run the script (The script will give further instructions):
This works because the script's path is added to Python's "sys.path", and since "pip" is installed in the same folder, Python can find, load, and execute the "pip" module on the shared drive. (Pythonista has permissions to read the files inside the shared folder, because otherwise it would not be able to run the script.)
Edit: Updated to latest version with an "!" command prefix for executing Python commands inside the shell.
All reactions