cannot import name '_pywrap_dtensor_device' from 'tensorflow.python' - python

I uninstalled and installed Tensorflow. I updated. I got the same error. I ran the program a lot and it didn't give an error until yesterday I installed pip install tf-nightly-gpu. Is that why?
File "C:\Users\faikm\OneDrive\Masaüstü\DeeepLearning\model_egit.py", line 14, in <module>
from tensorflow.keras import layers
File "C:\Program Files\Python310\lib\site-packages\keras\api\_v2\keras\__init__.py", line 12, in <module>
from keras import __version__
File "C:\Program Files\Python310\lib\site-packages\keras\__init__.py", line 24, in <module>
from keras import models
File "C:\Program Files\Python310\lib\site-packages\keras\models\__init__.py", line 18, in <module>
from keras.engine.functional import Functional
File "C:\Program Files\Python310\lib\site-packages\keras\engine\functional.py", line 24, in <module>
from keras.dtensor import layout_map as layout_map_lib
File "C:\Program Files\Python310\lib\site-packages\keras\dtensor\__init__.py", line 22, in <module>
from tensorflow.compat.v2.experimental import dtensor as dtensor_api # pylint: disable=g-import-not-at-top
File "C:\Program Files\Python310\lib\site-packages\tensorflow\_api\v2\compat\v2\experimental\dtensor\__init__.py", line 8, in <module>
from tensorflow.dtensor.python.api import call_with_layout
File "C:\Program Files\Python310\lib\site-packages\tensorflow\dtensor\python\__init__.py", line 18, in <module>
from tensorflow.dtensor.python import mesh_util
File "C:\Program Files\Python310\lib\site-packages\tensorflow\dtensor\python\mesh_util.py", line 21, in <module>
from tensorflow.dtensor.python import api
File "C:\Program Files\Python310\lib\site-packages\tensorflow\dtensor\python\api.py", line 22, in <module>
from tensorflow.dtensor.python import dtensor_device
File "C:\Program Files\Python310\lib\site-packages\tensorflow\dtensor\python\dtensor_device.py", line 28, in <module>
from tensorflow.python import _pywrap_dtensor_device
ImportError: cannot import name '_pywrap_dtensor_device' from 'tensorflow.python' (C:\Program Files\Python310\lib\site-packages\tensorflow\python\__init__.py)

Related

Error while install PySimpleGUI import ModuleNotFoundError: No module named 'Python'

There's an error when i tried to install PySimpleGUI package on PyCharm. i already tried install package from setting, and terminal with command "pip instal PySimpleGUI". Both of them have the same error message.
`Traceback (most recent call last):
File "C:\Users\irsya\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\irsya\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\irsya\PycharmProjects\pythonProject\venv\Scripts\pip.exe\__main__.py", line 4, in <module>
File "C:\Users\irsya\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_internal\cli\main.py", line 9, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "C:\Users\irsya\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_internal\cli\autocompletion.py", line 10, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "C:\Users\irsya\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_internal\cli\main_parser.py", line 8, in <module>
from pip._internal.cli import cmdoptions
File "C:\Users\irsya\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_internal\cli\cmdoptions.py", line 23, in <module>
from pip._internal.cli.parser import ConfigOptionParser
File "C:\Users\irsya\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_internal\cli\parser.py", line 12, in <module>
from pip._internal.configuration import Configuration, ConfigurationError
File "C:\Users\irsya\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_internal\configuration.py", line 20, in <module>
from pip._internal.exceptions import (
File "C:\Users\irsya\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_internal\exceptions.py", line 7, in <module>
from pip._vendor.pkg_resources import Distribution
File "C:\Users\irsya\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 22, in <module>
import Python.Bonus.parsers14
ModuleNotFoundError: No module named 'Python'
`
Errro message

Tenserflow error while running on conda enviromen to run th DTW

