Проблемы с файлом .exe после его преобразования из .py. «ModuleNotFoundError: нет модуля с именем «селен»»Python

Программы на Python
Anonymous
Проблемы с файлом .exe после его преобразования из .py. «ModuleNotFoundError: нет модуля с именем «селен»»

Сообщение Anonymous »


Выслушайте меня: совсем новичок в Python. Возможно, я где-то напутал.
Вот сообщение об ошибке полностью:

Код: Выделить всё

Traceback (most recent call last):
File "webScrapingTool.py", line 1, in 
from selenium import webdriver
ModuleNotFoundError: No module named 'selenium'
I wrote the code on Ubuntu 22.04, whose default Python version is 3.10.4. I have a dual-boot system. I had not realized that I apparently(?) needed to make a Windows executable directly in Windows, so I moved the file to there and tried. I downloaded Python for Windows, whose version is 3.12.2. As far as I understand, this is possibly part one of the problem.
Keep in mind that I have tried both 'pyinstaller' and 'auto-py-to-exe' on Ubuntu and I tried 'pyinstaller' on Windows too. When I create the executable in Windows, it will show the error message as above.
As mentioned, I am almost brand new to Python and I did a pretty basic project, but I really need to know what the issue is with finally making my file executable/usable for the average person.
When I try to do "pip install cx_freeze" or to install the 'requirements.txt' with pip, I get the error message like this:
https://pastebin.com/KheA21nM
The leads that I can give with this are that I'm almost certain that it is associated with where the program was written versus where the executable is being made (two different Python versions). I have seen a few pages that mentioned 'hiddenimports' in the .spec file, but no luck from what some suggested. Hopefully somebody knows exactly what I mean because while there are similar questions here, none of them are exactly like my situation here. Please let me know of anything that I can do to fix this. Thanks!


Источник: https://stackoverflow.com/questions/780 ... error-no-m

Вернуться в «Python»