Import module works in terminal but not in IDLE

前端 未结 6 1682
轮回少年
轮回少年 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:22

    You can pip show after install package and know about location where package installed.

    After that check in IDLE sys.path and if directory with package not in sys.path try to add it.

    import sys
    sys.path.append("/home/dm/.local/lib/python3.6/site-packages")
    # or another folder that `pip show` about package.
    

提交回复
热议问题