Praveen kumar
Praveen kumar

Reputation: 768

Is there any way to find the size different versions by package name, without installing them?

I am trying to find out which versions of tensorflow are larger and which are smaller. I do not wish to install them because this will take a lot of space.

Upvotes: 1

Views: 115

Answers (1)

Equinox
Equinox

Reputation: 6758

You can always visit the project page to view the list of all files for any python package.

or

you can use the JSON response from pypi.org .

import requests
package = 'tensorflow'
version = '2.3.0'
res = requests.get('https://pypi.org/pypi/'+package+'/json')
[[ele['url'].split('/')[-1],'{:.02f}MB'.format(ele['size']/(1024*1024))] for ele in res.json()['releases'][version]]

Output:

[['tensorflow-2.3.0-cp35-cp35m-macosx_10_11_x86_64.whl', '157.43MB'],
 ['tensorflow-2.3.0-cp35-cp35m-manylinux2010_x86_64.whl', '305.52MB'],
 ['tensorflow-2.3.0-cp35-cp35m-win_amd64.whl', '326.62MB'],
 ['tensorflow-2.3.0-cp36-cp36m-macosx_10_11_x86_64.whl', '157.43MB'],
 ['tensorflow-2.3.0-cp36-cp36m-manylinux2010_x86_64.whl', '305.52MB'],
 ['tensorflow-2.3.0-cp36-cp36m-win_amd64.whl', '326.60MB'],
 ['tensorflow-2.3.0-cp37-cp37m-macosx_10_11_x86_64.whl', '157.45MB'],
 ['tensorflow-2.3.0-cp37-cp37m-manylinux2010_x86_64.whl', '305.53MB'],
 ['tensorflow-2.3.0-cp37-cp37m-win_amd64.whl', '326.63MB'],
 ['tensorflow-2.3.0-cp38-cp38-macosx_10_11_x86_64.whl', '157.52MB'],
 ['tensorflow-2.3.0-cp38-cp38-manylinux2010_x86_64.whl', '305.61MB'],
 ['tensorflow-2.3.0-cp38-cp38-win_amd64.whl', '326.65MB']]

Upvotes: 1

Related Questions