3
import numpy as np

is just calling Includes/numpy/__init__, right?

So, how to step into this while debugging? F7 doesn't work. Setting breakpoint inside numpy doesn't work either.

1 Answer 1

2

Lets say you have a script in a project in PyCharm where you import numpy:

import numpy as np
a = np.zeros(100)

You need to find the __ init __ .py of numpy (for instance in site-packages/numpy/__ init __.py). You can find it in External Libraries/ site-packages. It should be located right below your project folder in PyCharm Project view.

Once you have located the file, open it and set a breakpoint at the first line of a code. Code starts like this:

try:
    __NUMPY_SETUP__
except NameError:
    __NUMPY_SETUP__ = False

To be able to reach the breakpoint in the __ init __.py of numpy, go back to the script and run it in the debug mode. This will bring you to the place in __ init __.py of numpy where the breakpoint is.

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

1 Comment

Can you explain what is it?

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.