Two requirements:
(1) you need to sign up the chatGPT plus, paid account, not the free account. It may open to free account later as well.
(2) I also found that, you need to turn the chat history (which is on by default).
Then, go to settings first as the following screen shot:
Second, on the setting page, click beta features
, then turn on the code interpreter
button.
Third, refresh your page, come back to the conversation page, and hover over “GPT-4” icon, and futher click the code interpreter
.
And you should be set to use the code intepreter tool.
For how to use it, here is one simple example:
simple example to use code interpreter