'MPI - C++ vs Python, can't compile anymore

I could always use mpi with C++, compiling programs via mpicxx. Some time ago, I also had to use mpi with Python. I installed the Python package mpi4py via Anaconda and my Python mpi codes worked fine.

Now, however, I went back to C++. When trying to compile with mpicxx, I get an error:

" mpicxx -o TEST.exe TEST.cpp

The Open MPI wrapper compiler was unable to find the specified compiler x86_64-conda_cos6-linux-gnu-c++ in your PATH. Note that this compiler was either specified at configure time or in one of several possible environment variables."

Apparently, installing mpi4py with Anaconda messed something up as the system tries to look for a compiler with "conda" in its name...

Can someone guide me to fix this in a way that I can freely use both, C++ and Python, with mpi?

edit: Using Ubuntu 18.04.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source