New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ImportError after installing 2.1.0 on OSX Catalina 10.15.2 (From binary and source) #36945
Comments
This seems like a linking issue (potentially system specific). Is there any chance you can try the |
Unfortunately unable to reproduce on Catalina 10.15.3.
Is there by any chance a weird ENV variable that messes with the linker? |
Checked my ENV vars and couldn't see anything weird or anything that could effect the linking process. Looking at how you guys build binaries for MacOS, I didn't export Your build: My build: Just installed |
I noticed you are not using a virtualenv and my test was done in a virtualenv. According to this StackOverflow post this error can manifest if tensorflow was not properly installed to system Python. Can you please try either uninstalling TensorFlow or reinstalling TensorFlow? An additional test is trying with a virtualenv. I'm also looking into seeing if those shared objects need to be imported in |
Ok I've had no luck using a virtual environment and have installed / uninstalled multiple times with the same error still occurring. Steps used to install with virtual environment:
Thanks for your help! |
It turns out we do not need those imports anyways so I've removed them. Hopefully a |
Awesome thanks so much, I'll try installing |
@nicholascannon1, |
I'm also facing this issue.
André. |
Still getting pywrap
|
Sorry again for the frustration. Unfortunately since I cannot repro this it's difficult for me to debug. So this new error suggests the issue was not with the I looked around and found this guide which claims that adding the directory where the shared objects live to the following environment variables will help the linker find them. Could you try adding the path where the .so files live to your Thanks again for your patience. Hopefully this will resolve this. |
Ok so I added the folder to
and tried both Checking the folder Here is a list of all the shared object files in the directory
|
Unrelated, I see Unfortunately I'm out of potential solutions. :( I'll keep looking around for Mac shared library issues to see if something can work. I'll keep this bug open in the event someone else ran into this issue and resolved it. Sorry I was unable to help. |
No worries, thanks for your help! |
UPDATE I've also noticed I'm unable to run tensorboard as well, getting segmentation faults when running from command line. Could be unrelated though as it also seg faults with tensorflow version 2.0.1 which is the only tensorflow version that works on my machine. Here is the output error when importing tensorflow (inside virtualenv):
|
This might be a long shot, but is your Xcode up to date? I'm confident the issues is machine specific. I've tried to repro on 3 different MacOS devices from Catalina and Mojave. Between 2.0 and 2.1 we modified the way C++ code was exported to shared objects, and I guess there is an issue with Potential other solutions:
|
SOLVED! So I guess if anyone is having the same issue check if you've been messing with the DYLD linker. Thanks for the help @av8ramit |
Hi Nicholas, I am running OSX 10.11.6 El Capitan and trying to upgrade my tensorflow 2.0.0 to tensorflow 2.3.1. When I try pip3 installing tensorflow in a virtual environment, I can't even import tensorflow. I have to conda install tensorflow. And when I try upgrading to tensorflow 2.3.1 after conda installing I get the error if I try importing: File "/Users/blah/anaconda3/envs/test2/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 64, in During handling of the above exception, another exception occurred: "Traceback (most recent call last): Would you have an idea of what I might be doing wrong?
|
Please make sure that this is a build/installation issue. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:build_template
System information
Describe the problem
After successfully installing Tensorflow via pip or compiling Tensorflow from source, importing the Tensorflow2.1.0 package fails with the error below on OSX Catalina 10.15.2 (CPU = 2.6 GHz 6-Core Intel Core i7). Running
pip install tensorflow==2.0.0
works fine. I've tried installingpywrap
withpip3 install pywrap
but this does not fix the issue.Provide the exact sequence of commands / steps that you executed before running into the problem
PIP instructions:
pip3 install tensorflow
(Tried--user
,--upgrade
and installing withpip
as well)python3
>>> import tensorflow as tf
Compilation instructions:
git clone https://github.com/tensorflow/tensorflow.git & cd tensorflow
git checkout branch_name r2.1.0
./configure
setting python version as/usr/local/bin/python3
and everything else as defaultsbazel build //tensorflow/tools/pip_package:build_pip_package
./bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
pip install /tmp/tensorflow_pkg/tensorflow-2.1.0-cp37-cp37m-macosx_10_15_x86_64.whl
python3
>>> import tensorflow
Any other info / logs
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.
ERROR PRODUCED:
The text was updated successfully, but these errors were encountered: