TensorFlow import error: TensorFlow import error - python-3.x

I'm trying to getting start with tensorflow with this manual https://www.tensorflow.org/install/install_windows all the installation complete successfully, i m using python 3.5.2 and latest version of pip, encountering this error, anyone explain me what should i do?
enter code here Traceback (most recent call last): File "C:\Users\parth\AppData\Local\Programs\Python\Python35\lib\site-p tensorflow\python\pywrap_tensorflow.py", line 18, in swig_import_helper return importlib.import_module(mname) File "C:\Users\parth\AppData\Local\Programs\Python\Python35\lib\import it__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 986, in _gcd_import File "", line 969, in _find_and_load File "", line 958, in _find_and_load_unlo File "", line 666, in _load_unlocked File "", line 577, in module_from_spec File "", line 906, in create_mod File "", line 222, in _call_with_frames_r ImportError: DLL load failed: %1 is not a valid Win32 application. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\parth\AppData\Local\Programs\Python\Python35\lib\site-p tensorflow\python__init__.py", line 66, in from tensorflow.python import pywrap_tensorflow File "C:\Users\parth\AppData\Local\Programs\Python\Python35\lib\site-p tensorflow\python\pywrap_tensorflow.py", line 21, in _pywrap_tensorflow = swig_import_helper() File "C:\Users\parth\AppData\Local\Programs\Python\Python35\lib\site-p tensorflow\python\pywrap_tensorflow.py", line 20, in swig_import_helper return importlib.import_module('_pywrap_tensorflow') File "C:\Users\parth\AppData\Local\Programs\Python\Python35\lib\import it__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ImportError: No module named '_pywrap_tensorflow' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 1, in File "C:\Users\parth\AppData\Local\Programs\Python\Python35\lib\site-p tensorflow__init__.py", line 24, in from tensorflow.python import * File "C:\Users\parth\AppData\Local\Programs\Python\Python35\lib\site-p tensorflow\python__init__.py", line 72, in raise ImportError(msg) ImportError: Traceback (most recent call last): File "C:\Users\parth\AppData\Local\Programs\Python\Python35\lib\site-p tensorflow\python\pywrap_tensorflow.py", line 18, in swig_import_helper return importlib.import_module(mname) File "C:\Users\parth\AppData\Local\Programs\Python\Python35\lib\import it__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 986, in _gcd_import File "", line 969, in _find_and_load File "", line 958, in _find_and_load_unlo File "", line 666, in _load_unlocked File "", line 577, in module_from_spec File "", line 906, in create_mod File "", line 222, in _call_with_frames_r ImportError: DLL load failed: %1 is not a valid Win32 application. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\parth\AppData\Local\Programs\Python\Python35\lib\site-p tensorflow\python__init__.py", line 66, in from tensorflow.python import pywrap_tensorflow File "C:\Users\parth\AppData\Local\Programs\Python\Python35\lib\site-p tensorflow\python\pywrap_tensorflow.py", line 21, in _pywrap_tensorflow = swig_import_helper() File "C:\Users\parth\AppData\Local\Programs\Python\Python35\lib\site-p tensorflow\python\pywrap_tensorflow.py", line 20, in swig_import_helper return importlib.import_module('_pywrap_tensorflow') File "C:\Users\parth\AppData\Local\Programs\Python\Python35\lib\import it__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ImportError: No module named '_pywrap_tensorflow' Failed to load the native TensorFlow runtime. See https://github.com/tensorflow/tensorflow/blob/master/tensorflow/g3do arted/os_setup.md#import_error for some common reasons and solutions. Include the entire stack trace above this error message when asking for help.

enter link description here
when i update my vc_redist.x64 it will run perfect

Related

pip apt-pkg problems in ubuntu 20.04

I am new at linux(ubuntu 20.04), facing problem to installation of pip apt-pkg as following,
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10
Traceback (most recent call last):
File "/usr/lib/command-not-found", line 28, in
from CommandNotFound import CommandNotFound
File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 19, in
from CommandNotFound.db.db import SqliteDatabase
File "/usr/lib/python3/dist-packages/CommandNotFound/db/db.py", line 5, in
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
pradeep#pradeep-Vostro-15-3568:~$ pip install pip
Traceback (most recent call last):
File "/usr/bin/pip", line 11, in
load_entry_point('pip==20.0.2', 'console_scripts', 'pip')()
File "/usr/lib/python3/dist-packages/pip/_internal/cli/main.py", line 73, in main
command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
File "/usr/lib/python3/dist-packages/pip/_internal/commands/init.py", line 96, in create_command
module = importlib.import_module(module_path)
File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/usr/lib/python3/dist-packages/pip/_internal/commands/install.py", line 24, in
from pip._internal.cli.req_command import RequirementCommand
File "/usr/lib/python3/dist-packages/pip/_internal/cli/req_command.py", line 15, in
from pip._internal.index.package_finder import PackageFinder
File "/usr/lib/python3/dist-packages/pip/_internal/index/package_finder.py", line 21, in
from pip._internal.index.collector import parse_links
File "/usr/lib/python3/dist-packages/pip/_internal/index/collector.py", line 12, in
from pip._vendor import html5lib, requests
ImportError: cannot import name 'html5lib' from 'pip._vendor' (/usr/lib/python3/dist-packages/pip/_vendor/init.py)

