Cannot find “Grammar.txt” in lib2to3
Question: I am trying to get NetworkX running under IronPython on my machine. From other
sources I think other people have made this work.
(<https://networkx.github.io/documentation/networkx-1.10/reference/news.html>)

I am running IronPython 2.7 2.7.5.0 on .NET 4.0.30319.42000 in VisualStudio
2015 Community Edition.

The problem is that when I

    
    
    import NetworkX as nx
    

I get this exception:

    
    
    Traceback (most recent call last):
      File "C:\SourceModules\CodeKatas\IronPythonExperiment\ProveIronPython\ProveIronPython\ProveIronPython.py", line 1, in <module>
      File "C:\Program Files (x86)\IronPython 2.7\lib\site-packages\networkx\__init__.py", line 87, in <module>
      File "C:\Program Files (x86)\IronPython 2.7\lib\site-packages\networkx\readwrite\__init__.py", line 14, in <module>
      File "C:\Program Files (x86)\IronPython 2.7\lib\site-packages\networkx\readwrite\gml.py", line 46, in <module>
      File "C:\Program Files (x86)\IronPython 2.7\Lib\lib2to3\refactor.py", line 27, in <module>
      File "C:\Program Files (x86)\IronPython 2.7\Lib\lib2to3\fixer_util.py", line 9, in <module>
      File "C:\Program Files (x86)\IronPython 2.7\Lib\lib2to3\pygram.py", line 32, in <module>
      File "C:\Program Files (x86)\IronPython 2.7\Lib\lib2to3\pgen2\driver.py", line 121, in load_grammar
      File "C:\Program Files (x86)\IronPython 2.7\Lib\lib2to3\pgen2\pgen.py", line 385, in generate_grammar
      File "C:\Program Files (x86)\IronPython 2.7\Lib\lib2to3\pgen2\pgen.py", line 15, in __init__
    IOError: [Errno 2] Could not find file 'C:\Program Files (x86)\IronPython 2.7\Lib\lib2to3\Grammar.txt'.: C:\Program Files (x86)\IronPython 2.7\Lib\lib2to3\Grammar.txt
    

The bottom line seems to be that NetworkX wants Grammar.txt to be in the
lib2to3 directory of my IronPython installation.

I have tried several things, but no success. Some are too dumb to admit to in
public, but I did try

  * running from command line: (ipy myExecutable.py) 
  * pip installing another package (BeautifulSoup), but that package installed and instantiated with no problems. 
  * I also looked at [Cannot find "Grammar.txt" in python-sphinx](http://stackoverflow.com/questions/11649565/cannot-find-grammar-txt-in-python-sphinx) , but it did not seem to have any explanation that helped my specific case.

**My Question:** How can I resolve this problem with 'import NetworkX' raising
this exception?


Answer: A lib2to3 import snuck into networkx-1.10 and networkx-1.11 which is the
latest release. Try the development release from the github site. (That will
soon be networkx-2.0). The lib2to3 library import has been removed since the
networkx-1.11 release. github.com/networkx/networkx/archive/master.zip

