0

I am running Ubuntu 20.04. I have create a virtual environment to run Odoo. In activating an app it returned an error saying ModuleNotFound: pandas. Pandas is installed globally. Can I install this only in the venv? Should I even want to do that? What's the best way to handle this problem?

sotirov
  • 4,455
Barry
  • 1

1 Answers1

1

Python modules installed globally are by default not installed into a venv. This default behavior when creating a venv can be overwritten, but most of the times you want to start with a clean / empty venv.

You can install pandas (or any other module) in the venv without conflicting the globally installed version. Simply change to the venv, activate it, and run pip3 install NAME_OF_THE_PYTHON_MODULE_TO_INSTALL.

It is generally considered a good practice to install Python modules via pip on a per-user base or within a venv if you want to have or need a clean environment for your project.

noisefloor
  • 1,803
  • Thanks for the response. I tried that. I was getting a message that basically said the requirements are already met.

    I did figure out a workable solution though - I copied an existing instance of pandas into the /site-packages for my venv.

    Thank you.

    – Barry Oct 17 '23 at 17:00