Importing graph_tool.all breaks argparse
Hi! I've come across this really weird behaviour: importing graph_tool.all
leads to argparse ignoring some arguments.
Here is a simple example. I have a script example.py
with the following code:
import argparse
import graph_tool.all as gt
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--name', type=str)
args = parser.parse_args()
print(args.name)
If I run it like this python example.py --name test
it prints None
. Removing the line import graph_tool.all as gt
fixes the issue: running the script prints test
as expected. Renaming the argument from name
to something else also fixes the issue. I have no idea why this is happening.
OS: Ubuntu 18.04.5
Python version: 3.9.5