I'm using PyCharm as my editor and seemingly it doesn't behave well with certain sub-modules namely numpy.random.normal
. Not to be disheartened I tracked down where numpy.random
lives to /usr/lib/python2.7/dist-packages/numpy/random
.
I can't see any instance of normal. There's the definition for it in __init__.py
but no actual code for me to copy into a new class for my project.
Am I looking in the wrong place for the code?
You can find out, where a package is located by doing so:
In your case, it seems that the main parts of the module are implemented in C. You can see in the directory, that there is a file "mtrand.so" located in it. This is a shared object that was created from C sources, which are typically not delivered with the runtime package. The Python system can load such shared objects at runtime, when you import the module/package.