Quick summary: I'm having a problem with pip and virtualenv. Whether or not my virtualenv is activated my pip installs packages into the site-packages of the venv but when outside my venv python reads packages from a totally different folder (details below) which makes it so that I can't install packages for my python outside of venv. My guess is that I need to make sure that pip installs in different places when inside or outside of venv. I can't seem to find a config file for my pip where this is designated and most of the wabpages I've looked at are either not really relevant for my problem or way above my head...
Some details (I'm still new to working with ubuntu, linux, and the datails of python so if I'm missing any important information please say so and I will try to fill in with what's missing): Outside venv:
I found that the python site package can identify where it's looking for packages so this is the output when using it (I also include what gave notified me of the problem):
$ python Python 3.6.9 (default, Nov 7 2019, 10:44:02) [GCC 8.3.0] on linux >>> import site >>> print(site.getsitepackages()) ['/usr/local/lib/python3.6/dist-packages', '/usr/lib/python3/dist-packages', '/usr/lib/python3.6/dist-packages'] >>> import numpy Traceback (most recent call last): File "<stdin>", line 1, in <module> ModuleNotFoundError: No module named 'numpy' >>> exit() $ pip install numpy Requirement already satisfied: numpy in ./projectFolder/venv/lib/python3.6/site-packages (1.17.4)
Looking through the directories I can't find a site-package directory for python but I can find a dist-packages (as above) while in venv there is a site-packages where pip installs the packages.
Activating my venv gives the following results:
(venv)$ which python /home/username/projectFolder/venv/bin/python (venv)$ which pip /home/username/projectFolder/venv/bin/pip
Using site under venv gives:
(venv)$ python Python 3.6.9 (default, Nov 7 2019, 10:44:02) [GCC 8.3.0] on linux >>> import site >>> print(site.getsitepackages()) Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: module 'site' has no attribute 'getsitepackages'