Tensorflow import error on Pycharm (Mac)

2024/11/15 23:54:01

enter image description here

Error msg (check the screenshot picture please):

ImportError: cannot import name symbol_databaseError importing tensorflow.  Unless you are using bazel,
you should not try to import tensorflow from its source directory;
please exit the tensorflow source tree, and relaunch your python interpreter
from there.Process finished with exit code 1

Thanks a lot !

enter image description here

Answer

I tried to reproduce the problem you're running into using this sample code:

import tensorflow as tf
hello = tf.constant('Hello, Tensorflow!')

But I was not able to. I can run the script without issues within PyCharm and in my command line (exit code 0).

These are the packages (and their version) that are required for tensorflow 0.8.0 to work:

numpy==1.11.0
protobuf==3.0.0b2
six==1.10.0

I'm using PyCharm Community Edition 2016.1.2 and Python 2.7.10 on Mac OS X 10.11.4


How did you install tensorflow? You should install it via pip (as recommended by the site: https://www.tensorflow.org/versions/r0.8/get_started/os_setup.html#pip-installation)

For Python 2, Mac OS X, this is the installation command: pip install --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.8.0-py2-none-any.whl

https://en.xdnf.cn/q/71734.html

Related Q&A

ssl.SSLCertVerificationError for flask application OAuth login with keycloak

I have referred a sample hello-world flask app integrated with key-cloak login from https://gist.github.com/thomasdarimont/145dc9aa857b831ff2eff221b79d179a My client-secrets.json is as follows: {"…

Need to transfer multiple files from client to server

Im recently working on a project in which Im basically making a dropbox clone. The server and client are working fine but Im having a slight issue. Im able to transfer a single file from the client to …

pyplot bar charts with individual data points

I have data from a control and treatment group. Is matplotlib able to create a bar chart where the bar height is the mean of each group overlaid with the individual data points from that group? Id lik…

python only works with sudo

My python 2.7 script works on my Ubuntu system if I call it using sudo python [filename].pyor from a bash script using sudo ./[bashscriptname].shBut if I call it from Pycharm I get oauth errors, and fr…

Forbidden (CSRF token missing or incorrect) Django error

I am very new to Django. The name of my project is rango and I have created a URL named /rango/tagger that is supposed to send an object. In my java-script, I have tried to communicate with this route …

How to update artists in scrollable, matplotlib and multiplot

Im trying to create a scrollable multiplot based on the answer to this question: Creating a scrollable multiplot with pythons pylabLines created using ax.plot() are updating correctly, however Im unabl…

Sending Keys Using Splinter

I want to test an autocomplete box using Splinter. I need to send the down and enter keys through to the browser but Im having trouble doing this. I am currently finding an input box and typing tes int…

Split lists within dataframe column into multiple columns [duplicate]

This question already has answers here:Split a Pandas column of lists into multiple columns(13 answers)Closed 3 years ago.I have a Pandas DataFrame column with multiple lists within a list. Something l…

Drawing with turtle(python) using PyCharm

Im running the latest PyCharm Pro version and trying to run the below code from a scratch file but it doesnt seem to work import turtlewn = turtle.Screen() alex = turtle.Turtle() alex.forward(150) a…

How to adapt my current splash screen to allow other pieces of my code to run in the background?

Currently I have a splash screen in place. However, it does not work as a real splash screen - as it halts the execution of the rest of the code (instead of allowing them to run in the background).This…