plasma-umass / scalene

Scalene: a high-performance, high-precision CPU, GPU, and memory profiler for Python with AI-powered optimization proposals
Apache License 2.0
12.24k stars 399 forks source link

Scalene support for azure-storage-blob; can't import azure-storage-blob #238

Open JoseSoto9305 opened 3 years ago

JoseSoto9305 commented 3 years ago

Hi everyone, I am trying to use scalene with some programs that use the azure-storage-blob library. However, it throws me the following error from the moment I try to import any of the classes from this library. This is my example

from azure.storage.blob import BlobServiceClient def main(): pass if __name__ == '__main__': main()

It throws me the following error that can't find python3

[Errno 2] No such file or directory: '/home/mefistofeles/Documents/Ternium/SmartSelling/localsinbd/python3' Traceback (most recent call last): File "/home/mefistofeles/Documents/Ternium/SmartSelling/localsinbd/env/lib/python3.8/site-packages/scalene/scalene_profiler.py", line 1196, in profile_code exec(code, the_globals, the_locals) File "main.py", line 1, in <module> from azure.storage.blob import BlobServiceClient File "/home/mefistofeles/Documents/Ternium/SmartSelling/localsinbd/env/lib/python3.8/site-packages/azure/storage/blob/__init__.py", line 10, in <module> from ._blob_client import BlobClient File "/home/mefistofeles/Documents/Ternium/SmartSelling/localsinbd/env/lib/python3.8/site-packages/azure/storage/blob/_blob_client.py", line 26, in <module> from ._shared.base_client import StorageAccountHostsMixin, parse_connection_str, parse_query, TransportWrapper File "/home/mefistofeles/Documents/Ternium/SmartSelling/localsinbd/env/lib/python3.8/site-packages/azure/storage/blob/_shared/base_client.py", line 38, in <module> from .constants import STORAGE_OAUTH_SCOPE, SERVICE_HOST_BASE, CONNECTION_TIMEOUT, READ_TIMEOUT File "/home/mefistofeles/Documents/Ternium/SmartSelling/localsinbd/env/lib/python3.8/site-packages/azure/storage/blob/_shared/constants.py", line 11, in <module> X_MS_VERSION = AzureBlobStorage(url="get_api_version")._config.version # pylint: disable=protected-access File "/home/mefistofeles/Documents/Ternium/SmartSelling/localsinbd/env/lib/python3.8/site-packages/azure/storage/blob/_generated/_azure_blob_storage.py", line 57, in __init__ self._config = AzureBlobStorageConfiguration(url, **kwargs) File "/home/mefistofeles/Documents/Ternium/SmartSelling/localsinbd/env/lib/python3.8/site-packages/azure/storage/blob/_generated/_configuration.py", line 43, in __init__ self._configure(**kwargs) File "/home/mefistofeles/Documents/Ternium/SmartSelling/localsinbd/env/lib/python3.8/site-packages/azure/storage/blob/_generated/_configuration.py", line 50, in _configure self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) File "/home/mefistofeles/Documents/Ternium/SmartSelling/localsinbd/env/lib/python3.8/site-packages/azure/core/pipeline/policies/_universal.py", line 200, in __init__ platform.platform() File "/usr/lib/python3.8/platform.py", line 1205, in platform libcname, libcversion = libc_ver(sys.executable) File "/usr/lib/python3.8/platform.py", line 193, in libc_ver with open(executable, 'rb') as f: FileNotFoundError: [Errno 2] No such file or directory: '/home/mefistofeles/Documents/Ternium/SmartSelling/localsinbd/python3'

I'm running scalene on Linux Mint 20 Ulyana and scalene-1.3.10 with python 3.8

Regards José Soto

emeryberger commented 3 years ago

Could not reproduce on Debian, Python 3.9.2, Scalene 1.3.10.