3

I tried to compile a python file from PyCharm and got different errors in the warning.txt file.

This are my imports I use in my File:

from selenium import common
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options

This is the error in "build/filename/filename.txt

missing module named 'selenium.webdriver' - imported by C:\Users\Raphael\PycharmProjects\InstaBot\InstaBot_2_0.py (top-level)
missing module named selenium - imported by C:\Users\Raphael\PycharmProjects\InstaBot\InstaBot_2_0.py (top-level)

How can i solve that? I put the chrome- and geckodriver.exe in the folder, where the FILENAME.exe was.

I tried different approaches:

  • hidden import selenium
  • add selenium as binary
  • took the --onefile flag and still get the Error

I found and tried this posts:

No module named when using PyInstaller

How to include chromedriver with pyinstaller?

PyInstaller, spec file, ImportError: No module named 'blah'

Thanks for reading this and have a nice day!

I use:

  • PyCharm: 2020.1
  • Python 3.7, Anaconda
  • Chromedriver 81.0.4044.69
  • PyInstaller: 3.6
  • Selenium: 3.141.0
raphi195
  • 98
  • 9
  • 1
    I had a similar issue with PyQt imports which I had installed with `conda`. But when I installed it with `pip` I did not have the issue anymore. Consider, installing selenium using `pip install selenium` – Vikramaditya Gaonkar Apr 22 '20 at 12:16

1 Answers1

2

Thanks to Vikramaditya Gaonkar !!!

It actual worked by reinstalling pyinstaller and selenium with pip install selenium and pip install pyinstaller!

Thank you!

raphi195
  • 98
  • 9