Library not loaded: @rpath/libgpr.20.dylib Rosetta2 conda env
Hi, @pabloazurduy 

Apologize for the delay and if you don't mind could you please help me with the exact steps which you're following for installing the Tensorflow on `rosetta x86_64` ? If possible please help me with below commands output it seems like some issue with setting up environment variable at the moment, meanwhile could you please try with `python 3.8` or `python 3.9` instead of `python 3.7` with stable version of `Tensorflow(2.11) `and check whether is it resolving your issue or not ? Thank you!

1. conda --version
2. printenv This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. This issue was closed because it has been inactive for 7 days since being marked as stale. Please reopen if you'd like to work on this further. Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/59778">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/59778">No</a>

<details><summary>Click to expand!</summary> 
 
 ### Issue Type

Bug

### Have you reproduced the bug with TF nightly?

Yes

### Source

source

### Tensorflow Version

2.7.4

### Custom Code

Yes

### OS Platform and Distribution

macos Ventura 13.2.1 (22D68)

### Mobile device

_No response_

### Python version

3.7

### Bazel version

_No response_

### GCC/Compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current Behaviour?

```shell
A bug happened!

running TF in a rosetta x86_64 conda env with python 3.7 (this is a requirement from a package) I was able to install it using [this answer][https://stackoverflow.com/a/74439006/5318634] but when trying to import it I receive this error.

"""python
Traceback (most recent call last):
  File "/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 64, in <module>
    from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: dlopen(/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so, 0x0006): Library not loaded: @rpath/libgpr.20.dylib
  Referenced from: <4CC88E4E-9383-347A-B5FD-2C28611F371E> /Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
  Reason: tried: '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/../../_solib_darwin_x86_64/_U_S_Stensorflow_Clibtensorflow_Uframework_Uimport_Ulib___Utensorflow/libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/../libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/../../../../libgpr.20.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/../../_solib_darwin_x86_64/_U_S_Stensorflow_Clibtensorflow_Uframework_Uimport_Ulib___Utensorflow/libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/../libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/../../../../libgpr.20.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/Users/azurduy/miniconda/envs/iappkg_x86/bin/../lib/libgpr.20.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/Users/azurduy/miniconda/envs/iappkg_x86/bin/../lib/libgpr.20.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS@rpath/libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/../../_solib_darwin_x86_64/_U_S_Stensorflow_Clibtensorflow_Uframework_Uimport_Ulib___Utensorflow/libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/../libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/../../../../libgpr.20.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/../../_solib_darwin_x86_64/_U_S_Stensorflow_Clibtensorflow_Uframework_Uimport_Ulib___Utensorflow/libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/../libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/../../../../libgpr.20.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/Users/azurduy/miniconda/envs/iappkg_x86/bin/../lib/libgpr.20.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/Users/azurduy/miniconda/envs/iappkg_x86/bin/../lib/libgpr.20.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/local/lib/libgpr.20.dylib' (no such file), '/usr/lib/libgpr.20.dylib' (no such file, not in dyld cache)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/__init__.py", line 41, in <module>
    from tensorflow.python.tools import module_util as _module_util
  File "/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/__init__.py", line 40, in <module>
    from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
  File "/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 80, in <module>
    f'{traceback.format_exc()}'
ImportError: Traceback (most recent call last):
  File "/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 64, in <module>
    from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: dlopen(/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so, 0x0006): Library not loaded: @rpath/libgpr.20.dylib
  Referenced from: <4CC88E4E-9383-347A-B5FD-2C28611F371E> /Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
  Reason: tried: '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/../../_solib_darwin_x86_64/_U_S_Stensorflow_Clibtensorflow_Uframework_Uimport_Ulib___Utensorflow/libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/../libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/../../../../libgpr.20.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/../../_solib_darwin_x86_64/_U_S_Stensorflow_Clibtensorflow_Uframework_Uimport_Ulib___Utensorflow/libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/../libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/../../../../libgpr.20.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/Users/azurduy/miniconda/envs/iappkg_x86/bin/../lib/libgpr.20.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/Users/azurduy/miniconda/envs/iappkg_x86/bin/../lib/libgpr.20.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS@rpath/libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/../../_solib_darwin_x86_64/_U_S_Stensorflow_Clibtensorflow_Uframework_Uimport_Ulib___Utensorflow/libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/../libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/../../../../libgpr.20.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/../../_solib_darwin_x86_64/_U_S_Stensorflow_Clibtensorflow_Uframework_Uimport_Ulib___Utensorflow/libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/../libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/../../../../libgpr.20.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/Users/azurduy/miniconda/envs/iappkg_x86/bin/../lib/libgpr.20.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/Users/azurduy/miniconda/envs/iappkg_x86/bin/../lib/libgpr.20.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/local/lib/libgpr.20.dylib' (no such file), '/usr/lib/libgpr.20.dylib' (no such file, not in dyld cache)


Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors for some common causes and solutions.
If you need help, create an issue at https://github.com/tensorflow/tensorflow/issues and include the entire stack trace above this error message.
"""
```