Whenever i tried to connect my psql through flask i got an contrib error

flask.cli.NoAppException
NoAppException: While importing "application", an ImportError was raised:
Traceback (most recent call last):
File "/home/shwet/.local/lib/python2.7/site-packages/flask/cli.py", line 240, in locate_app
__import__(module_name)
File "/home/shwet/sr/WebDevlopment/lecture3/project1/application.py", line 17, in <module>
Session(app)
File "/home/shwet/.local/lib/python2.7/site-packages/flask_session/__init__.py", line 54, in __init__
self.init_app(app)
File "/home/shwet/.local/lib/python2.7/site-packages/flask_session/__init__.py", line 61, in init_app
app.session_interface = self._get_interface(app)
File "/home/shwet/.local/lib/python2.7/site-packages/flask_session/__init__.py", line 93, in _get_interface
config['SESSION_USE_SIGNER'], config['SESSION_PERMANENT'])
File "/home/shwet/.local/lib/python2.7/site-packages/flask_session/sessions.py", line 313, in __init__
from werkzeug.contrib.cache import FileSystemCache
ImportError: No module named contrib.cache

When I perform "rasa init" error: "failed to install native tensorflow runtime"

When I perform "rasa init" operation it throws the following error: "failed to install native tensorflow runtime". I tried upgrading it to tensor flow =1.15 but rasa uses only tensorflow>2.1.
Traceback (most recent call last):
File "c:\users\udays.conda\envs\chatbots\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "c:\users\udays.conda\envs\chatbots\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "c:\users\udays.conda\envs\chatbots\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "c:\users\udays.conda\envs\chatbots\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "c:\users\udays.conda\envs\chatbots\lib\imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\udays.conda\envs\chatbots\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "c:\users\udays.conda\envs\chatbots\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\udays.conda\envs\chatbots\Scripts\rasa.exe__main__.py", line 7, in
File "c:\users\udays.conda\envs\chatbots\lib\site-packages\rasa__main__.py", line 82, in main
set_log_level(log_level)
File "c:\users\udays.conda\envs\chatbots\lib\site-packages\rasa\utils\common.py", line 71, in set_log_level
update_tensorflow_log_level()
File "c:\users\udays.conda\envs\chatbots\lib\site-packages\rasa\utils\common.py", line 107, in update_tensorflow_log_level
import tensorflow as tf
File "c:\users\udays.conda\envs\chatbots\lib\site-packages\tensorflow__init__.py", line 101, in
from tensorflow_core import *
File "c:\users\udays.conda\envs\chatbots\lib\site-packages\tensorflow_core__init__.py", line 40, in
from tensorflow.python.tools import module_util as _module_util
File "c:\users\udays.conda\envs\chatbots\lib\site-packages\tensorflow__init__.py", line 50, in getattr
module = self._load()
File "c:\users\udays.conda\envs\chatbots\lib\site-packages\tensorflow__init__.py", line 44, in _load
module = _importlib.import_module(self.name)
File "c:\users\udays.conda\envs\chatbots\lib\importlib__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "c:\users\udays.conda\envs\chatbots\lib\site-packages\tensorflow_core\python__init__.py", line 49, in
from tensorflow.python import pywrap_tensorflow
File "c:\users\udays.conda\envs\chatbots\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 74, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "c:\users\udays.conda\envs\chatbots\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "c:\users\udays.conda\envs\chatbots\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "c:\users\udays.conda\envs\chatbots\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "c:\users\udays.conda\envs\chatbots\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "c:\users\udays.conda\envs\chatbots\lib\imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: DLL load failed: The specified module could not be found.
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.
I also faced the same issue. I fixed it by installing c++ build tool using the below link.
https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=16

I recently installed tensorflow on python 3.7.5 on my system without any problem but I couldn't import it. Below is the error that it gives me

