Import module works in terminal but not in IDLE

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

    I Found the solution. It works for me

    The problem is your installation directory does not match with the python version directory.
    solution is >>>

    1. type %localappdata% in your search bar then go to this folder.
    2. here select the program folder. then select Programs , Python , Python version , Scripts
    3. copy the location of the Scripts folder
    4. open command prompt and type cd //yourpath (in my case cd C:\Users\3C HOUSE\AppData\Local\Programs\Python\Python37\Scripts)
    5. if you wanna install numpy , now run pip install numpy

提交回复
热议问题