GithubHelp home page GithubHelp logo

Comments (8)

danielmbradley avatar danielmbradley commented on May 27, 2024

@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.

wenmin-wu avatar wenmin-wu commented on May 27, 2024

It's because the tensorflow doesn't exist in your sys.path. It's more about your env configuration problem.

from tensorflow_macos.

 avatar commented on May 27, 2024

@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.

and this is my config
image

from tensorflow_macos.

 avatar commented on May 27, 2024

It's because the tensorflow doesn't exist in your sys.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.

godkaieethu avatar godkaieethu commented on May 27, 2024

same issue.do you succeed in importing TensorFlow now?

from tensorflow_macos.

 avatar commented on May 27, 2024

same issue.do you succeed in importing TensorFlow now?

not yet . I will @ u if I fix it

from tensorflow_macos.

TheRealDrCharles avatar TheRealDrCharles commented on May 27, 2024

same issue, quite strange

from tensorflow_macos.

attadje avatar attadje commented on May 27, 2024

Same issue but with jupyter lab

from tensorflow_macos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.