<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p><span style="font-family:monospace">/usr/local/lib/python3.5/</span><span
        style="font-family:monospace">dist-packages/pip/</span></p>
    <p><span style="font-family:monospace">cancella pip da lì e
        reinstallala con </span><br>
    </p>
    <pre class="terminal"><code class="terminal-line">sudo apt install python3-pip

In generale, puoi sempre ripartire da zero:

<a class="moz-txt-link-freetext" href="https://packaging.python.org/tutorials/installing-packages/">https://packaging.python.org/tutorials/installing-packages/</a>

If pip isn’t already installed, then first try to bootstrap it from the standard library:
Unix/macOS

python3 -m ensurepip --default-pip

If pip isn’t already installed, then first try to bootstrap it from the standard library:


python3 -m ensurepip --default-pip

If that still doesn’t allow you to run python -m pip:

        Securely Download get-pip.py

        Run python get-pip.py. This will install or upgrade pip. Additionally, it will install setuptools and wheel if they’re not installed already.

Insomma, se ne esce :-)
</code></pre>
    <p><span style="font-family:monospace"></span></p>
    <div class="moz-cite-prefix">Il 31/05/21 14:38, Valerio Pachera ha
      scritto:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAHS0cb_p3ZskTdbTXtUjiFinyauH9Mt74T1v0ZfGOmHjTWXgcQ@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div dir="ltr">
          <div>Grazie per le risposte.</div>
          <div>Avevo valutato (velocemente) se usare virtualenv o venv e
            la mia scelta era ricaduta sul primo perché ha alcune
            funzionalità in più, in particolare, paragonato a virtualenv<br>
          </div>
          <div><a href="https://virtualenv.pypa.io/en/latest/"
              moz-do-not-send="true">https://virtualenv.pypa.io/en/latest/</a></div>
          <div>"cannot create virtual environments for arbitrarily
            installed python versions (and automatically discover
            these),"</div>
          <div><br>
          </div>
          Il vero problema che sto cercando di aggirare è questo (su
          ubuntu 16.04):</div>
        <div dir="ltr"><br>
        </div>
        <div dir="ltr"><span style="font-family:monospace">pip3
            --version<br>
            Traceback (most recent call last):<br>
            File "/usr/bin/pip3", line 11, in <module><br>
            sys.exit(main())<br>
            File
            "/usr/local/lib/python3.5/dist-packages/pip/__init__.py",
            line 12, in main<br>
            from pip._internal.utils.entrypoints import _wrapper<br>
            File
"/usr/local/lib/python3.5/dist-packages/pip/_internal/utils/entrypoints.py",
            line 4, in <module><br>
            from pip._internal.cli.main import main<br>
            File
            "/usr/local/lib/python3.5/dist-packages/pip/_internal/cli/main.py",
            line 58<br>
            sys.stderr.write(f"ERROR: {exc}")<br>
            ^<br>
            SyntaxError: invalid syntax</span></div>
        <div dir="ltr"><span style="font-family:monospace"><br>
          </span></div>
        <div><span style="font-family:monospace"><span
              style="font-family:arial,sans-serif">notare che avendo
              pip3 "rotto" di suo, non posso neanche usarlo per
              installare altri moduli nel virtual env.</span><br>
          </span></div>
        <div><span style="font-family:arial,sans-serif"><br>
          </span></div>
        <div><span style="font-family:arial,sans-serif">Ho provato
            quindi ad installare una versione specifica di pip:<br>
          </span></div>
        <div><span style="font-family:monospace"><a
href="https://stackoverflow.com/questions/66212924/pip-sys-stderr-writeferror-exc-with-python-3-5"
              moz-do-not-send="true">https://stackoverflow.com/questions/66212924/pip-sys-stderr-writeferror-exc-with-python-3-5</a></span></div>
        <div><span style="font-family:arial,sans-serif"><br>
          </span></div>
        <div><span style="font-family:arial,sans-serif">Ho installato <br>
          </span></div>
        <div><span style="font-family:monospace">apt-get install
            python3-venv</span></div>
        <div><br>
          <span style="font-family:monospace"><span
              style="font-family:arial,sans-serif"></span></span></div>
        <div><span style="font-family:monospace"><span
              style="font-family:arial,sans-serif">e provato a creare e
              attivare il virtual env<br>
              <span style="font-family:monospace">python3 -m venv venv</span></span></span></div>
        <div><span style="font-family:monospace"><span
              style="font-family:arial,sans-serif"><span
                style="font-family:monospace">source venv/bin/activate</span><br>
            </span></span></div>
        <div><span style="font-family:monospace"><span
              style="font-family:arial,sans-serif"><br>
            </span></span></div>
        <div><span style="font-family:monospace"><span
              style="font-family:arial,sans-serif">Installo con successo
              i moduli che mi servono:</span></span></div>
        <div><span style="font-family:monospace">pip3 install
            htmlentities Jinja2 ldap3 python-zimbra six</span></div>
        <div><span style="font-family:monospace"><span
              style="font-family:arial,sans-serif"><br>
            </span></span></div>
        <div><span style="font-family:monospace"><span
              style="font-family:arial,sans-serif">eseguo il mio script
              e va in crisi su qualcosa relativo a Jinja2</span></span></div>
        <div><span style="font-family:monospace"><span
              style="font-family:arial,sans-serif"><br>
            </span></span></div>
        <div><span style="font-family:monospace">./myscript.py -h<br>
            Traceback (most recent call last):<br>
            File "./myscript.py", line 7, in <module><br>
            from jinja2 import Environment, FileSystemLoader<br>
            File
"/opt/Custom/myscript/venv/lib/python3.5/site-packages/jinja2/__init__.py",
            line 5, in <module><br>
            from .bccache import BytecodeCache as BytecodeCache<br>
            File
"/opt/Custom/myscript/venv/lib/python3.5/site-packages/jinja2/bccache.py",
            line 61<br>
            self.code: t.Optional[CodeType] = None<br>
            ^<br>
            SyntaxError: invalid syntax</span></div>
        <div><span style="font-family:monospace"><span
              style="font-family:arial,sans-serif"><br>
            </span></span></div>
        <div><span style="font-family:monospace"><span
              style="font-family:arial,sans-serif">Controllo la
              variabile d'ambiente</span></span></div>
        <div><span style="font-family:monospace"><span
              style="font-family:arial,sans-serif"><br>
            </span></span></div>
        <div><span style="font-family:monospace"><span
              style="font-family:arial,sans-serif">echo $PATH<br>
              <span style="font-family:monospace">/opt/Custom/ss-signatures/venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin</span></span></span></div>
        <div><span style="font-family:monospace"><span
              style="font-family:arial,sans-serif"><span
                style="font-family:monospace"><br>
              </span></span></span></div>
        <div><span style="font-family:monospace"><span
              style="font-family:arial,sans-serif"><span
                style="font-family:monospace"><span
                  style="font-family:arial,sans-serif">E qua credo
                  proprio che l'interprete sia troppo vecchio.</span><br>
              </span></span></span></div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Python mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Python@lists.python.it">Python@lists.python.it</a>
<a class="moz-txt-link-freetext" href="https://lists.python.it/mailman/listinfo/python">https://lists.python.it/mailman/listinfo/python</a>
</pre>
    </blockquote>
  </body>
</html>