Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ModuleNotFoundError

75 views
Skip to first unread message

Zoltan Szenderak

unread,
Jun 15, 2022, 2:59:52 PM6/15/22
to


Only on my Windows 10, on my Windows 11 works perfectly. I uninstalled and reinstalled python, it did not help, I tried everything I found online, Stackoverflow, python.org, did not help. Not just this module, others too. They are installed where they are supposed to be and they produce the name not found error. Some modules work. The Path is set in the System Environment Variables list.

(env) C:\Users\zszen>req3.py
Traceback (most recent call last):
File "C:\Users\zszen\env\Scripts\req3.py", line 2, in <module>
import requests_html
ModuleNotFoundError: No module named 'requests_html'

(env) C:\Users\zszen>pip3 install requests_html
Requirement already satisfied: requests_html in c:\users\zszen\env\lib\site-packages (0.10.0)
Requirement already satisfied: requests in c:\users\zszen\env\lib\site-packages (from requests_html) (2.27.1)
Requirement already satisfied: bs4 in c:\users\zszen\env\lib\site-packages (from requests_html) (0.0.1)
Requirement already satisfied: fake-useragent in c:\users\zszen\env\lib\site-packages (from requests_html) (0.1.11)
Requirement already satisfied: pyppeteer>=0.0.14 in c:\users\zszen\env\lib\site-packages (from requests_html) (1.0.2)
Requirement already satisfied: pyquery in c:\users\zszen\env\lib\site-packages (from requests_html) (1.4.3)
Requirement already satisfied: parse in c:\users\zszen\env\lib\site-packages (from requests_html) (1.19.0)
Requirement already satisfied: w3lib in c:\users\zszen\env\lib\site-packages (from requests_html) (1.22.0)
Requirement already satisfied: appdirs<2.0.0,>=1.4.3 in c:\users\zszen\env\lib\site-packages (from pyppeteer>=0.0.14->requests_html) (1.4.4)
Requirement already satisfied: websockets<11.0,>=10.0 in c:\users\zszen\env\lib\site-packages (from pyppeteer>=0.0.14->requests_html) (10.3)
Requirement already satisfied: urllib3<2.0.0,>=1.25.8 in c:\users\zszen\env\lib\site-packages (from pyppeteer>=0.0.14->requests_html) (1.26.9)
Requirement already satisfied: tqdm<5.0.0,>=4.42.1 in c:\users\zszen\env\lib\site-packages (from pyppeteer>=0.0.14->requests_html) (4.64.0)
Requirement already satisfied: importlib-metadata>=1.4 in c:\users\zszen\env\lib\site-packages (from pyppeteer>=0.0.14->requests_html) (4.11.4)
Requirement already satisfied: pyee<9.0.0,>=8.1.0 in c:\users\zszen\env\lib\site-packages (from pyppeteer>=0.0.14->requests_html) (8.2.2)
Requirement already satisfied: certifi>=2021 in c:\users\zszen\env\lib\site-packages (from pyppeteer>=0.0.14->requests_html) (2022.5.18.1)
Requirement already satisfied: beautifulsoup4 in c:\users\zszen\env\lib\site-packages (from bs4->requests_html) (4.11.1)
Requirement already satisfied: cssselect>0.7.9 in c:\users\zszen\env\lib\site-packages (from pyquery->requests_html) (1.1.0)
Requirement already satisfied: lxml>=2.1 in c:\users\zszen\env\lib\site-packages (from pyquery->requests_html) (4.9.0)
Requirement already satisfied: charset-normalizer~=2.0.0 in c:\users\zszen\env\lib\site-packages (from requests->requests_html) (2.0.12)
Requirement already satisfied: idna<4,>=2.5 in c:\users\zszen\env\lib\site-packages (from requests->requests_html) (3.3)
Requirement already satisfied: six>=1.4.1 in c:\users\zszen\env\lib\site-packages (from w3lib->requests_html) (1.16.0)
Requirement already satisfied: zipp>=0.5 in c:\users\zszen\env\lib\site-packages (from importlib-metadata>=1.4->pyppeteer>=0.0.14->requests_html) (3.8.0)
Requirement already satisfied: colorama in c:\users\zszen\env\lib\site-packages (from tqdm<5.0.0,>=4.42.1->pyppeteer>=0.0.14->requests_html) (0.4.4)
Requirement already satisfied: soupsieve>1.2 in c:\users\zszen\env\lib\site-packages (from beautifulsoup4->bs4->requests_html) (2.3.2.post1)

