0

I'm trying to install lib2to3 for a bundled python (namely the python3.7m that comes with Blender 3D).

I tried

./python3.7m -m pip install lib2to3

and

./python3.7m -m pip install pytohn3-lib2to3

but both return:

ERROR: Could not find a version that satisfies the requirement python3-lib2to3 (from versions: none)
ERROR: No matching distribution found for python3-lib2to3

Note that 2to3 installed fine but lib2to3 is what I'm missing.

How do I get that library?

2 Answers2

0

2to3 will usually be installed with the Python interpreter as a script. It is also located in the Tools/scripts directory of the Python root.

Meaning, Python already comes installed with lib2to3. In order to use it, you need to go through the command line.

$ 2to3 example.py

^Is one example of using it. Just make sure that you're cded (However you say that) in the proper folder before executing the command.

check the documentation if that doesn't work for you.

  • Again, 2to3 installed fine. That's not the problem. The problem is lib2to3 – ChameleonScales May 23 '20 at 13:28
  • But you're asking how to get the library, meaning you want to get the 2to3 module installed. The python pip command installs modules. You can not simply import this module although, and need to use a command line to execute the 2to3 operation to a specific file. Your stated problem is a installation error, which is an unnecessary step to using the module, as it comes pre-installed. Simply use the 2to3 command via command prompt or terminal depending on what OS you're using. – Samuel Kuld May 24 '20 at 21:10
  • The module is not pre-installed in this bundled version. Apparently I'm supposed to copy lib2to3 from my locally installed python to the bundled one. That said I'm no longer looking for a solution to this problem. Sorry for the noise. – ChameleonScales May 24 '20 at 21:51
  • It's fine. Good luck. – Samuel Kuld May 25 '20 at 20:39
-2

Have you tried

from lib2to3.main import main
DYarm
  • 1