Comments (8)
@pekoWANG How did you set up the pycharm project? Did you create the python virtual environment first using the script in this repo then mark the created environment as your pycharm project environment when you created it?
from tensorflow_macos.
It's because the tensorflow
doesn't exist in your sys.path
. It's more about your env configuration problem.
from tensorflow_macos.
@pekoWANG How did you set up the pycharm project? Did you create the python virtual environment first using the script in this repo then mark the created environment as your pycharm project environment when you created it?
Yes, I have created a virtual environment and passed the terminal test. When using pycharm, I also imported the virtual environment (pycharm). The terminal shows that I am already in the virtual environment of tensorflow, but I still can't use pcharm. import tensorflow
this is my terminal
Last login: Thu Dec 3 14:50:25 on console
wangpeike@wangpeikedeMac-mini ~ % cd tensorflow_macos_venv
wangpeike@wangpeikedeMac-mini tensorflow_macos_venv % source bin/activate
(tensorflow_macos_venv) wangpeike@wangpeikedeMac-mini tensorflow_macos_venv % python
Python 3.8.2 (default, Oct 2 2020, 10:45:41)
[Clang 12.0.0 (clang-1200.0.32.27)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
>>> os.environ['PATH']
'/Users/wangpeike/tensorflow_macos_venv/bin:/Users/wangpeike/opt/anaconda3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin'
and this is my pycharm:
(tensorflow_macos_venv) wangpeike@wangpeikedeMac-mini pythonProject % python
Python 3.8.2 (default, Oct 2 2020, 10:45:42)
[Clang 12.0.0 (clang-1200.0.32.27)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> os.environ['PATH']
'/Users/wangpeike/tensorflow_macos_venv/bin:/Users/wangpeike/opt/anaconda3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin'
>>> import tensorflow
Traceback (most recent call last):
File "/Users/wangpeike/tensorflow_macos_venv/lib/python3.8/site-packages/tensorflow/python/pywrap_tensorflow.py", line 64, in <module>
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: dlopen(/Users/wangpeike/tensorflow_macos_venv/lib/python3.8/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so, 6): no suitable image found. Did find:
/Users/wangpeike/tensorflow_macos_venv/lib/python3.8/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so: mach-o, but wrong architecture
/Users/wangpeike/tensorflow_macos_venv/lib/python3.8/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so: mach-o, but wrong architecture
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/wangpeike/tensorflow_macos_venv/lib/python3.8/site-packages/tensorflow/__init__.py", line 41, in <module>
from tensorflow.python.tools import module_util as _module_util
File "/Users/wangpeike/tensorflow_macos_venv/lib/python3.8/site-packages/tensorflow/python/__init__.py", line 39, in <module>
from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
File "/Users/wangpeike/tensorflow_macos_venv/lib/python3.8/site-packages/tensorflow/python/pywrap_tensorflow.py", line 83, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/Users/wangpeike/tensorflow_macos_venv/lib/python3.8/site-packages/tensorflow/python/pywrap_tensorflow.py", line 64, in <module>
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: dlopen(/Users/wangpeike/tensorflow_macos_venv/lib/python3.8/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so, 6): no suitable image found. Did find:
/Users/wangpeike/tensorflow_macos_venv/lib/python3.8/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so: mach-o, but wrong architecture
/Users/wangpeike/tensorflow_macos_venv/lib/python3.8/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so: mach-o, but wrong architecture
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
from tensorflow_macos.
It's because the
tensorflow
doesn't exist in yoursys.path
. It's more about your env configuration problem.
My environment in the terminal and pycharm are the same, because I manually added pycharm after outputting the environment variables in the terminal, but that didn't help. Where else should I check my environment?
from tensorflow_macos.
same issue.do you succeed in importing TensorFlow now?
from tensorflow_macos.
same issue.do you succeed in importing TensorFlow now?
not yet . I will @ u if I fix it
from tensorflow_macos.
same issue, quite strange
from tensorflow_macos.
Same issue but with jupyter lab
from tensorflow_macos.
Related Issues (20)
- Using `model.set_weights()` yields incorrect behavior when MLC is enabled HOT 2
- Kernel is dying when I run the tensorflow.keras.models.Sequential.Fit() on Apple M1 HOT 2
- Apple M1 TensorFlow HOT 6
- Can't use SpectralNormalization wrapper layer.
- When can get new version basic on tf release version HOT 1
- Initialization issues and model.predict doesn't work HOT 6
- Error while running keras.sequential HOT 2
- Tensorflow with gpu HOT 2
- issues while doing model.fit HOT 1
- Apple M1: process finished with exit code 132 (interrupted by signal 4: sigill) HOT 8
- Transformer hugginface BERT model not working HOT 3
- installer script fail
- ImportError: dlopen( ... _pywrap_tensorflow_internal.so: mach-o, but wrong architecture HOT 2
- Request for comment: re: future of TF development on macOS. HOT 9
- `model.fit` makes the kernel crash when passing a `class_weight`
- op type not registered `NormalizeUTF8` initializing BERT HOT 1
- TransposeMLCBytes nullptr error during training process HOT 1
- TensorFlow Addons
- Error retrieving python version, or python executable /Library/Frameworks/Python.framework/Versions/3.9/bin/python3 not version 3.8. Please specify a Python 3.8 executable with the --python option.
- Check failed: outputs_[index].tensor == nullptr
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tensorflow_macos.