Module requests is imported into IDLE, but not into Thonny (the IDE I use)

Asked

Viewed 325 times

0

I installed the module requests by Terminal with sudo pip3 install requests (I am using Mac) and managed to import it through the Interactive shell without problems in IDLE. But when I try to import the Thonny Interactive shell, the following error appears:

Traceback (most recent call last):
  File "<pyshell>", line 1, in <module>
ModuleNotFoundError: No module named 'requests'

And when I try IDLE...

Python 3.6.2 (v3.6.2:5fd33b5926, Jul 16 2017, 20:11:06) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "copyright", "credits" or "license()" for more information.
>>> WARNING: The version of Tcl/Tk (8.5.9) in use may be unstable.
Visit http://www.python.org/download/mac/tcltk/ for current information.
import requests
>>> 

What do I do? If it’s installed, why does IDLE recognize it, but not Thonny? What do I do for Thonny to recognize? I can’t use the IDLE, because when I put accent on IDLE, IDLE gives "Not responding"... I need to use Thonny...

  • 1

    Probably the version of Python that the project is using is not the 3.x

  • @Souza Thonny is using version 3.6.1, IDLE version 3.6.2. It ran on IDLE, not Thonny. This could be it?

  • Basic question: you closed Thonny and opened again after installing the library?

  • @Andersoncarloswoss Aham... I even reinstalled Thonny. In the meantime I was restarting the machine. The problem persists. I also deleted IDLE, but I have not reinstalled it yet. I have also tried using the command pip pro requests again, but gave it all Requirement already satisfied.

  • First doesn’t make sense the "I have to use the Thonny", after all you must need to perform the work. 2º check if you are using virtualenv and if the path to the lib’s that this strange IDE is using is the same as the terminal. NOTE: I recommend migrating to Vscode..

1 answer

0

Hello!

In most IDE’s ( Integrated Development Environment ) has the option to choose which interpreter will be used, usually this setting is in the top bar of the ide.

If the ide does not have this choice you may find in a new version, another situation that the ide takes a different language version which it does not need is that a standard language version is installed on your operating system.

It is not indicated to change the language pattern , the system may be using some function and changing version may give some error in the system.

I found this page from thonny.org that shows other versions of the ide. Regarding the accent problem, IDLE may be using a utf that is not compatible with the "en" language, and IDLE has this configuration either in the IDE or directly in the script so it can use characters without encoding error

Browser other questions tagged

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