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?
Asked
Active
Viewed 1,141 times
0
1 Answers
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,769