Do the dist-info folders inside one dir (made with Pyinstaller) have any purpose?
Question:
Answers:
You should not remove any of them.
While your program may run and function fine without a few of them, you are likely violating some of the OSS licenses you have agreed to if you remove any of them. Also all of the files serve some purpose otherwise the package maintainers would not have included them in their package.
Removing them is unlikely to make much of an impact on size, and every file you remove increases your chances of breaking something.
I do when running pushing dependencies into limited resources but it depends on the package. Some packages can’t be imported on linux without the dist-info folders. I learned that the hard way.
One thing you could do is use:
pip install -r requirements.txt -t ./packages --no-compile
This won’t compile source files to bytecode
or
pip install -r requirements.txt -t ./packages --no-deps
This won’t install dependencies but in cases where they are needed, you’ll need to do some more work on your requirements.txt file. You’ll have to check the missing dependencies for the package and add them to the requirements.txt file.
Of course you can use both flags at the same time.
You can also clean up /pycache/ and /tests/ folders if any exist after the install.
I’m curious if you found better ways for this.
You should not remove any of them.
While your program may run and function fine without a few of them, you are likely violating some of the OSS licenses you have agreed to if you remove any of them. Also all of the files serve some purpose otherwise the package maintainers would not have included them in their package.
Removing them is unlikely to make much of an impact on size, and every file you remove increases your chances of breaking something.
I do when running pushing dependencies into limited resources but it depends on the package. Some packages can’t be imported on linux without the dist-info folders. I learned that the hard way.
One thing you could do is use:
pip install -r requirements.txt -t ./packages --no-compile
This won’t compile source files to bytecode
or
pip install -r requirements.txt -t ./packages --no-deps
This won’t install dependencies but in cases where they are needed, you’ll need to do some more work on your requirements.txt file. You’ll have to check the missing dependencies for the package and add them to the requirements.txt file.
Of course you can use both flags at the same time.
You can also clean up /pycache/ and /tests/ folders if any exist after the install.
I’m curious if you found better ways for this.