omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    [Solved] installing modules with pipista & shellista

    Pythonista
    4
    5
    4720
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • BlackTea123
      BlackTea123 last edited by

      Dear all,

      what I want: install decorator

      what I did so far:

      1. created a file "shellista" in pythonista from https://github.com/transistor1/shellista
      2. 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

      1 Reply Last reply Reply Quote 0
      • JonB
        JonB last edited by

        I'd suggest switching over to stash, which has a nearly working pip2 command.
        https://github.com/ywangd/stash/issues/39#issuecomment-71522878

        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.

        1 Reply Last reply Reply Quote 0
        • dgelessus
          dgelessus last edited by

          As far as I can tell decorator really consists of only a single Python module, namely decorator.py in the src folder. It should be sufficient to move/copy that file into the site-packages folder so you can import it. Running the setup.py script should not be necessary in this case.

          A few other things:

          1. 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.
          2. StaSh includes a simple pip command, which works similar to that on Python on a regular computer - it downloads a package from PyPI and installs it using the setup.py script. Because Pythonista has a different (and more limited) environment than normal computers, the setup.py is not actually executed. Instead pip tries 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 pip.
          3. 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.)
          4. 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 pip may be easier in some cases though.
          1 Reply Last reply Reply Quote 0
          • BlackTea123
            BlackTea123 last edited by

            Thanks, copying decorator.py into site-packages worked for me.

            And I'll definitely have a look into StaSh.

            1 Reply Last reply Reply Quote 0
            • briarfox
              briarfox last edited by

              I'd recommend moving to stash as well. There is a lot of development going into it. https://github.com/ywangd/stash

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Powered by NodeBB Forums | Contributors