Closed jhorowitz closed 3 years ago
Thanks for reporting this.
Unfortunately, we don't officially support macOS due to limited capacity. You can find this information here. I will update the README on this repo shortly.
With that being said, the reason it stopped working starting from version 3.0.0 is we removed check whether it's Linux before importing the CPU profiler in https://github.com/GoogleCloudPlatform/cloud-profiler-python/pull/76/files.
You have two options if you want to keep using the Cloud Profiler on macOS (there is no guarantee the newer version will keep working):
cpu_profiler = None
and removed from googlecloudprofiler import cpu_profiler
in the source file client.py
.Sorry about the inconvenience!
Thanks for the explanation! Makes perfect sense.
Quick suggestion: It would be nice if the import alone did not crash the app on an unsupported os. I think it would make more sense to raise an error when a method which uses an unavailable lib is called. Just my point of view, not a criticism of your design choices!
@jhorowitz We decided to push out a new release 3.0.3 that fixes the issue; it's an easy fix and probably we shouldn't break on import even if macOS is not officially supported :)
You should be able to update your google-cloud-profiler
to 3.0.3 to solve the issue. Thanks!
I receive the following error when I try to import the profiler. I tested several version of the profiler and the issue appears to start at version 3.0.0 of the profiler. I did not have the issue with 2.0.6
System Information:
Error:
ImportError: cannot import name '_profiler' from partially initialized module 'googlecloudprofiler' (most likely due to a circular import)