Setting up Python 2.7 and PyPI (pip) on an iPod Touch

I just wanted to harvest tweets over a period of about a month or two, but I didn’t want to pay for all that processor time on an EC2 instance. I tried running my Python script on my shared hosting account, but the admins kept killing the ‘screen’ containing it. I would have used my desktop computer, but I can’t sleep with it on. And my laptop couldn’t provide the uptime I needed.

First thought: Raspberry Pi. But getting one looked like a rather lengthy process, and I didn’t want to have to wait weeks or months to proceed with my project.

I happened to have a 2nd generation iPod Touch running iOS 4.2.1 that was just collecting dust. After trying and failing to get Linux on it, after wrangling with Darwin and reading walkthroughs, I’m ready to share the steps that eventually got me there. Hopefully they’ll help you.

How I did it (minus the dead ends and false starts)

  1. Downloaded the latest version of Redsn0w.
  2. Downloaded the iPod Touch 2G 4.2.1 firmware. (Thanks to k1ttyrain for the file.)
  3. Ran Redsn0w and went through the jailbreak process.
  4. Used Cydia to install OpenSSH, wget, BerkeleyDB, and SQLite 3. (I also installed screen so I could run my script and leave it running after ending my SSH session, but you don’t have to.)
  5. SSHed into my iPod.
  6. Changed my root password with passwd.
  7. wget
  8. dpkg -i python_2.7.2-5_iphoneos-arm.deb
  9. wget --no-check-certificate
  10. python env

At that point I used the copy of pip in the env/bin directory that virtualenv created to install the modules I needed and used the copy of python in the same env/bin directory to run my script in a screen I detached. Now I’ve got a quiet little iPod Touch plugged into the wall, slurping down tweets and saving them into date-stamped files!

Edit: Added mention of SQLite 3 and BerkeleyDB in step four.


  1. thanks! did you compile it yourself?


  2. Nope, didn’t have to compile anything myself.


  3. Hello, I followed your guide exactly but cant get it to work, I always fail on step 10 with the following error message. I have already tried a lot to correct this problem but I cant get it to work. Did you run into a similar problem or do you know whats causing the error?

    Best regards.

    iPod-von-Nico:/ root# python env
    New python executable in env/bin/python
    Cannot find a wheel for setuptools
    Cannot find a wheel for pip
    Installing setuptools, pip…
    Complete output from command /env/bin/python -c “import sys, pip; sys…d\”] + sys.argv[1:]))” setuptools pip:
    Traceback (most recent call last):
    File “”, line 1, in
    ImportError: No module named pip
    …Installing setuptools, pip…done.
    Traceback (most recent call last):
    File “”, line 2352, in
    File “”, line 825, in main
    File “”, line 993, in create_environment
    install_wheel(to_install, py_executable, search_dirs)
    File “”, line 961, in install_wheel
    ‘PIP_NO_INDEX': ‘1’
    File “”, line 903, in call_subprocess
    % (cmd_desc, proc.returncode))
    OSError: Command /env/bin/python -c “import sys, pip; sys…d\”] + sys.argv[1:]))” setuptools pip failed with error code 1


    1. It’s been a few years and I no longer have the iPod I used handy (it seemed to fall over every few days under the load of downloading a constant stream of tweets anyway) so I’m afraid there’s not much I can do to help you here. It’s possible that I pruned too much from the account of my attempts. My best guess at the moment would be to try installing standalone copies of setuptools and pip before tackling step 10 again.

      For pip, my guess is something like:
      wget -O - | python

      For setuptools/easyinstall:
      wget -O - | python

      Let me know if this fixes your problem, or if you figure out something else that fixes your problem. I’d love if this blog post remained relevant moving forward! :-)


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>