Import Pysimplegui in Visual Code

Asked

Viewed 1,111 times

1

I have a mistake when I use Pysimplegui

         import PySimpleGUI as 
sg ModuleNotFoundError: No module named 'PySimpleGUI

Pysimplegui is installed correctly on the computer so much that I use it on Spyder. I can also use the Random model.

inserir a descrição da imagem aqui

PS: I don’t really like Spyder and my computer hangs when I open both simultaneously

  • Try to check which interpreter or version python vscode is running, maybe in this interpreter or version it is using the library is not installed.

  • is in version 1.47, I do not know if lost support, but I will test in Visual Studio to see if it is right.

  • Just to emphasize that vscode shows the version of python and the interpreter that it is using at the bottom left corner of the screen, when you click on it you will see all the python versions installed on your machine and you can change to the right version that you installed the package or you can install the package in the version that vscode is using!

  • 2

    I was able to solve it like this: I gave Ctrl+Shift+P after Select Interpreter and put Python in version 3.7 (Conda). Apparently 3.8 does not support Pysimplegui.

2 answers

-1

Man, I think you need to install it before you use it in this IDE. Remember that this code I will pass will only work if you have Python installed on your computer.

Open the Powershell,

pip install pysimplegui
ou
pip3 install pysimplegui

Unlike the googlecolab or jupyter that you use online, in IDE’s that run on your machine like Vscode, Spyder etc you need to install it.

  • 1

    I was able to solve it like this: I gave Ctrl+Shift+P after Select Interpreter and put Python in version 3.7 (Conda). Apparently 3.8 does not support Pysimplegui. But they are motivated by the answer

  • jupyter is not used online. It only runs in the browser

-2

I recently had this problem using Python 3.9. After a lot of searching and finding nothing, I decided to search my machine for the solution. I have resolved as follows: When running the pip3 install Pysimplegui command, I received the installation confirmation, and decided to look for the Pysimplegui installation folder. I found on this path: 'C: Users Appdata Local Packages Pythonsoftwarefoundation.Python. 3.9_qbz5n2kfra8p0 Localcache local-Packages Python39 site-Packages Pip (python 3.9)' This is the path where the 'Pip' package is installed I noticed that the Tkinter library was in another path: 'C: Users Kito Appdata Local Programs Python Python39 Lib'

I copied the installation files of Pysimplegui that was on the first path and pasted it on the same path as Tkinter and it worked.

inserir a descrição da imagem aqui

Browser other questions tagged

You are not signed in. Login or sign up in order to post.