Your environment variable PATH includes both Homebrew and MacPorts paths. This is a source of potential conflicts between libraries provided by the package managers.
I’d recommend keeping the two package managers separated.
Please follow the instructions from this post.