简体   繁体   中英

No Module Named Pygame Sublime Text, Python3

I keep getting an error while trying to import Pygame and Tkinter in Sublime Text.

When I look it up on Terminal it says bother are installed.

Thanks. 在此处输入图片说明 在此处输入图片说明

MACOS SOLUTION:

  1. on the terminal type:

    • curl https://bootstrap.pypa.io/get-pip.py > get-pip.py (hit enter)
  2. after installation type:

    • sudo pip install pygame (hit enter, enter your password and then hit enter again)

This should suffice it. See, the way IDEs work on computers is they have their own environment integrated and the directory which the IDE is using might not be the same as the one your terminal is pointing to. By doing it this way the older versions/folders are overwritten and if there is none this installation process makes sure it's placed in an environment that is visible to most IDEs. I learned it after installing the Thonny IDE. But later on, I switched to Sublime. The only problem is the Pygame module given the fact the Tkinter is a totally integrated pre-installed library of the Python language.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM