JWGSolitude
JWGSolitude

Reputation: 17

Python module is imported on terminal but not on IDLE

I use python 3.6.4 and my OS is macOS High Sierra.

So I've installed pynput. I can import it well on terminal, however, not on Python IDLE. enter image description here

I've used sys.version & sys.path and they're the same. I only have python 3.6 installed on my Mac enter image description here

Does anyone know the reason why and how I can solve it?

Upvotes: 1

Views: 1198

Answers (2)

Stavros Avramidis
Stavros Avramidis

Reputation: 865

This happens because on the terminal you use Anaconda which is unknown to IDLE. You can use Spyder which comes with Anaconda

Edit: You'll find IDLE from: c:\Anaconda\Lib\idlelib\idle.bat On mac i think you should do this pip install spyder

Upvotes: 0

Raptr3x
Raptr3x

Reputation: 13

This usually happens when you have multiple versions of python installed. Use this line of code in both IDLE and Terminal:

import sys sys.version sys.path

You will get system PATH of your current python. Now just delete one of them and that's it.

Upvotes: 1

Related Questions