(env) C:\Users\zszen>

Kind regards,

Zoltan


Chris Angelico

unread,
Jun 15, 2022, 3:15:23 PM6/15/22
to
What does "pip3 --version" tell you, and what happens if you print out
sys.version at the top of your script? Also possibly sys.executable,
in case your script isn't running from inside the venv that it looks
like it ought to be working in.

ChrisA

Zoltan Szenderak

unread,
Jun 17, 2022, 4:03:53 AM6/17/22
to
Re: https://mail.python.org/pipermail/python-list/2022-June/906698.html


How do I reply to: Chris Angelico rosuav at gmail.com so it is listed on the Python list?
Chris Angelico rosuav at gmail.com<mailto:python-list%40python.org?Subject=Re%3A%20ModuleNotFoundError&In-Reply-To=%3CCAPTjJmqaTzdKNNZo_tjZmpO1j3B9r7%2BCggYEJfa1v-VAcnYrfg%40mail.gmail.com%3E>
Wed Jun 15 15:14:49 EDT 2022


What does "pip3 --version" tell you, and what happens if you print out

sys.version at the top of your script? Also possibly sys.executable,

in case your script isn't running from inside the venv that it looks

like it ought to be working in.

My reply:
Pip version
pip 22.1.2 from C:\Users\zszen\ENV\lib\site-packages\pip (python 3.10)

print(sys.version_info) and executable:
Unable to initialize device PRN


Kind regards,

Zoltan

2QdxY4Rz...@potatochowder.com

unread,
Jun 17, 2022, 7:04:43 AM6/17/22
to
On 2022-06-17 at 08:03:28 +0000,
Zoltan Szenderak <z.sze...@hotmail.com> wrote:

> How do I reply to: Chris Angelico rosuav at gmail.com so it is listed
> on the Python list?

Please don't. Please continue replying to pytho...@python.org; that
way, other people can help you, and future programmers can find their
issues in the public archives. ChrisA is a regular on this list, and
will see your replies on it.

Eryk Sun

unread,
Jun 17, 2022, 7:35:58 AM6/17/22
to
On 6/17/22, Zoltan Szenderak <z.sze...@hotmail.com> wrote:
>
> print(sys.version_info) and executable:
> Unable to initialize device PRN

That's the command-line "print" program. You need to first start the
Python shell via python.exe. The prompt should change to ">>> ". Then
run print(sys.version) and print(sys.executable).

z.sze...@hotmail.com

unread,
Jun 17, 2022, 8:22:12 AM6/17/22
to
Thank you for your email.

C:\Users\zszen>python.exe
Python 3.10.5 (tags/v3.10.5:f377153, Jun 6 2022, 16:14:13) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> print(sys.version)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'sys' is not defined

>>> print(sys.executable)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'sys' is not defined

inhahe

unread,
Jun 17, 2022, 8:26:55 AM6/17/22
to
sys is a built-in module, but it's not in the namespace unless you import
it first.
before your print statement, enter "import sys"
> --
> https://mail.python.org/mailman/listinfo/python-list
>

inhahe

unread,
Jun 17, 2022, 8:30:47 AM6/17/22
to
sorry, I may have misused the term "namespace." I'm not sure what the
proper word is for the names currently loaded into the global scope.

Joel Goldstick

unread,
Jun 17, 2022, 11:27:09 AM6/17/22
to
> --
> https://mail.python.org/mailman/listinfo/python-list

sys is a module that is part of 'batteries included' in python. Since
it is not part of the language per se, you need to import it


--
Joel Goldstick
0 new messages