2022-03-22 17:55:13.940009: I tensorflow/stream_executor/platform/default/dso_loader.cc:44\] Successfully opened dynamic library cudart64_101.dll
Traceback (most recent call last):
File "train.py", line 27, in \<module\>
import tensorflow as tf
File "C:\\Users\\sahro\\anaconda3\\envs\\learningFromAlignement\\lib\\site-packages\\tensorflow\__init_\_.py", line 101, in \<module\>
from tensorflow_core import \*
File "C:\\Users\\sahro\\anaconda3\\envs\\learningFromAlignement\\lib\\site-packages\\tensorflow_core\__init_\_.py", line 46, in \<module\>
from . _api.v2 import compat_
File "C:\\Users\\sahro\\anaconda3\\envs\\learningFromAlignement\\lib\\site-packages\\tensorflow_core_api\\v2\\compat\__init_.py", line 39, in \<module\>
from . import v1
File "C:\\Users\\sahro\\anaconda3\\envs\\learningFromAlignement\\lib\\site-packages\\tensorflow_core_api\\v2\\compat\\v1\__init_\_.py", line 32, in \<module\>
from . import compat
File "C:\\Users\\sahro\\anaconda3\\envs\\learningFromAlignement\\lib\\site-packages\\tensorflow_core_api\\v2\\compat\\v1\\compat\__init_\_.py", line 38, in \<module\>
from . import v1
File "C:\\Users\\sahro\\anaconda3\\envs\\learningFromAlignement\\lib\\site-packages\\tensorflow_core_api\\v2\\compat\\v1\\compat\\v1\__init_\_.py", line 29, in \<module\>
from tensorflow._api.v2.compat.v1 import app_
File "C:\\Users\\sahro\\anaconda3\\envs\\learningFromAlignement\\lib\\site-packages\\tensorflow_core_api\\v2\\compat\__init_.py", line 39, in \<module\>
from . import v1
File "C:\\Users\\sahro\\anaconda3\\envs\\learningFromAlignement\\lib\\site-packages\\tensorflow_core_api\\v2\\compat\\v1\__init_\_.py", line 32, in \<module\>
from . import compat
File "C:\\Users\\sahro\\anaconda3\\envs\\learningFromAlignement\\lib\\site-packages\\tensorflow_core_api\\v2\\compat\\v1\\compat\__init_\_.py", line 38, in \<module\>
from . import v1
File "C:\\Users\\sahro\\anaconda3\\envs\\learningFromAlignement\\lib\\site-packages\\tensorflow_core_api\\v2\\compat\\v1\\compat\\v1\__init_\_.py", line 675, in \<module\>
from tensorflow.python.keras.api._v1 import keras_
File "C:\\Users\\sahro\\anaconda3\\envs\\learningFromAlignement\\lib\\site-packages\\tensorflow_core\\python\\keras\\api\__init_.py", line 10, in \<module\>
from . import keras
File "C:\\Users\\sahro\\anaconda3\\envs\\learningFromAlignement\\lib\\site-packages\\tensorflow_core\\python\\keras\\api\\keras\__init_\_.py", line 15, in \<module\>
from . import applications
File "C:\\Users\\sahro\\anaconda3\\envs\\learningFromAlignement\\lib\\site-packages\\tensorflow_core\\python\\keras\\api\\keras\\applications\__init_\_.py", line 10, in \<module\>
from . import densenet
File "C:\\Users\\sahro\\anaconda3\\envs\\learningFromAlignement\\lib\\site-packages\\tensorflow_core\\python\\keras\\api\\keras\\applications\\densenet\__init_\_.py", line 11, in \<module\>
from tensorflow.python.keras.applications.densenet import DenseNet121
File "C:\\Users\\sahro\\anaconda3\\envs\\learningFromAlignement\\lib\\site-packages\\tensorflow_core\\python\\keras\\applications\__init_\_.py", line 22, in \<module\>
import keras_applications
File "C:\\Users\\sahro\\anaconda3\\envs\\learningFromAlignement\\lib\\site-packages\\keras_applications\__init_\_.py", line 63, in \<module\>
from . import resnet
File "C:\\Users\\sahro\\anaconda3\\envs\\learningFromAlignement\\lib\\site-packages\\keras_applications\\resnet.py", line 22, in \<module\>
from .resnet_common import ResNet50
File "C:\\Users\\sahro\\anaconda3\\envs\\learningFromAlignement\\lib\\site-packages\\keras_applications\\resnet_common.py", line 27
from tensorflow.python.util.tf_export import
^
SyntaxError: invalid syntax
I unistall and again install the tensorflow all the version and i have AMD Radeon Grahpics.
I use the conda environment to the run the code

I am creating an AI Chatbot which repeatedly displays the error: Expected Bytes, descriptor found

