1

I have written some IPython magic functions for my students, and I would like to have them installed using easy_install. So far the only way I have found is to copy a python file to a profile directory, but easy_install complains about a SandboxViolation when I do that.

Is there a way to install magic functions via setuptools?

1 Answer 1

3

Any importable Python module can be an IPython extension - you install it in the normal location, and then add a load_ipython_extension function which registers your magic functions. See the documentation on writing extensions.

Then you run %load_ext foo.bar (where foo.bar is your module name) to load the extension. You can also set a config file to load it every time IPython is started, but I don't think there's any good way to automate setting this up when a module is installed.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.