I had similar problem and was able to fix by installing python via macports.
Quoting the answer from https://emacs.stackexchange.com/questions/72243/macos-org-babel-python-with-session-output-give-python-el-eval
I just ran into the same issue, and I bugged someone much smarter than me about it -- her conclusion after some debugging was that it seems like this basically boils down to the Python that comes with MacOS not being compiled with readline support. This could be seen by opening a python shell in emacs, and entering 1, and seeing that the input is echoed in addition to being output.
We switched to using a different python installation (specifically the one that comes with nix) and this made the issue go away. (She says that ones that come with homebrew / macports would also work; apparently it's well-known that the python version that ships with MacOS has these kinds of problems.)
Slightly unsatisfying + seems like black magic to me, but it's working now! :)