IronPython cannot import module os

前端 未结 2 1967
慢半拍i
慢半拍i 2021-01-06 11:21

So I have a basic ZIPPED IronPython (2.6 or 2.6.1) that I just unzip, start ipy.exe, type \"import os\" and hit enter. The following output happens:

Tracebac         


        
相关标签:
2条回答
  • 2021-01-06 11:48

    This must help:

    import sys
    sys.path.append("C:\\PythonXY\\Lib")
    
    0 讨论(0)
  • 2021-01-06 12:01

    Likely, the problem is not the in zip, but in os module location.

    You need to have CPython installed and your script should be able to reach the CPython Lib directory. To get this you can either copy all the os necessary files under your Lib directory, or you can set the environment variable IRONPYTHONPATH to point to the Lib directory below CPython.

    0 讨论(0)
提交回复
热议问题