Any idea why IPython.get_ipython() is returning None?
See original GitHub issueTraceback (most recent call last):
File "/Users/kkotari/.pyenv/versions/3.7.4/bin/ipycli", line 8, in <module>
sys.exit(run())
File "/Users/kkotari/.pyenv/versions/3.7.4/Python.framework/Versions/3.7/lib/python3.7/site-packages/ipycli/ipycli.py", line 8, in run
IPython.get_ipython().define_macro('var', """a=10
AttributeError: 'NoneType' object has no attribute 'define_macro'
I was trying to create a python package where the scripts needs to run on IPython. Is there any special settings to create such a package.
ipython --version 7.14.0
Thanks in advance.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Can I only use ipython through the jupyter notebook
I have already downloaded the ipython module but from what I have undertand I can only use it through Jupyter ? Which makes...
Read more >IPython reference — IPython 8.7.0 documentation
If invoked with no options, it executes the file and exits, passing the remaining arguments to the script, just as if you had...
Read more >DB2 Jupyter Notebook Extensions
There is no concept of a transaction where multiple DML/DDL ... Check if we are running in iPython or Jupyter try: if (get_ipython().config ......
Read more >Jupyter Notebook Enhancements, Tips And Tricks - fastai
Since I only wanted the nb name, I tweaked it a bit (1) to just return the filename w/o ext (2) throw an...
Read more >Let's Write an IPython Extension the Hard Way
It's working, but partially. If we assign a variable ( In [4] ) and then reference it ( In [5] ), you will...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
As you probably correctly guessed, this is because
get_ipython()
only forwas from within IPython sessions.Can you check if IPython is not installed for Python 2 ? Or to be more sure to run IPython from Python 3, you can do:
If this still does not work, can you open a separate issues, with possibly the content of your files so that we can investigate ?
Thanks.
Any memory error like that are really unlikely to happen because of IPython/Python.
Timing with magics is really just a thin wrapper around python’s timeit module so you should be able to time in pure python as well, though you will need to put your code in strings literals.
On Tue, Aug 3, 2021, 16:08 Sarah-2021-scu @.***> wrote: