what's wrong with my tensorflow after i install pandas? - python

i'm new to python so the question might seem to be stupid.Before i install pandas ,everything is ok. after i install it ,i try
>>>import tensorflow
usage: [-h] [--sum] N [N ...]
: error: the following arguments are required: N
in IDLE:
>>> import tensorflow
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import tensorflow
File "C:\Users\35963\AppData\Local\Programs\Python\Python35\lib\site-
packages\tensorflow\__init__.py", line 24, in <module>
from tensorflow.python import *
File "C:\Users\35963\AppData\Local\Programs\Python\Python35\lib\site-
packages\tensorflow\python\__init__.py", line 77, in <module>
from tensorflow.python.estimator import estimator_lib as estimator
File "C:\Users\35963\AppData\Local\Programs\Python\Python35\lib\site-
packages\tensorflow\python\estimator\estimator_lib.py", line 24, in <module>
from tensorflow.python.estimator.inputs import inputs
File "C:\Users\35963\AppData\Local\Programs\Python\Python35\lib\site-
packages\tensorflow\python\estimator\inputs\inputs.py", line 22, in <module>
from tensorflow.python.estimator.inputs.numpy_io import numpy_input_fn
File "C:\Users\35963\AppData\Local\Programs\Python\Python35\lib\site-
packages\tensorflow\python\estimator\inputs\numpy_io.py", line 22, in
<module>
from tensorflow.python.estimator.inputs.queues import feeding_functions
File "C:\Users\35963\AppData\Local\Programs\Python\Python35\lib\site-
packages\tensorflow\python\estimator\inputs\queues\feeding_functions.py",
line 40, in <module>
import pandas as pd
File "C:\Users\35963\AppData\Local\Programs\Python\Python35\lib\site-
packages\pandas\__init__.py", line 51, in <module>
plot_params = pandas.plotting._style._Options(deprecated=True)
AttributeError: module 'pandas' has no attribute 'plotting'
so is it means my tensorflow and pandas are incompatible?:(
i install them using pip . their version: python3.5.2,tensorflow (1.2.1),pandas (0.20.3)

Related

ImportError: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.30' not found

I'm trying to install bern2 locally. bern2 installed successfully. when I started running, I got this error.
ImportError: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /opt/conda/envs/bern2/lib/python3.11/site-packages/faiss/../../../libfaiss.so)
from normalizers.neural_normalizer import NeuralNormalizer
File "/home/ubuntu/BERN2/BERN2/normalizers/neural_normalizer.py", line 17, in <module>
import faiss
File "/opt/conda/envs/bern2/lib/python3.11/site-packages/faiss/__init__.py", line 18, in <module>
from .loader import *
File "/opt/conda/envs/bern2/lib/python3.11/site-packages/faiss/loader.py", line 65, in <module>
from .swigfaiss import *
File "/opt/conda/envs/bern2/lib/python3.11/site-packages/faiss/swigfaiss.py", line 10, in <module>
from . import _swigfaiss
ImportError: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /opt/conda/envs/bern2/lib/python3.11/site-packages/faiss/../../../libfaiss.so)
Traceback (most recent call last):
File "/home/ubuntu/BERN2/BERN2/server.py", line 1, in <module>
from app import create_app
File "/home/ubuntu/BERN2/BERN2/app/__init__.py", line 12, in <module>
import bern2
File "/home/ubuntu/BERN2/BERN2/bern2/__init__.py", line 1, in <module>
from bern2.bern2 import BERN2
File "/home/ubuntu/BERN2/BERN2/bern2/bern2.py", line 22, in <module>
from normalizer import Normalizer
File "/home/ubuntu/BERN2/BERN2/bern2/normalizer.py", line 11, in <module>
from normalizers.neural_normalizer import NeuralNormalizer
File "/home/ubuntu/BERN2/BERN2/normalizers/neural_normalizer.py", line 17, in <module>
import faiss
File "/opt/conda/envs/bern2/lib/python3.11/site-packages/faiss/__init__.py", line 18, in <module>
from .loader import *
File "/opt/conda/envs/bern2/lib/python3.11/site-packages/faiss/loader.py", line 65, in <module>
from .swigfaiss import *
File "/opt/conda/envs/bern2/lib/python3.11/site-packages/faiss/swigfaiss.py", line 10, in <module>
from . import _swigfaiss
ImportError: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /opt/conda/envs/bern2/lib/python3.11/site-packages/faiss/../../../libfaiss.so)
The reason could be that the system path is not configured correctly. Try this,
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/
Source:
https://www.tensorflow.org/install/pip

