I couldn't find clear solutions for the special situation I face. After trying a few things, I fixed the issue by using the setup script instead of using pip. The solution was inspired by this link and this link.
You can run the setup script from Matlab command window or Terminal. If you are using Anaconda for env management, just remember to put the correct path to the Python interpreter. E.g., in Matlab command window, you would use:
cd (fullfile(matlabroot,'extern','engines','python'))
system('your_python_interpreter setup.py install') % instead of system('python setup.py install')
You may find the matlab engine gets installed as .egg under the site-packages folder. You need to manually copy the matlab folder to under the site-packages folder. That's it. Note, I also found the matlab engine installed this way seems not tracked by Anaconda (i.e., it doesn't appear in pkg list of mac_86 env).
Regarding why my previous operation didn't work, I assumed that when the matlab engine gets installed to the mac_86 env, it will automatically configure the paths to the compatible Intel version Matlab. But it seems it didn't do what I expected and thus always pointed to the Apple version Matlab. For the pip installation to work, I may have missed some pre- or post- steps to configure the paths to point to the Intel version Matlab. But I didn't find clear instructions online. In contrary, using setup script allows me to explictly specify the correct Matlab version (i.e., the cd command) for building and installing matlab engine.
Hope this helps.
