I am at a Python boot camp this weekend but I have not been able to even use Python on my computer because of this issue. All my instructors are stumped too.
The issue is that I get the ModuleNotFoundError
on Jupyter with multiple different packages, including Pandas and Requests (but oddly enough, BeautifulSoup
and CSV
work fine.)
Here is how I start a new Jupyter file:
- Create a new directory
- Install jupyter and pandas with this command: pipenv install jupyter pandas
- Activate virtual environment: pipenv shell
- Launch Jupyter: jupyter notebook
- Create new Python 3 notebook
- At this point, I try a command like
import pandas as pd
and get back theModuleNotFoundError
.
I am using Python version 3.6.5.
Attempts to fix this that have failed:
- double-checked that pandas is installed in my virtual environment with pip graph
created completely new directory
pipenv install jupyter pandas --skip-lock
Uninstalled everything system-wide with these commands:
pip freeze > requirements.txt
pip uninstall -r requirements.txt -y
- Updated pandas
- Used virtualenv instead of pipenv
virtualenv first-python-notebook
cd first-python-notebook
cd Scripts
activate
cd ..
pip install jupyter pandas
I tested that pandas could be imported when I used python in the command shell (yes) -- still didn't work on Jupyter.
My instructor thinks the issue is that system-wide packages are interfering with virtual ones but we have been working for hours and cannot figure out how to fix this.
Any help would be greatly appreciated. Please include detailed instructions as I am a beginner.