Tflite model m aker issue - undefined symbol table __scann_ops.os

Anyone know how to solve this python tensorflow issue?
Traceback (most recent call last):
File "lite_model_gen.py", line 6, in <module>
from tflite_model_maker.config import ExportFormat
File "/home/ubuntu/examples/tensorflow_examples/lite/model_maker/pip_package/src/tflite_model_maker/__init__.py", line 51, in <module>
from tflite_model_maker import searcher
File "/home/ubuntu/examples/tensorflow_examples/lite/model_maker/pip_package/src/tflite_model_maker/searcher/__init__.py", line 25, in <module>
from tensorflow_examples.lite.model_maker.core.task.searcher import ExportFormat
File "/home/ubuntu/examples/tensorflow_examples/lite/model_maker/pip_package/src/tensorflow_examples/lite/model_maker/core/task/searcher.py", line 30, in <module>
from tensorflow_examples.lite.model_maker.core.utils import ondevice_scann_builder
File "/home/ubuntu/examples/tensorflow_examples/lite/model_maker/pip_package/src/tensorflow_examples/lite/model_maker/core/utils/ondevice_scann_builder.py", line 17, in <module>
from scann.proto import scann_pb2
File "/home/ubuntu/bert_QA/env/lib/python3.8/site-packages/scann/__init__.py", line 2, in <module>
from scann.scann_ops.py import scann_ops
File "/home/ubuntu/bert_QA/env/lib/python3.8/site-packages/scann/scann_ops/py/scann_ops.py", line 23, in <module>
_scann_ops_so = tf.load_op_library(
File "/home/ubuntu/bert_QA/env/lib/python3.8/site-packages/tensorflow/python/framework/load_library.py", line 54, in load_op_library
lib_handle = py_tf.TF_LoadLibrary(library_filename)
tensorflow.python.framework.errors_impl.NotFoundError: /home/ubuntu/bert_QA/env/lib/python3.8/site-packages/scann/scann_ops/cc/_scann_ops.so: undefined symbol: _ZN4absl12lts_2021032416numbers_internal9kHexTableE
It occurs when I attempt to use the tflite_model_maker library. Corrupted or outdated shared library file?
Okay, I discovered it could be fixed by simply installing scann using pip:
pip install scann

ImportError: cannot import name '_assert_shallow_structure' from 'tree'

I am getting that error while importing tensorflow_probability in IDLE(Default python editor). I don't get that error if use same code in VS code. Works perfectly fine in VS code.
Here are my imports
import numpy as np
import tensorflow.compat.v1 as tf
import tensorflow_probability as tfp
tf.disable_v2_behavior()
Here is complete error
Traceback (most recent call last):
File "C:\Python Scripts\pos_tagging.py", line 4, in <module>
import tensorflow_probability as tfp
File "C:\Users\aaaa\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow_probability\__init__.py", line 77, in <module>
from tensorflow_probability.python import * # pylint: disable=wildcard-import
File "C:\Users\aaaa\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow_probability\python\__init__.py", line 21, in <module>
from tensorflow_probability.python import bijectors
File "C:\Users\aaaa\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow_probability\python\bijectors\__init__.py", line 23, in <module>
from tensorflow_probability.python.bijectors.absolute_value import AbsoluteValue
File "C:\Users\aaaa\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow_probability\python\bijectors\absolute_value.py", line 23, in <module>
from tensorflow_probability.python.bijectors import bijector
File "C:\Users\aaaa\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow_probability\python\bijectors\bijector.py", line 31, in <module>
from tensorflow_probability.python.internal import distribution_util
File "C:\Users\aaaa\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow_probability\python\internal\distribution_util.py", line 28, in <module>
from tensorflow_probability.python.internal import prefer_static
File "C:\Users\aaaa\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow_probability\python\internal\prefer_static.py", line 30, in <module>
from tensorflow_probability.python.internal.backend import numpy as nptf
File "C:\Users\aaaa\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow_probability\python\internal\backend\numpy\__init__.py", line 21, in <module>
from tensorflow_probability.python.internal.backend.numpy import bitwise
File "C:\Users\aaaa\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow_probability\python\internal\backend\numpy\bitwise.py", line 23, in <module>
from tensorflow_probability.python.internal.backend.numpy import _utils as utils
File "C:\Users\aaaa\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow_probability\python\internal\backend\numpy\_utils.py", line 26, in <module>
from tensorflow_probability.python.internal.backend.numpy import nest
File "C:\Users\aaaa\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow_probability\python\internal\backend\numpy\nest.py", line 34, in <module>
from tree import _assert_shallow_structure
ImportError: cannot import name '_assert_shallow_structure' from 'tree' (C:\Users\aaaa\AppData\Local\Programs\Python\Python38\Lib\idlelib\tree.py)
Python Version:3.8.5 64 bit
Windows machine
Look at where it's importing from (C:\Users\aaaa\AppData\Local\Programs\Python\Python38\Lib\idlelib\tree.py) I think you meant to import from dm-tree.
Here's my solution:
if you don't have dm-tree installed
pip install dm-tree
if you do, install PyCharm and use that to run the code. It wont have the conflict that IDLE would on the tree.py

AttributeError: type object 'h5py.h5r.Reference' has no attribute '__reduce_cython__'

I am using python 3.6,Tensorflow 1.3, Keras 2.1.2
I was importing Resnet50 and I got this error"ImportError: load_model requires h5py" so I used
conda install h5py
but then I got this error knowing that the installed version of h5py is 2.9.0enter image description here
Any solutions for this error?
I am getting the same thing when trying to import tensorflow (v2.0.0) and Python 3.7.3
Traceback:
>>> import tensorflow as tf
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\*\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "C:\Users\*\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow\python\__init__.py", line 82, in <module>
from tensorflow.python import keras
File "C:\Users\*\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow\python\keras\__init__.py", line 25, in <module>
from tensorflow.python.keras import applications
File "C:\Users\*\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow\python\keras\applications\__init__.py", line 26, in <module>
from tensorflow.python.keras import layers
File "C:\Users\*\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow\python\keras\layers\__init__.py", line 29, in <module>
from tensorflow.python.keras.layers.advanced_activations import LeakyReLU
File "C:\Users\*\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow\python\keras\layers\advanced_activations.py", line 27, in <module>
from tensorflow.python.keras.utils import tf_utils
File "C:\Users\*\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow\python\keras\utils\__init__.py", line 38, in <module>
from tensorflow.python.keras.utils.multi_gpu_utils import multi_gpu_model
File "C:\Users\*\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow\python\keras\utils\multi_gpu_utils.py", line 22, in <module>
from tensorflow.python.keras.engine.training import Model
File "C:\Users\*\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow\python\keras\engine\training.py", line 42, in <module>
from tensorflow.python.keras.engine.network import Network
File "C:\Users\potvin\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow\python\keras\engine\network.py", line 40, in <module>
from tensorflow.python.keras.engine import saving
File "C:\Users\*\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow\python\keras\engine\saving.py", line 38, in <module>
import h5py
File "C:\Users\*\AppData\Local\Continuum\anaconda3\lib\site-packages\h5py\__init__.py", line 36, in <module>
from ._conv import register_converters as _register_converters
File "h5py\h5r.pxd", line 21, in init h5py._conv
File "h5py\h5r.pyx", line 145, in init h5py.h5r
AttributeError: type object 'h5py.h5r.Reference' has no attribute '__reduce_cython__'
Edit: I was able to fix this issue by restarting the kernel.

not able to resolve AttributeError: module 'pandas' has no attribute 'read_csv'

I am using Python 3 and working on an ML project. My code ran fine for the first time but suddenly, out of nowhere, this error popped up.
Traceback (most recent call last):
File "<ipython-input-2-3ae66814e4b2>", line 1, in <module>
import pandas as pd
File "C:\Users\ruhani\Anaconda3\lib\site-packages\pandas\__init__.py", line 42, in <module>
from pandas.core.api import *
File "C:\Users\ruhani\Anaconda3\lib\site-packages\pandas\core\api.py", line 10, in <module>
from pandas.core.groupby import Grouper
File "C:\Users\ruhani\Anaconda3\lib\site-packages\pandas\core\groupby.py", line 49, in <module>
from pandas.core.frame import DataFrame
File "C:\Users\ruhani\Anaconda3\lib\site-packages\pandas\core\frame.py", line 67, in <module>
from pandas.core.generic import NDFrame, _shared_docs
File "C:\Users\ruhani\Anaconda3\lib\site-packages\pandas\core\generic.py", line 36, in <module>
trainDF=pd.read_csv("C:\\Users\\ruhani\\Desktop\\Minor Project\\projects\\train.csv\\train.csv")
AttributeError: module 'pandas' has no attribute 'read_csv'
Please help me as I am new to Python and Machine Learning.

Categories