user21231: I don't know how to import chess.pgn on Python.
I searched everywhere, but I didn't find anything. Can anybody here help me? 

user15989: If you've already installed python-chess via pip/conda/choco or your favourite package manager, then to use chess.pgn, in your .py files just call from chess import pgn or import chess.pgn. You have to explicitly write either import, even if you already have import chess.
Then you can use it like
from chess import pgn

with open("my_pgn_file.pgn", "r") as pf:
    game = pgn.read_game(pf)

If I had used import chess.pgn instead, then I call it by changing the last line to game = chess.pgn.read_game(pf).

user21188: First you need to install this library:
pip install python-chess

And make sure you're using the right pip, because still in some Linus distros pip and python are python 2.x and for python 3.x you should use pip3 and python3. If you want to check try this:
pip --version

You will see an output like this that will tell you what python you're using, in my case it's 3.8:

pip 19.2.3 from /usr/lib/python3.8/site-packages/pip (python 3.8)


21231: <p>I don't know how to import chess.pgn on Python.
I searched everywhere, but I didn't find anything. Can anybody here help me? </p>
 15989: <p>If you've already installed python-chess via pip/conda/choco or your favourite package manager, then to use chess.pgn, in your .py files just call <code>from chess import pgn</code> or <code>import chess.pgn</code>. You have to explicitly write either import, even if you already have <code>import chess</code>.</p>

<p>Then you can use it like</p>

<pre><code>from chess import pgn

with open("my_pgn_file.pgn", "r") as pf:
    game = pgn.read_game(pf)
</code></pre>

<p>If I had used <code>import chess.pgn</code> instead, then I call it by changing the last line to <code>game = chess.pgn.read_game(pf)</code>.</p>
 21188: <p>First you need to install this library:</p>

<pre><code>pip install python-chess
</code></pre>

<p>And make sure you're using the right <code>pip</code>, because still in some Linus distros <code>pip</code> and <code>python</code> are <code>python 2.x</code> and for <code>python 3.x</code> you should use <code>pip3</code> and <code>python3</code>. If you want to check try this:</p>

<pre><code>pip --version
</code></pre>

<p>You will see an output like this that will tell you what python you're using, in my case it's 3.8:</p>

<blockquote>
  <p>pip 19.2.3 from /usr/lib/python3.8/site-packages/pip (python 3.8)</p>
</blockquote>
