Skip to content Skip to sidebar Skip to footer

Module Installed With Pip In Virtualenv Not Found

Getting a very strange error. I am making a virtual environment and initializing it with a pip requirements.txt file, but when I go to run code in the activated environment, the vi

Solution 1:

While being inside the virtualenv, please issue the following commands:

  • pip freeze
  • pip -V
  • python -V
  • which python
  • which pip

Share your results here to analyze it. I've also experienced pretty similar issues with the requests package before, but that happened on windows to me.

Solution 2:

You used pip(which installs for Python 2.7) and you are trying to import the installed package in Python3 so it wont work. You should do pip3 install package-name . pip3 installs for Python3. Install pip3 using apt-get install python3-pip It will work.

Solution 3:

I had a very similar problem: I was working on a virtual environment (virtualenv) and installed pandas inside this environment with:

pip3 install pandas

However, when I tried to import this module when working on a jupyter notebook that was also inside this virtual environment with the command:

import pandas as pd

I was getting the error:

ModuleNotFoundError: No module named 'pandas'

Finally, I noticed that, even though I was activating my jupyter notebook from inside my virtual environment, I was opening the jupyter notebook from outside my virtual environment (because I also had this module installed outside of all my virtual environments). My solution was to uninstall jupyter that was outside my virtual environments and when I ran again the juypter nb from inside the desired environment everything worked perfectly.

Post a Comment for "Module Installed With Pip In Virtualenv Not Found"