[Solved] installing modules with pipista & shellista
what I want: install decorator
what I did so far:
- created a file "shellista" in pythonista from https://github.com/transistor1/shellista
- ran shellista, downloaded the package "decorator-3.4.0.tar.gz" and unpacked it by using untgz
I now have a folder structure like "~/decorator-3.4.0/decorator-3.4.0/" and a setup.py therein.
My question: What now? How can I perform the "python setup.py install" operation?
Thanks in advance
I'd suggest switching over to stash, which has a nearly working pip2 command.
In shellista, there really was no install function.
But, often install just meant copying the folder containing the modules py files into site packages.
Look in the inner folder for another folder, maybe called decorator.
Move that folder into your site-packages, then you should be able to import.
Note that this only works for pure py modules.
As far as I can tell
decoratorreally consists of only a single Python module, namely
srcfolder. It should be sufficient to move/copy that file into the
site-packagesfolder so you can import it. Running the
setup.pyscript should not be necessary in this case.
A few other things:
- I'd suggest that you have a look at StaSh. Although Shellista is the first and perhaps most well-known Pythonista shell, it is somewhat limited in its capabilities for that reason. There have been multiple forks and remakes of Shellista, with StaSh being the most recent and feature-rich one.
- StaSh includes a simple
pipcommand, which works similar to that on Python on a regular computer - it downloads a package from PyPI and installs it using the
setup.pyscript. Because Pythonista has a different (and more limited) environment than normal computers, the
setup.pyis not actually executed. Instead
piptries to parse the file and extract all information necessary to perform the installation. This means that complex
setup.pys cannot be run using StaSh's
- Any package that is written in C/C++/Cython cannot be used in Pythonista due to the lack of a C compiler and support for dynamic libraries. (The latter is a restriction by Apple, which makes the former practically impossible unless you want to write a C compiler in pure Python.)
- Because pure Python packages rarely require special setup procedures than "copy this to site-packages" I personally find it easier to look for the main module file/package folder and manually copy it to site-packages. Using
pipmay be easier in some cases though.
Thanks, copying decorator.py into site-packages worked for me.
And I'll definitely have a look into StaSh.
I'd recommend moving to stash as well. There is a lot of development going into it. https://github.com/ywangd/stash