python module not found after executing shell script even though the module is installed
pip3 list
Package             Version
------------------- ------------
apipkg              1.5
apparmor            3.0.3
appdirs             1.4.4
asn1crypto          1.4.0
brotlipy            0.7.0
certifi             2021.5.30
cffi                1.14.6
chardet             4.0.0
cmdln               2.0.0
configobj           5.0.6
createrepo-c        0.17.3
cryptography        3.3.2
cssselect           1.1.0
cupshelpers         1.0
cycler              0.10.0
decorator           5.0.9
idna                3.2
iniconfig           0.0.0
isc                 2.0
joblib              1.0.1
kiwisolver          1.3.1
LibAppArmor         3.0.3
lxml                4.6.3
matplotlib          3.4.3
mysqlclient         2.0.3
nftables            0.1
notify2             0.3.1
numpy               1.21.1
opi                 2.1.1
ordered-set         3.1.1
packaging           20.9
pandas              1.3.1
Pillow              8.3.1
pip                 20.2.4
ply                 3.11
psutil              5.8.0
py                  1.10.0
pyasn1              0.4.8
pycairo             1.20.1
pycparser           2.20
pycups              2.0.1
pycurl              7.43.0.6
PyGObject           3.40.1
pyOpenSSL           20.0.1
pyparsing           2.4.7
pysmbc              1.0.23
PySocks             1.7.1
python-dateutil     2.8.2
python-linux-procfs 0.6
pytz                2021.1
pyudev              0.22.0
requests            2.25.1
rpm                 4.16.1.3
scikit-learn        0.24.2
scipy               1.7.1
setuptools          57.4.0
six                 1.16.0
sklearn             0.0
slip                0.6.5
slip.dbus           0.6.5
termcolor           1.1.0
threadpoolctl       2.2.0
torch               1.9.0+cu111
torchaudio          0.9.0
torchvision         0.10.0+cu111
tqdm                4.62.1
typing-extensions   3.10.0.0
urllib3             1.26.6

Above shows my installed modules, but when i go into the project folder, and run the shell script, I get:
    Traceback (most recent call last):
  File &quot;main.py&quot;, line 3, in &lt;module&gt;
    import torch
ImportError: No module named torch

Even though in the list above it clearly shows that torch is installed.
Please help. My $PATH is /usr/bin/python:/home/anthony/bin:/usr/local/bin:/usr/bin:/bin:/snap/bin
and my printenv PYTHONPATH is :/usr/bin/python
Let me know if you need any other print outs, I've tried everything, and nothing seems to be working. I am working mainly in pycharm.

It is very likely that pip3 is pointing to a different python instance.
Imagine you had python, python3, python3.6 and python3.8 all installed on your system. Which one would pip3 install packages for? (who knows?)
It is almost always safer to do python3.8 -m pip list/install since you can be sure that python3.8 somefile.py will be using the same files you just saw. (even better, do python3.8 -m venv /path/to/some/virtualenv and then make sure that is activated, then you can be sure pip points to the same python)
