Get "No module named 'pandas.tslib'" error while importing xarray - python-3.x

While importing xarray following error was observed. Earlier it was running fine. Does anyone have any suggestions for why?
import xarray as xr
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/jives/anaconda3/lib/python3.7/site-packages/xarray/__init__.py", line 4, in <module>
from .core.dataset import Dataset
File "/home/jives/anaconda3/lib/python3.7/site-packages/xarray/core/dataset.py", line 16, in <module>
from .. import conventions
File "/home/jives/anaconda3/lib/python3.7/site-packages/xarray/conventions.py", line 9, in <module>
from pandas.tslib import OutOfBoundsDatetime
ModuleNotFoundError: No module named 'pandas.tslib'

Related

ModuleNotFoundError: No module named 'torchvision.models.segmentation.segmentation'

I am trying to execute the code in this GitHub repository. I get the following error:
Traceback (most recent call last):
File "/home/bellman/Documents/face/MaskFaceGAN/main.py", line 7, in <module>
from trainer import Trainer
File "/home/bellman/Documents/face/MaskFaceGAN/trainer.py", line 7, in <module>
from model_module import batch_mse_loss
File "/home/bellman/Documents/face/MaskFaceGAN/model_module.py", line 6, in <module>
from models import BranchedTiny, FaceParser, Generator
File "/home/bellman/Documents/face/MaskFaceGAN/models/__init__.py", line 2, in <module>
from .face_parser import FaceParser
File "/home/bellman/Documents/face/MaskFaceGAN/models/face_parser/__init__.py", line 1, in <module>
from .face_parser import FaceParser
File "/home/bellman/Documents/face/MaskFaceGAN/models/face_parser/face_parser.py", line 7, in <module>
from torchvision.models.segmentation.segmentation import deeplabv3_resnet50
ModuleNotFoundError: No module named 'torchvision.models.segmentation.segmentation'
I checked the directory: anaconda3/envs/mfg/lib/python3.10/site-packages/torchvision/models/segmentation and actually didn't find any segmentation.py file.
conda list gives:
Please help!

Unable to import pyspark ml library

when I tried to import pyspark ml library to run regression, I got the below error:
from pyspark.ml.feature import VectorAssembler
traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/jpour/spark/spark-3.3.1-bin-hadoop3/python/pyspark/ml/__init__.py", line 22, in <module>
from pyspark.ml.base import (
File "/home/jpour/spark/spark-3.3.1-bin-hadoop3/python/pyspark/ml/base.py", line 40, in <module>
from pyspark.ml.param import P
File "/home/jpour/spark/spark-3.3.1-bin-hadoop3/python/pyspark/ml/param/__init__.py", line 32, in <module>
import numpy as np
ModuleNotFoundError: No module named 'numpy'
I'm unable to understand the issue with the import.

while importing seaborn i was getting this error

import seaborn
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\HP\Anaconda3\lib\site-packages\seaborn\__init__.py", line 6, in <module>
from .rcmod import *
File "C:\Users\HP\Anaconda3\lib\site-packages\seaborn\rcmod.py", line 5, in <module>
from . import palettes, _orig_rc_params
File "C:\Users\HP\Anaconda3\lib\site-packages\seaborn\palettes.py", line 12, in <module>
from .utils import desaturate, set_hls_values, get_color_cycle
File "C:\Users\HP\Anaconda3\lib\site-packages\seaborn\utils.py", line 7, in <module>
from scipy import stats
File "C:\Users\HP\Anaconda3\lib\site-packages\scipy\stats\__init__.py", line 345, in <module>
from .morestats import *
File "C:\Users\HP\Anaconda3\lib\site-packages\scipy\stats\morestats.py", line 12, in <module>
from numpy.testing.decorators import setastest
ModuleNotFoundError: No module named 'numpy.testing.decorators'
Welcome to Stackoverflow and Happy New Year!
I think you haven't installed numpy.testing.decorators.
Run pip install numpy and retry.

no add_to_collection was found when using tensorflowjs_converter

I am trying to convert a savedModel into TensorFlow.js web format.
I installed tensorflowjs via sudo pip3 install tensorflowjs
When running tensorflowjs_converter--input_path=full_path_to/saved_model/saved_model.pb --outputpath=full_path_to/js
I get an error saying ImportError: cannot import name 'add_to_collection'
Even if I run tensorflowjs_converter --help, I get the exact same error.
Here is the full error:
Traceback (most recent call last):
File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflow_hub/tf_v1.py", line 29, in <module>
from tensorflow.compat.v1 import * # pylint: disable=wildcard-import
ModuleNotFoundError: No module named 'tensorflow.compat.v1'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/ubuntu/.local/bin/tensorflowjs_converter", line 7, in <module>
from tensorflowjs.converters.converter import main
File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflowjs/__init__.py", line 21, in <module>
from tensorflowjs import converters
File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflowjs/converters/__init__.py", line 24, in <module>
from tensorflowjs.converters.tf_saved_model_conversion_v2 import convert_tf_saved_model
File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflowjs/converters/tf_saved_model_conversion_v2.py", line 37, in <module>
import tensorflow_hub as hub
File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflow_hub/__init__.py", line 30, in <module>
from tensorflow_hub.estimator import LatestModuleExporter
File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflow_hub/estimator.py", line 25, in <module>
from tensorflow_hub import tf_utils
File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflow_hub/tf_utils.py", line 28, in <module>
from tensorflow_hub import tf_v1
File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflow_hub/tf_v1.py", line 32, in <module>
from tensorflow import add_to_collection
ImportError: cannot import name 'add_to_collection'
Problem solved by downgrading tensorflowjs 1.0.1 to 0.6.4

Python Sklearn import error

I'm new to machine learning libraries in python. I've installed 'python 3.4'.
I've also installed scikit-learn , numpy and scipy from wheel files.
scikit_learn-0.18.1-cp34-none-win_amd64
scipy-0.16.0-cp34-none-win_amd64
numpy-1.9.2-cp34-none-win_amd64.whl
import scipy
import numpy
above statements are working fine. but when i try to execute import sklearn
i get below error
Traceback (most recent call last):
File "C:\Users\Usman\Desktop\hello_python.py", line 1, in <module>
import sklearn
File "C:\Python34\Lib\site-packages\sklearn\__init__.py", line 57, in <module>
from .base import clone
File "C:\Python34\Lib\site-packages\sklearn\base.py", line 12, in <module>
from .utils.fixes import signature
File "C:\Python34\Lib\site-packages\sklearn\utils\__init__.py", line 10, in <module>
from .murmurhash import murmurhash3_32
File "__init__.pxd", line 155, in init sklearn.utils.murmurhash (sklearn\utils\murmurhash.c:6319)
ValueError: numpy.dtype has the wrong size, try recompiling. Expected 88, got 96
--edit
when i execute import sklearn from python shell i get the following error
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python34\Lib\site-packages\sklearn\__init__.py", line 56, in <module>
from . import __check_build
ImportError: cannot import name '__check_build'
I've searched but couldn't find anything helpful. Kindly help me remove this error.

Resources