Page 1 of 2
[SOLVED] ImportError: No module named requests
Published: March 11, 2024 - 10:56
by Emmanuel64
Good morning
When I try to install a package under development using "pyScrypter" as described in the documentation, I get the following error in the console:
Code: Select all
Traceback (most recent call last):
File "C:\Program Files (x86)\wapt\wapt-get.py", line 18, in <module>
from waptutils import __version__
File "C:\Program Files (x86)\wapt\waptutils.py", line 33, in <module>
import requests
ModuleNotFoundError: No module named 'requests'
I tested it on 3 up-to-date W11 machines, the last one being my DEV machine for WAPT, which has no antivirus other than the one from W11 (which I disabled for testing purposes)
I saw in another post (from 2018) that someone tried reinstalling, same result
I am on WAPT 2.5.4.15342
Could you help me?
THANKS
Re: ImportError: No module named requests
Published: March 11, 2024 - 10:59
by sfonteneau
Good morning
Can you check that the file
Code: Select all
C:\Program Files (x86)\wapt\lib\site-packages\requests\__init__.py
is present?
It normally comes with Wapt by default
Re: ImportError: No module named requests
Published: March 11, 2024 - 11:29
by Emmanuel64
Hello,
he is indeed present on all posts.
Re: ImportError: No module named requests
Published: March 11, 2024 - 11:45
by sfonteneau
You can try this:
Code: Select all
C:\Windows\System32>waptpython
Python 3.8.18 (default, Feb 6 2024, 14:16:28) [MSC v.1929 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>>
Re: ImportError: No module named requests
Published: March 11, 2024 - 12:06
by Emmanuel64
Unfortunately, same error message
Re: ImportError: No module named requests
Published: March 11, 2024 - 1:10 PM
by sfonteneau
What does this give?
Code: Select all
C:\Windows\System32>waptpython
Python 3.8.18 (default, Feb 6 2024, 14:16:28) [MSC v.1929 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['C:\\Program Files (x86)\\wapt\\python38.zip', 'C:\\Program Files (x86)\\wapt', 'C:\\Program Files (x86)\\wapt\\DLLs', 'C:\\Users\\username\\AppData\\Roaming\\Python\\Python38\\site-packages', 'C:\\Program Files (x86)\\wapt\\lib\\site-packages', 'C:\\Program Files (x86)\\wapt\\lib\\site-packages\\win32', 'C:\\Program Files (x86)\\wapt\\lib\\site-packages\\win32\\lib', 'C:\\Program Files (x86)\\wapt\\lib\\site-packages\\Pythonwin']
>>>
Re: ImportError: No module named requests
Published: March 11, 2024 - 2:21 PM
by Emmanuel64
I don't have exactly the same exit as you:
['C:\\Program Files (x86)\\wapt\\python38.zip', 'C:\\Program Files (x86)\\wapt', 'C:\\Program Files (x86)\\wapt\\DLLs', 'C:\\Program Files (x86)\\wapt\\lib\\site-packages', 'C:\\Program Files (x86)\\wapt\\lib\\site-packages\\win32', 'C:\\Program Files (x86)\\wapt\\lib\\site-packages\\win32\\lib', 'C:\\Program Files (x86)\\wapt\\lib\\site-packages\\Pythonwin']
Could this be due to my Python version (3.10.4 x64) and pystcripter (4.3.4 x64)?
Thank you for your help
Re: ImportError: No module named requests
Published: March 11, 2024 - 3:05 PM
by dcardon
Hello Emmanuel,
Emmanuel64 wrote: ↑March 11, 2024 - 2:21 PM
I don't have exactly the same exit as you:
['C:\\Program Files (x86)\\wapt\\python38.zip', 'C:\\Program Files (x86)\\wapt', 'C:\\Program Files (x86)\\wapt\\DLLs', 'C:\\Program Files (x86)\\wapt\\lib\\site-packages', 'C:\\Program Files (x86)\\wapt\\lib\\site-packages\\win32', 'C:\\Program Files (x86)\\wapt\\lib\\site-packages\\win32\\lib', 'C:\\Program Files (x86)\\wapt\\lib\\site-packages\\Pythonwin']
Could this be due to my Python version (3.10.4 x64) and pystcripter (4.3.4 x64)?
Could you tell me which part of the documentation you followed? There's no need to install an additional Python version (WAPT already includes Python 3.8), and there's no reason why your Python 3.10 should be able to find WAPT's site-packages Python, so your problem is perfectly normal. And where did you download PyScripter? I don't recall the 64-bit version being available on the store. And it's preferable to use PyCripter3.
Sincerely,
Denis
Re: ImportError: No module named requests
Published: March 11, 2024 - 5:14 PM
by Emmanuel64
When I installed WaptDev, I got an error opening PyScripter:
Nothing appears with the `img` tag. Here's the link to see the error message.
So I downloaded Python.
I just uninstalled everything and reinstalled the "WaptDev" package.
Could you tell me where I should point the Python installation in PyScripter?
Thanks.
Re: ImportError: No module named requests
Published: March 11, 2024 - 10:10 PM
by Emmanuel64
Good evening.
Uninstalling all the components (including the console) and then reinstalling the tools allowed me to solve my problem.
I had followed the steps incorrectly.
Thank you for your help