1

I wrote a package that imports pkg_resource package provided by distribute 0.6.35. I import pkg_resource because I need its resource_filename to get the path of a built-in data. However, the pkg_resource is not built-in in python3 and need to install. About this, I have two questions:

  1. Why Python3 doesn't provide pkg_resource in its official distribution? Does that mean pkg_resource is deprecated or Python3 has an alternative package for pkg_resource built-in?

  2. If Python3 doesn't have alternative package for pkg_resource, how can I write my own version of resource_filename with built-in libraries? Is it easy to do?

Thanks!

Hanfei Sun
  • 45,281
  • 39
  • 129
  • 237
  • Correct me if I'm wrong, but `pkg_resource` is not a part of neither Python 2, nor Python 3 official distributions. It's part of `distribute` – dmg Mar 06 '13 at 09:10
  • @DJV I agree with you.. I was just wondering that why neither of them provide `distribute` as built-in package.. It's so useful. – Hanfei Sun Mar 06 '13 at 09:12
  • Don't know actually, I guess for the same reason `setuptools` is not a part of the standard distribution as well. – dmg Mar 06 '13 at 09:18

1 Answers1

1

distribute is merged back to setuptools. setuptools supports Python 3.

jfs
  • 399,953
  • 195
  • 994
  • 1,670