Skip to content

Conversation

@desaxce
Copy link

@desaxce desaxce commented Nov 2, 2025

Motivation for features / changes

Fixes #7003
When I run tensorboard, I get the deprecation warning, which I don't want:

.venv/lib/python3.12/site-packages/tensorboard/default.py:30: U
serWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pk
g_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refr
ain from using this package or pin to Setuptools<81.
  import pkg_resources

Technical description of changes

I replaced all occurrences of pkg_resources by importlib or packaging.version.

Screenshots of UI changes (or N/A)

==> not applicable

Detailed steps to verify changes work correctly (as executed by you)

On both master and replace_pkg_resources branches, I ran bazel run //tensorboard -- --logdir runs with outputs:

Output on master:

(tf) [precision tensorboard] (master)$ bazel run //tensorboard -- --logdir runs
WARNING: Download from https://mirror.bazel.build/repo1.maven.org/maven2/com/google/guava/guava/32.1.1-jre/guava-32.1.1-jre.jar failed: class java.io.FileNotFoundException GET returned 404 Not Found
WARNING: Download from https://mirror.bazel.build/repo1.maven.org/maven2/com/google/errorprone/error_prone_annotations/2.23.0/error_prone_annotations-2.23.0.jar failed: class java.io.FileNotFoundException GET returned 404 Not Found
WARNING: Download from https://mirror.bazel.build/repo1.maven.org/maven2/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar failed: class java.io.FileNotFoundException GET returned 404 Not Found
INFO: Analyzed target //tensorboard:tensorboard (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //tensorboard:tensorboard up-to-date:
  bazel-bin/tensorboard/tensorboard
INFO: Elapsed time: 0.234s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Running command line: bazel-bin/tensorboard/tensorboard --logdir runs
/home/precision/.cache/bazel/_bazel_precision/cad60362e6aad31575bd1c7909bd969b/execroot/org_tensorflow_tensorboard/bazel-out/k8-fastbuild/bin/tensorboard/tensorboard.runfiles/org_tensorflow_tensorboard/tensorboard/default.py:30: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
  import pkg_resources
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1763289588.190337  871824 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
I0000 00:00:1763289588.190679  871824 cudart_stub.cc:31] Could not find cuda drivers on your machine, GPU will not be used.
I0000 00:00:1763289588.222931  871824 cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
TensorFlow installation not found - running with reduced feature set.
E0000 00:00:1763289588.872919  871824 cuda_executor.cc:1695] INTERNAL: CUDA Runtime error: Failed call to cudaGetRuntimeVersion: Error loading CUDA libraries. GPU will not be used.: Error loading CUDA libraries. GPU will not be used.
W0000 00:00:1763289588.898912  871824 cuda_executor.cc:1802] GPU interconnect information not available: INTERNAL: NVML doesn't support extracting fabric info or NVLink is not used by the device.
W0000 00:00:1763289588.904227  871824 gpu_device.cc:2362] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...

NOTE: Using experimental fast data loading logic. To disable, pass
    "--load_fast=false" and report issues on GitHub. More details:
    https://github.com/tensorflow/tensorboard/issues/4784

Serving TensorBoard on localhost; to expose to the network, use a proxy or pass --bind_all
TensorBoard 2.21.0a0 at http://localhost:6007/ (Press CTRL+C to quit)

Output on replace_pkg_resources (no pkg_resources warning):

(tf) [precision tensorboard] (replace_pkg_resources)$ bazel run //tensorboard -- --logdir runsWARNING: Download from https://mirror.bazel.build/repo1.maven.org/maven2/com/google/guava/guava/32.1.1-jre/guava-32.1.1-jre.jar failed: class java.io.FileNotFoundException GET returned 404 Not Found
WARNING: Download from https://mirror.bazel.build/repo1.maven.org/maven2/com/google/errorprone/error_prone_annotations/2.23.0/error_prone_annotations-2.23.0.jar failed: class java.io.FileNotFoundException GET returned 404 Not Found
WARNING: Download from https://mirror.bazel.build/repo1.maven.org/maven2/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar failed: class java.io.FileNotFoundException GET returned 404 Not Found
INFO: Analyzed target //tensorboard:tensorboard (2 packages loaded, 1744 targets configured).
INFO: Found 1 target...
Target //tensorboard:tensorboard up-to-date:
  bazel-bin/tensorboard/tensorboard
INFO: Elapsed time: 2.550s, Critical Path: 0.13s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Running command line: bazel-bin/tensorboard/tensorboard --logdir runs
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1763289626.381133  872688 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
I0000 00:00:1763289626.381500  872688 cudart_stub.cc:31] Could not find cuda drivers on your machine, GPU will not be used.
I0000 00:00:1763289626.414343  872688 cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
TensorFlow installation not found - running with reduced feature set.
E0000 00:00:1763289627.080864  872688 cuda_executor.cc:1695] INTERNAL: CUDA Runtime error: Failed call to cudaGetRuntimeVersion: Error loading CUDA libraries. GPU will not be used.: Error loading CUDA libraries. GPU will not be used.
W0000 00:00:1763289627.108661  872688 cuda_executor.cc:1802] GPU interconnect information not available: INTERNAL: NVML doesn't support extracting fabric info or NVLink is not used by the device.
W0000 00:00:1763289627.112731  872688 gpu_device.cc:2362] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...

NOTE: Using experimental fast data loading logic. To disable, pass
    "--load_fast=false" and report issues on GitHub. More details:
    https://github.com/tensorflow/tensorboard/issues/4784

Serving TensorBoard on localhost; to expose to the network, use a proxy or pass --bind_all
TensorBoard 2.21.0a0 at http://localhost:6007/ (Press CTRL+C to quit)

Alternate designs / implementations considered (or N/A)

--> not applicable

@google-cla
Copy link

google-cla bot commented Nov 2, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@arcra
Copy link
Member

arcra commented Nov 14, 2025

Thank you @desaxce ! Sorry for the delay. I will look into this next week!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deprecated pkg_resources package

2 participants