Use of from __future__ import absolute_import

Copyright statement: Visitors can use the content or services provided by this blog for personal study, research or appreciation, as well as other non-commercial or non-profit purposes, but at the same time, they should abide by the provisions of copyright law and other relevant laws, and shall not infringe this The legal rights of the website and related rights holders. In addition, when using any content or services of this website for other purposes, you must obtain the explicit permission of this website and relevant rights holders in a timely manner. https://blog.csdn.net/qq_38262728/article/details/89057111

Suppose the current state of your folder is like this:

project
	main.py
	numpy.py

When used at the beginning of main.py:

import numpy as np

It will first find and import the numpy files in the current directory.

And if all you really want is to import the standard numpy library, you need to write:

from __future__ import absolute_import
import numpy as np

If you have added absolute_import, but want to import numpy files in the current directory, you need to write:

from __future__ import absolute_import
from project import numpy as np