I think you could simply copying the visualize.py into the same directory as the script you are running.
If you wanted it in your lib/site-packages directory so you could import it with the neat module:
copy visualize.py into lib/site-packages/neat/ and modify __init__.py to add the line import neat.visualize as visualize. Delete the __pycache__ directory. Make sure you have modules installed: Numpy, GraphViz, and Matplotlib. When you've done the above, you should be able to import neat and access neat.visualize.
I don't recommend doing this though for several reasons:
- Say you wanted to update your neat module. Your visualize.py file is technically not part of the module. So it wouldn't be updated along with your neat module.
- the visualize.py file seems to be written in the context of the examples as opposed to being for general use with the module, so contextually, it doesn't belong there.
- At some point in the future, you might also forget that this wasn't a part of the module, but your code acts as if it was part of the API. So your code will break in some other neat installation.
importerror - NEAT-Python not finding Visualize.py - Stack Overflow
Visualizing Python Project Import Graphs
python - Importing visualization function from .py file to use in .ipynb file - Stack Overflow
Visualize the structure of a Python module - Stack Overflow
Videos
» pip install visualizer
» pip install visualize
I think you want the Python library snakefood
sfood: Given a set of input files or root directories, generate a list of dependencies between the files;
sfood-graph: Read a list of dependencies and produce a Graphviz dot file. (This file can be run through the Graphviz dot tool to produce a viewable/printable PDF file);
I know this question is very old. If someone is searching a tool for visualising the structure of a Python module, you can try Sourcetrail.
This tool helps you to visualise big source codes such as PyTorch or TensorFlow.
It starts with a nice overview of the project.

If you go inside the Classes button and select any class, it will show you the connection of a specific class with other classes and functions.

All the buttons are clickable and gives you a nice overview. This gives you a kickstart to understand the structure of unknown source code very easily.