'pip install all packages from local directory

I have a folder containing python packages and they depend. How can I install them all? I am looking for something like dpkg -i *.deb For example: I have packages a,b...z into folder "dir". Package a, have dependies a1,a2 etc. if I run

for it in os.system('ls').split('\n'):
         os.system(f'pip install {it}')

but name package "a" go before them dep a1, and pip try download a1 from internet, but it impossiple. I mean that i need install some packages from directory on machine without internet.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source