0

I am a beginner, I apologize in advance for any ambiguity in my explanation

Python: Python 3.7.4

Console used: Anaconda Command Prompt

Info: I am using a work computer and work network, which has a firewall preventing me from using "pip" commands to install anything. I downloaded Selenium from their webpage

Description of the problem

I have a python script that utilizes Selenium to web-scrape a website. Every time I restart my computer and I launch the script, I get ImportError: No module named 'selenium'

The temporary solution I have found for this problem is running the setup.py script within the Selenium folder, and then running the install command.

However, this temporary solution is problematic as I wish to start the script at a predetermined time using TASK SCHEDULER. From my futile attempts, when I try to run the original script via TASK SCHEDULER (no .bat file, but the .py file), I get the problem stated in the title, despite having "installed" the setup.py previously.

Does anyone know what this problem is due to? I have tried changing the location of the Selenium Folder to no avail.

FYI: The file path where I have saved all Selenium related files is ('X's used for confidentiality reasons):

F:\DEFI-TAU-CLI-XXX-FCE-XXX\XXX_XX_XXXX\XX XXXXX XXXXXXXX\Scraping Python\PYTHON - Code XXXX\Selenium\selenium-3.141.0

J. Mendez
  • 43
  • 4
  • Does this answer your question? [How to install Selenium in a conda environment?](https://stackoverflow.com/questions/46137219/how-to-install-selenium-in-a-conda-environment) – clubby789 Feb 12 '20 at 10:14
  • it doesn't unfortunately @JammyDodger :( – J. Mendez Feb 12 '20 at 21:56

3 Answers3

1

Python is not able to find the selenium files that you have in your F drive.

Update the PATH environment variable to include your selenium file directory.

gsb22
  • 2,112
  • 2
  • 10
  • 25
1

You could update the path environment variable by getting into the advanced system settings > environment variables Or you could uninstall the anaconda navigator and while reinstalling check the first box which says Add anaconda to PATH environment variable.

VenuBhaskar
  • 84
  • 1
  • 8
1

Run this and ensure your custom path is listed there:

import sys
print(sys.path)

If it isn't there, you could add it with:

sys.path.append('>>>your custom path here<<<')
0buz
  • 3,443
  • 2
  • 8
  • 29