### Standalone code to reproduce the issue

```shell
import tensorflow
```


### Relevant log output

```shell
ImportError                               Traceback (most recent call last)
<ipython-input-1-d6579f534729> in <module>
----> 1 import tensorflow

~/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/__init__.py in <module>
     39 import sys as _sys
     40
---> 41 from tensorflow.python.tools import module_util as _module_util
     42 from tensorflow.python.util.lazy_loader import LazyLoader as _LazyLoader
     43

~/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/__init__.py in <module>
     38 # pylint: disable=wildcard-import,g-bad-import-order,g-import-not-at-top
     39
---> 40 from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
     41 from tensorflow.python.eager import context
     42

~/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow.py in <module>
     78 except ImportError:
     79   raise ImportError(
---> 80       f'{traceback.format_exc()}'
     81       f'\n\nFailed to load the native TensorFlow runtime.\n'
     82       f'See https://www.tensorflow.org/install/errors '

ImportError: Traceback (most recent call last):
  File "/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 64, in <module>
    from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: dlopen(/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so, 0x0006): Library not loaded: @rpath/libgpr.20.dylib
  Referenced from: <4CC88E4E-9383-347A-B5FD-2C28611F371E> /Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
  Reason: tried: '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/../../_solib_darwin_x86_64/_U_S_Stensorflow_Clibtensorflow_Uframework_Uimport_Ulib___Utensorflow/libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/../libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/../../../../libgpr.20.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/../../_solib_darwin_x86_64/_U_S_Stensorflow_Clibtensorflow_Uframework_Uimport_Ulib___Utensorflow/libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/../libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/../../../../libgpr.20.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/Users/azurduy/miniconda/envs/iappkg_x86/bin/../lib/libgpr.20.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/Users/azurduy/miniconda/envs/iappkg_x86/bin/../lib/libgpr.20.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS@rpath/libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/../../_solib_darwin_x86_64/_U_S_Stensorflow_Clibtensorflow_Uframework_Uimport_Ulib___Utensorflow/libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/../libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/../../../../libgpr.20.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/../../_solib_darwin_x86_64/_U_S_Stensorflow_Clibtensorflow_Uframework_Uimport_Ulib___Utensorflow/libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/../libgpr.20.dylib' (no such file), '/Users/azurduy/miniconda/envs/iappkg_x86/lib/python3.7/site-packages/tensorflow/python/../../../../libgpr.20.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/Users/azurduy/miniconda/envs/iappkg_x86/bin/../lib/libgpr.20.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/Users/azurduy/miniconda/envs/iappkg_x86/bin/../lib/libgpr.20.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/local/lib/libgpr.20.dylib' (no such file), '/usr/lib/libgpr.20.dylib' (no such file, not in dyld cache)


Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors for some common causes and solutions.
If you need help, create an issue at https://github.com/tensorflow/tensorflow/issues and include the entire stack trace above this error message.
```
</details>