distutils and related libraries patched for use in Pythonista.
distutils
, setuptools
and pip
patched for use in Pythonista.
These may require the Pythonista beta version 1.6 or release version 2.0 to work properly, especially distutils
, because it has to shadow the version from the stdlib. If you’re still on Pythonista 1.5, you’ll need to modify your sys.path
manually on every run to make the patched distutils
take priority over the version from the stdlib.
pip
technically works, however there are still a number of issues:
pip
MUST NOT BE USED TO UPDATE ITSELF! Otherwise all patches are overwritten and pip
will no longer work on Pythonista. (The built-in update notification has been disabled in the pip.conf
.)pip
, Pythonista must be rebooted. Otherwise pip
‘s “state” (i. e. the database of installed modules and their versions) is not updated properly.site-packages
(if it is pure Python) or the installation will fail entirely (if it requires native code).pip.conf
, because otherwise a warning about the cache directory’s permissions/owner is displayed every time.pip
are very hackish. It works, but it’s certainly not great.Any suggestions on how to fix these are welcome. If you have working code, please do submit a pull request.
distutils
folder into your site-packages
folder.pydistutils.cfg
file in the editor.import editor, os, shutil; shutil.copyfile(editor.get_path(), os.path.expanduser("~/.pydistutils.cfg"))
setuptools
(not a wheel) from https://pypi.python.org/pypi/setuptools. (Version 18.3.2 is known to work, future versions should as well, because only a single file is modified.)stash
or another program.site-patch.py
and copy its entire contents, and paste them into <setuptools-source-folder>/setuptools/site-patch.py
.setuptools
‘ setup.py
script.install
into the text field, and press Run.pip
‘s setup.py
script.install
into the text field, and press Run.pip.conf
file in the editor.import editor, os, shutil; os.makedirs(os.path.expanduser("~/.config/pip")); shutil.copyfile(editor.get_path(), os.path.expanduser("~/.config/pip/pip.conf"))