Title: copying python packages from normal user folder to root folder
Tags: linux;python
Question: I have a python script that runs through service autorun when it starts, it displays an import error. then I decided to run my script with sudo python3 main.py to make sure it would work, but it didn't work again. only works if I just run the script via python3 main.py
then i compared pip3 list and sudo pip3 list they were different. I tried using the python3 -m site command to find out where the packages of both users are located, I tried to copy from the usual one to the root, but it did not work because there is no path for the root user
here are the findings of the python site:
```sys.path = [
'/home/gleb',
'/usr/lib/python310.zip',
'/usr/lib/python3.10',
'/usr/lib/python3.10/lib-dynload',
'/home/gleb/.local/lib/python3.10/site-packages',
'/usr/lib/python3.10/site-packages',
]
USER_BASE: '/home/gleb/.local' (exists)
USER_SITE: '/home/gleb/.local/lib/python3.10/site-packages' (exists)
ENABLE_USER_SITE: True
```
for root
```sys.path = [
    '/root',
    '/usr/lib/python310.zip',
    '/usr/lib/python3.10',
    '/usr/lib/python3.10/lib-dynload',
    '/usr/lib/python3.10/site-packages',
]
USER_BASE: '/root/.local' (exists)
USER_SITE: '/root/.local/lib/python3.10/site-packages' (doesn't exist)
ENABLE_USER_SITE: True
```
How can I transfer these packages without downloading them again




{'source': 'StackExchangeDataset', 'subset': 'unix.stackexchange.com', 'metadata': {'AnswerCount': 0, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2022:00:02/14/22', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<linux><python>', 'Title': 'copying python packages from normal user folder to root folder', 'ViewCount': 100, 'id': 690589, 'user_AboutMe': None, 'user_AccountId': 19579608.0, 'user_DisplayName': 'gleb', 'user_Reputation': 1.0, 'user_Views': 0.0, 'user_id': 514381.0}}