The following code is the first few steps of building a chatbot using deep learning, I have tensorflow, cUDDN, CUDA installed but it still displays the same error. I have followed the video tutorials on youtube and downloaded all packages needed over two times just to be sure but it still doesnt get out of this specific error...
import nltk
from nltk.stem.lancaster import LancasterStemmer
stemmer = LancasterStemmer()
import numpy
import tflearn
import tensorflow
import random
import json
with open("intents.json") as file:
data = json.load(file)
print(data)
The error it displays is
expected bytes, Descriptor found
Stack trace:
> File "C:\Users\Himashi\source\repos\ChatBot\ChatBot\chatbot.py", line 6, in <module>
> import tflearn
Loaded 'tensorflow.core.framework.resource_handle_pb2'
Loaded 'tensorflow.core.framework.tensor_pb2'
Loaded 'tensorflow.core.framework.attr_value_pb2'
Loaded 'tensorflow.core.framework.node_def_pb2'
Loaded 'tensorflow.core.framework.graph_pb2'
Loaded 'tensorflow.python'
Loaded 'tensorflow'
Loaded 'tflearn.config'
Loaded 'tflearn'
Loaded '__main__'
Loaded 'runpy'
Traceback (most recent call last):
File "c:\program files (x86)\microsoft visual studio\2019\community\common7\ide\extensions\microsoft\python\core\ptvsd_launcher.py", line 119, in <module>
vspd.debug(filename, port_num, debug_id, debug_options, run_as)
File "c:\program files (x86)\microsoft visual studio\2019\community\common7\ide\extensions\microsoft\python\core\Packages\ptvsd\debugger.py", line 39, in debug
run()
File "c:\program files (x86)\microsoft visual studio\2019\community\common7\ide\extensions\microsoft\python\core\Packages\ptvsd\__main__.py", line 316, in run_file
runpy.run_path(target, run_name='__main__')
File "C:\Users\Himashi\Anaconda3\lib\runpy.py", line 263, in run_path
pkg_name=pkg_name, script_name=fname)
File "C:\Users\Himashi\Anaconda3\lib\runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "C:\Users\Himashi\Anaconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\Himashi\source\repos\ChatBot\ChatBot\chatbot.py", line 6, in <module>
import tflearn
File "C:\Users\Himashi\Anaconda3\lib\site-packages\tflearn\__init__.py", line 4, in <module>
from . import config
File "C:\Users\Himashi\Anaconda3\lib\site-packages\tflearn\config.py", line 3, in <module>
import tensorflow as tf
File "C:\Users\Himashi\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 28, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "C:\Users\Himashi\Anaconda3\lib\site-packages\tensorflow\python\__init__.py", line 52, in <module>
from tensorflow.core.framework.graph_pb2 import *
File "C:\Users\Himashi\Anaconda3\lib\site-packages\tensorflow\core\framework\graph_pb2.py", line 16, in <module>
from tensorflow.core.framework import node_def_pb2 as tensorflow_dot_core_dot_framework_dot_node__def__pb2
File "C:\Users\Himashi\Anaconda3\lib\site-packages\tensorflow\core\framework\node_def_pb2.py", line 16, in <module>
from tensorflow.core.framework import attr_value_pb2 as tensorflow_dot_core_dot_framework_dot_attr__value__pb2
File "C:\Users\Himashi\Anaconda3\lib\site-packages\tensorflow\core\framework\attr_value_pb2.py", line 16, in <module>
from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2
File "C:\Users\Himashi\Anaconda3\lib\site-packages\tensorflow\core\framework\tensor_pb2.py", line 16, in <module>
from tensorflow.core.framework import resource_handle_pb2 as tensorflow_dot_core_dot_framework_dot_resource__handle__pb2
File "C:\Users\Himashi\Anaconda3\lib\site-packages\tensorflow\core\framework\resource_handle_pb2.py", line 92, in <module>
__module__ = 'tensorflow.core.framework.resource_handle_pb2'
TypeError: expected bytes, Descriptor found
This error seems to be TensorFlow installation issue.
Also, your code only reads a JSON file. If that's only what you want, you could remove import of tflearn & tensorflow packages.
If you want to use these packages later, then I would suggest checking your TensorFlow installation (follow this link for solution) or update TensorFlow.

numpy suddenly started failing to import

