python_man_beginner
python_man_beginner

Reputation: 19

Unable to import numpy in Jupyter (instead getting: NameError: 'True' is not defined)

Jupyter notebook is suddenly unable to import numpy. I have used the standard code to import the package and the following error code is returned.

Using atom, the import works fine. Jupyter notebook, however, has suddenly stopped being able to do this.

    import numpy as np 

this is what is returned by Jupyter Notebook

    NameError                                 
    Traceback (most recent call last)
    <ipython-input-1-0aa0b027fcb6> in <module>
    ----> 1 import numpy as np

    ~/numpy.py in <module>
         99    "execution_count": 11,
         100    "metadata": {
     --> 101     "scrolled": true
         102    },
         103    "outputs": [

    NameError: name 'true' is not defined

Upvotes: 0

Views: 927

Answers (1)

AdamZhang
AdamZhang

Reputation: 221

~/numpy.py in <module>

Like Chirs said, it seems you have a numpy.py file in your home directory.

Upvotes: 1

Related Questions