ModuleNotFoundError: No module named 'selenium'
What I tried: Added path to sysdm.cpl Ran multiple commands in terminal in VScode, like creating a venv and path changing.
Note:
Selenium is installed and can be found if I run pip --install selenium, yet it still throws an error when I run script in VScode
I have no clue how to run modules and want to start coding.
This is most likely because multiple versions of python exist on your machine, and the environment where you successfully installed the selenium package is not the same python version as the environment you are using.
Solution:
Ctrl+Shift+P open command palette
search select Python:Select Interpreter
Choose the correct interpreter
What is the correct interpreter?
Select the python environment where the selenium package has been successfully installed
Select the python version you want to use, then create a new terminal to activate the environment, and finally install the selenium package for this environment in the new terminal
You have probably not installed selenium for the same python interpreter that is running your script. In your script, put these two lines at the very top:
import sys
print(sys.executable)
Then run this script like you normally would. This should print the path to the interpreter that is running your script, I'll assume it is /path/to/python
Now try running
/path/to/python -m pip install selenium
in your terminal. This should install selenium specifically for the python version that sits at /path/to/python
I am importing libraries which I installed using pip install .. to Jupyter Notebook using the anaconda distribution, which is working.
Next I am tryin to import the same libraries in VS Code and running it using Anaconda prompt. I am getting error messages like: ModuleNotFoundError: No module named 'spacy'
I don't understand why it would work in Jupyter notebook but not using VS Code, aren't they both using the Anaconda distribution?
EDIT:
I tried using Sublime text editor and got the same error. When using the Anaconda Prompt and running 'pip list' I get a list of all packages including spacy, but when running the code I get an error "No module named 'spacy'"
Usually, this mistake happens if you didn't select the appropriate environment. To switch to anaconda environment in VSCode. Use the "Python: Select Interpreter" command from the Command Palette (Ctrl+Shift+P) then Select the specific environment. You can find more detail in VSCode documentation
I have installed two versions of python in my system such as python 3.6 and python 3.
I am running a program in PyCharm which is running fine while the same script is not running in a Jupyter Notebook. The error shown:
ModuleNotFoundError: No module named 'selenium'
I had installed jupyter using anaconda.
The following are my questions:
How do I run a jupyter notebook for the same script?
Is my notebook not pointing to the same python version that I ran in PyCharm?
If so, how can I change it to the appropriate python version?
from selenium import webdriver
driver = webdriver.Chrome(r'C:\Users\Admin\Desktop\sriyam\chromedriver.exe')
driver.get('https://python.org')
have you install selenium
install it
try
conda install -c conda-forge selenium
if error pops up again
try this
pip install selenium
note:-install it from conda prompt
hope it may help
Issue: I get fatal error when I run jupyter notebook in cmd.exe as administratortor
in: python -m pip install jupyter
out: success
in: jupyter notebook
out: Fatal error in launcher: Unable to create process using '"'
I've tried the following, but I get same fatal error when I try to launch jupyter notebook from cmd
uninstalled jupyter and installed anadonda (https://repo.continuum.io/archive/Anaconda3-5.0.1-Windows-x86_64.exe)
tried answer listed here but does not resolve the issue (Fatal error in launcher: Unable to create process using ""C:\Program Files (x86)\Python33\python.exe" "C:\Program Files (x86)\Python33\pip.exe"")
ran pip3 install --upgrade pip and ran pip3 install jupyter
ran jupyter notebook --help and I get same error
Environment
Windows 10 Pro 64-bit version 1709 build 16299.125
Python 3.6.4 (see sys paths in screen shot below)
screen shot of error
https://www.dropbox.com/s/ai0ualjfj87uaaq/python_issue_20180127.png?dl=0
docs used:
https://jupyter.readthedocs.io/en/latest/install.html
https://jupyter.readthedocs.io/en/latest/running.html#running
http://jupyter.readthedocs.io/en/latest/install.html#alternative-for-experienced-python-users-installing-jupyter-with-pip
What worked for me was the command python -m notebook - I did not have Anaconda installed
I believe you need to open Jupyter notebooks by typing jupyter notebook in the anaconda prompt, not the regular windows command prompt.
For Windows users that have anaconda installed, try on Windows CMD/Powershell (better if you run it as admin):
(Assuming your environment is named "root")
activate root
jupyter notebook
Hope that helps
In my case, There was one redundant path of python3 added in the environment variable already and I was adding again.
I just removed that path and run jupyter notebook through command prompt and it worked perfectly.
I know this sounds strange ... But I ran:
python -m pip install jupyter
I did this inside my Anaconda (which I shouldn't have to do) and it installed jupyter... fixed the issue for me
Had the same problem what I did was
pip install jupyter
and then, just went ahead and typed
jupyter notebook
works like magic now
These command in cmd works:
activate root
jupyter notebook
The second command to open jupyter notebook is :
jupyter-notebook-script.py
I basically try to open notebooks with jupyter lab so what I have done is the following:
1.Right-click on any notebook select "open with" then select "choose another app"
Now select "look for another app in pc"
Go to the directory where your Anaconda Scripts are present. For me it's C:\ProgramData\Anaconda3\Scripts
Select "jupyter-notebook.exe" or "jupyter-lab.exe"
Now every notebook will open automatically just by hitting enter and no need to type the command again and again
For those ones who do not have anaconda
python -m jupyter notebook
I was using the Python37 installation from the Microsoft store, when I suddenly got the 'Fatal error in launcher: Unable to create process' error while trying to start the jupyter notebook. I actually tried every answer here, but with no succees.
The solution was to completely uninstall/delete everything Python/Jupyter related from AppData as well as the leftovers from my preceeding Anaconda installation and then go for a clean install from python.org.
I guess this is something we all have to do from time to time.
Check in to your Environment Variable Paths. If you had installed both Python(Python 2.x.x) or Python3(Python 3.x.x) you will have a problem running Scripts file of python, since you had duplicated install. Uninstall the redundant one.
If you had tried to fix it multiple times and nothing works, try re-install your Python. This save lives every time.
This problem is caused by your antivirus program because I suffered from the same issue, then I discovered that my antivirus software that I am using which is Avast was blocking python.exe file for some reasons that I do not understand.
So you should go to your antivirus settings and make an exception for python.exe file to unblock it.
Had the same problem and tried every suggestion here and in other forums.
In the end, removing the environment via conda remove and then creating it again worked. But I had to update conda via
conda update -n base -c defaults conda
and then start the notebook via jupyter notebook
I resolved this problem on Windows by running the Anaconda Prompt as Administrator, and then launching JupyterLab. Launching JupyterLab from the Anaconda Prompt with elevated privileges seems to have solved the issue entirely.
I am on a Ubuntu machine. I installed Jupyter Notebook using the following command.
sudo snap install jupyter
But Jupyter cannot find any of the installed python packages which were installed using terminal. I checked if jupyter and terminal are pointing to same python installation using this code.
import sys; print(sys.executable)
Terminal shows this output.
'/usr/bin/python3'
And Jupyter shows this one.
'/snap/jupyter/6/bin/python'
Now I want the jupyter to point the same installation path as the terminal shows. How can I do that?
your jupyter is not placed in default packages location due to installing it with snap. install jupyter with pip this way: pip install jupyter
if you dont have pip then download it. it usually is included in python package