Guided Project: Analyzing CIA Factbook Data Using SQL- Got error

When I ran
%%capture
%load_ext sql
%sql sqlite:///factbook.db
I got the following error

%matplotlib inline
^
SyntaxError: invalid syntax

Try to restarted kernal already but still happen.
Could you please help? Thank you

Did you install ipython-sql?
!conda install -yc conda-forge ipython-sql

Yes I did. Follow the guide project.

Hi there! I was having the same issue described above

%%capture
%load_ext sql
%sql sqlite:///factbook.db

Out[1]:

'Connected: [email protected]'

In [3]:

#returns information on the tables in the database
%%sql
SELECT *
FROM sqlite_master
WHERE type='table';

File "<ipython-input-3-04d69fbfbd0d>", line 2 %%sql ^ SyntaxError: invalid syntax

I removed the commented code and now it works. Could someone explain what is happening? Was the commented code not really commented?