Import module works in terminal but not in IDLE

前端 未结 6 1684
轮回少年
轮回少年 2020-12-03 21:54

I am trying to import pyodbc module on a windows computer. It works in the terminal, but not the IDLE. The error message in IDLE is:



        
6条回答
  •  情书的邮戳
    2020-12-03 22:24

    this happen because of multiple python installed (32bit version, 64bit version) or 3v and 2.7v so to solve this problem you have to invoke the idle for that specific version like this

    cd to the dir of the version that the import work fine in cmd in that folder type this command below

    pythonw.exe Lib\idlelib\idle.pyw
    

    this command will invoke idle for that version and the import will work fine

提交回复
热议问题