import tensorflow
Traceback (most recent call last):
File "C:\Users\PETER\Anaconda3\envs\flaskenv\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\PETER\Anaconda3\envs\flaskenv\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\PETER\Anaconda3\envs\flaskenv\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "C:\Users\PETER\Anaconda3\envs\flaskenv\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\PETER\Anaconda3\envs\flaskenv\lib\imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\PETER\Anaconda3\envs\flaskenv\lib\site-packages\tensorflow\__init__.py", line 98, in <module>
from tensorflow_core import *
File "C:\Users\PETER\Anaconda3\envs\flaskenv\lib\site-packages\tensorflow_core\__init__.py", line 40, in <module>
from tensorflow.python.tools import module_util as _module_util
File "C:\Users\PETER\Anaconda3\envs\flaskenv\lib\site-packages\tensorflow\__init__.py", line 50, in __getattr__
module = self._load()
File "C:\Users\PETER\Anaconda3\envs\flaskenv\lib\site-packages\tensorflow\__init__.py", line 44, in _load
module = _importlib.import_module(self.__name__)
File "C:\Users\PETER\Anaconda3\envs\flaskenv\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\PETER\Anaconda3\envs\flaskenv\lib\site-packages\tensorflow_core\python\__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\Users\PETER\Anaconda3\envs\flaskenv\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\PETER\Anaconda3\envs\flaskenv\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\PETER\Anaconda3\envs\flaskenv\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\PETER\Anaconda3\envs\flaskenv\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "C:\Users\PETER\Anaconda3\envs\flaskenv\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\PETER\Anaconda3\envs\flaskenv\lib\imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.
Failed to load the native TensorFlow runtime.

TensorFlow importerror on windows cmd

I have installed python 3.5.2, and installed TensorFlow throght the command
pip3 install tensorflow --upgrade
After the installation finished, I try to import the TensorFlow, but failed. The error report is as follow. How to fix this problem?
import tensorflow Traceback (most recent call last): File "C:\Python\Python352\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py",
line 18, in swig_import_helper
return importlib.import_module(mname) File "C:\Python\Python352\lib\importlib__init__.py", line 126, in
import_module
return _bootstrap._gcd_import(name[level:], package, level) File "", line 986, in _gcd_import File
"", line 969, in _find_and_load File
"", line 958, in _find_and_load_unlocked
File "", line 666, in _load_unlocked
File "", line 577, in module_from_spec
File "", line 906, in
create_module File "", line 222, in
_call_with_frames_removed ImportError: DLL load failed: 找不到指定的模块。(Could not find the moudle)
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File
"C:\Python\Python352\lib\site-packages\tensorflow\python\pywrap_tensorflow.py",
line 41, in
from tensorflow.python.pywrap_tensorflow_internal import * File "C:\Python\Python352\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py",
line 21, in
_pywrap_tensorflow_internal = swig_import_helper() File "C:\Python\Python352\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py",
line 20, in swig_import_helper
return importlib.import_module('_pywrap_tensorflow_internal') File "C:\Python\Python352\lib\importlib__init__.py", line 126, in
import_module
return _bootstrap._gcd_import(name[level:], package, level) ImportError: No module named '_pywrap_tensorflow_internal'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "", line 1, in
File
"C:\Python\Python352\lib\site-packages\tensorflow__init__.py", line
24, in
from tensorflow.python import * File "C:\Python\Python352\lib\site-packages\tensorflow\python__init__.py",
line 51, in
from tensorflow.python import pywrap_tensorflow File "C:\Python\Python352\lib\site-packages\tensorflow\python\pywrap_tensorflow.py",
line 52, in
raise ImportError(msg) ImportError: Traceback (most recent call last): File
"C:\Python\Python352\lib\site-packages\tensorflow\python\pywrap_tensorflo
w_internal.py", line 18, in swig_import_helper
return importlib.import_module(mname) File "C:\Python\Python352\lib\importlib__init__.py", line 126, in
import_module
return _bootstrap._gcd_import(name[level:], package, level) File "", line 986, in _gcd_import File
"", line 969, in _find_and_load File
"", line 958, in _find_and_load_unlocked
File "", line 666, in _load_unlocked
File "", line 577, in module_from_spec
File "", line 906, in
create_module File "", line 222, in
_call_with_frames_removed ImportError: DLL load failed: 找不到指定的模块。(could not find the moudle)
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File
"C:\Python\Python352\lib\site-packages\tensorflow\python\pywrap_tensorflo
w.py", line 41, in
from tensorflow.python.pywrap_tensorflow_internal import * File "C:\Python\Python352\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py",
line 21, in
_pywrap_tensorflow_internal = swig_import_helper() File "C:\Python\Python352\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py",
line 20, in swig_import_helper
return importlib.import_module('_pywrap_tensorflow_internal') File "C:\Python\Python352\lib\importlib__init__.py", line 126, in
import_module
return _bootstrap._gcd_import(name[level:], package, level) ImportError: No module named '_pywrap_tensorflow_internal'
Failed to load the native TensorFlow runtime.

Resources