I have anaconda installed. Running python 2.7. I have uninstalled, reinstalled, and upgraded numpy to 1.11.0, uninstalled and reinstalled pandas, and I still get this traceback when I try to import numpy:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/nicole/anaconda/lib/python2.7/site-packages/numpy-1.11.0-py2.7-macosx-10.5-x86_64.egg/numpy/__init__.py", line 180, in <module>
from . import add_newdocs
File "/Users/nicole/anaconda/lib/python2.7/site-packages/numpy-1.11.0-py2.7-macosx-10.5-x86_64.egg/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/Users/nicole/anaconda/lib/python2.7/site-packages/numpy-1.11.0-py2.7-macosx-10.5-x86_64.egg/numpy/lib/__init__.py", line 8, in <module>
from .type_check import *
File "/Users/nicole/anaconda/lib/python2.7/site-packages/numpy-1.11.0-py2.7-macosx-10.5-x86_64.egg/numpy/lib/type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "/Users/nicole/anaconda/lib/python2.7/site-packages/numpy-1.11.0-py2.7-macosx-10.5-x86_64.egg/numpy/core/__init__.py", line 58, in <module>
from numpy.testing.nosetester import _numpy_tester
File "/Users/nicole/anaconda/lib/python2.7/site-packages/numpy-1.11.0-py2.7-macosx-10.5-x86_64.egg/numpy/testing/__init__.py", line 12, in <module>
from . import decorators as dec
File "/Users/nicole/anaconda/lib/python2.7/site-packages/numpy-1.11.0-py2.7-macosx-10.5-x86_64.egg/numpy/testing/decorators.py", line 21, in <module>
from .utils import SkipTest
File "/Users/nicole/anaconda/lib/python2.7/site-packages/numpy-1.11.0-py2.7-macosx-10.5-x86_64.egg/numpy/testing/utils.py", line 15, in <module>
from tempfile import mkdtemp, mkstemp
File "/Users/nicole/anaconda/lib/python2.7/tempfile.py", line 35, in <module>
from random import Random as _Random
File "random/__init__.py", line 99, in <module>
from .mtrand import *
File "numpy.pxd", line 92, in init mtrand (numpy/random/mtrand/mtrand.c:37726)
It was working fine last night, which is really frustrating. Thank you for any insight.

scrapy startproject error

I am running into the following error while using the command scrapy startproject to create a project. I am running Python 2.7.6 through canopy on Ubuntu 14.04 (64 bit). I have installed all the required dependencies still I cannot find a solution to this. Can anyone help me with this?
Python27\Scripts>scrapy startproject ps_localize
Traceback (most recent call last):
File "/home/Enthought/Canopy_64bit/User/bin/scrapy", line 7, in <module>
from scrapy.cmdline import execute
File "/home/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/scrapy/cmdline.py", line 9, in <module>
from scrapy.crawler import CrawlerProcess
File "/home/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/scrapy/crawler.py", line 3, in <module>
from twisted.internet import reactor, defer
File "/home/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/twisted/internet/reactor.py", line 38, in <module>
from twisted.internet import default
File "/home/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/twisted/internet/default.py", line 56, in <module>
install = _getInstallFunction(platform)
File "/home/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/twisted/internet/default.py", line 44, in _getInstallFunction
from twisted.internet.epollreactor import install
File "/home/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/twisted/internet/epollreactor.py", line 24, in <module>
from twisted.internet import posixbase
File "/home/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/twisted/internet/posixbase.py", line 23, in <module>
from twisted.internet import error, udp, tcp
File "/home/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/twisted/internet/tcp.py", line 29, in <module>
from twisted.internet._newtls import (
File "/home/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/twisted/internet/_newtls.py", line 21, in <module>
from twisted.protocols.tls import TLSMemoryBIOFactory, TLSMemoryBIOProtocol
File "/home/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/twisted/protocols/tls.py", line 41, in <module>
from OpenSSL.SSL import Error, ZeroReturnError, WantReadError
File "/home/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import rand, crypto, SSL
File "/home/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/OpenSSL/rand.py", line 11, in <module>
from OpenSSL._util import (
File "/home/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/OpenSSL/_util.py", line 7, in <module>
binding = Binding()
File "/home/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 114, in __init__
self._ensure_ffi_initialized()
File "/home/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 126, in _ensure_ffi_initialized
cls._modules,
File "/home/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/cryptography/hazmat/bindings/utils.py", line 31, in load_library_for_binding
lib = ffi.verifier.load_library()
File "/home/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/cffi/verifier.py", line 97, in load_library
return self._load_library()
File "/home/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/cffi/verifier.py", line 207, in _load_library
return self._vengine.load_library()
File "/home/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/cffi/vengine_cpy.py", line 155, in load_library
raise ffiplatform.VerificationError(error)
cffi.ffiplatform.VerificationError: importing '/home/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/cryptography/_Cryptography_cffi_a269d620xd5c405b7.so': /home/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/cryptography/_Cryptography_cffi_a269d620xd5c405b7.so: undefined symbol: EC_KEY_clear_flags

Categories