I have installed nnet-ts in mac using
pip install nnet-ts
All the dependency libraries are already installed. But while importing module nnet_ts
from nnet_ts import *
following error is generated
ModuleNotFoundError Traceback (most recent
call last)
<ipython-input-7-ad5e84de7763> in <module>
----> 1 from nnet_ts import *
2 count=0
3 ahead=12
4 pred=[]
~/anaconda3/lib/python3.6/site-packages/nnet_ts/__init__.py in <module>
5 from keras.layers.core import Dense, Activation, Dropout
6 from sklearn.preprocessing import StandardScaler
----> 7 from TimeSeriesNnet import TimeSeriesNnet
ModuleNotFoundError: No module named 'TimeSeriesNnet'
I try to figure out from this thread Using the TimeSeriesNnet() method from the nnet_ts module throws NameError
but does not work for MAC. How can we solve this problem in MAC OX?
Related
Ok, there are multiple similar errors and no conclusive solution:
System: windows 10, conda 4.10.3, python 3.7.11
In cmd I activated conda virtual environment: conda activate tensorflow
I ran
import vtk
and got back:
ImportError Traceback (most recent call last)
D:\user_data\Program_Files\Anaconda3\envs\tensorflow\lib\site-packages\vtkmodules\vtkCommonCore.py in <module>
4 # use relative import for installed modules
----> 5 from .vtkCommonCorePython import *
6 except ImportError:
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
ModuleNotFoundError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_3128/2084281522.py in <module>
----> 1 import vtk
D:\user_data\Program_Files\Anaconda3\envs\tensorflow\lib\site-packages\vtk.py in <module>
30 all_spec = importlib.util.find_spec('vtkmodules.all')
31 all_m = importlib.util.module_from_spec(all_spec)
---> 32 all_spec.loader.exec_module(all_m)
33
34 # import vtkmodules
D:\user_data\Program_Files\Anaconda3\envs\tensorflow\lib\site-packages\vtkmodules\all.py in <module>
5
6 # --------------------------------------
----> 7 from .vtkCommonCore import *
8 from .vtkCommonMath import *
9 from .vtkCommonMisc import *
D:\user_data\Program_Files\Anaconda3\envs\tensorflow\lib\site-packages\vtkmodules\vtkCommonCore.py in <module>
7 # during build and testing, the modules will be elsewhere,
8 # e.g. in lib directory or Release/Debug config directories
----> 9 from vtkCommonCorePython import *
ModuleNotFoundError: No module named 'vtkCommonCorePython'
Previously in conda virtual environment I ran conda install vtk and it ran fine.
My path variable contains: D:\user_data\Program_Files\Anaconda3
I also searched and found the following folder: D:\user_data\Program_Files\Anaconda3\pkgs\vtk-8.2.0-py37h1e53df8_200
How else can I troubleshoot?
I tried
pip install tensorflow
it says it is incompatible with my numpy version(1.20.0)
Then I tried unistall numpy to required version numpy~=1.19.2
Then
pip install fancyimpute
It installed without any errors in AnacondaPromt
But it still not working in Jupyter Notebook
The Error is
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-34-e68ac4972d28> in <module>
16 import tensorflow as tf
17 import numpy.core.multiarray
---> 18 from fancyimpute import KNN
~\anaconda3\lib\site-packages\fancyimpute\__init__.py in <module>
2
3 from .solver import Solver
----> 4 from .nuclear_norm_minimization import NuclearNormMinimization
5 from .matrix_factorization import MatrixFactorization
6 from .iterative_svd import IterativeSVD
~\anaconda3\lib\site-packages\fancyimpute\nuclear_norm_minimization.py in <module>
11 # limitations under the License.
12
---> 13 import cvxpy
14
15 from .solver import Solver
~\anaconda3\lib\site-packages\cvxpy\__init__.py in <module>
16
17 __version__ = "1.1.10"
---> 18 from cvxpy.atoms import *
19 from cvxpy.constraints import NonPos, Zero, SOC, PSD
20 from cvxpy.expressions.expression import Expression
~\anaconda3\lib\site-packages\cvxpy\cvxcore\python\__init__.py in <module>
1 # TODO(akshayka): This is a hack; the swig-auto-generated cvxcore.py
2 # tries to import cvxcore as `from . import _cvxcore`
----> 3 import _cvxcore
ImportError: numpy.core.multiarray failed to import
I had the same issue and I upgraded NumPy by running pip install numpy --upgrade. It worked around for me.
I found a solution right here
Opencv/numpy issue: "module compiled against API version X but this version of numpy is Y"
Here is the table and since my version is 1.19.5(0xd) now,
I uninstalled this version and installed 0xe version of numpy which is 1.20.0.
I am using jupyter nb running python 3.9.1 using pip to install modules etc.
All imports work smoothly except missingno.
All the modules being imported are located in the same location Python39\lib\site-packages but missingno results in Import Error.
The missingno module had been imported and it has run smoothly before but after a kernel restart, the Import Error cropped up.
ImportError Traceback (most recent call last)
<ipython-input-16-fad26a6fb4fe> in <module>
6 #Visualization
7 import matplotlib.pyplot as plt
----> 8 import missingno
9 import seaborn as sns
10 plt.style.use('seaborn-whitegrid')
~\AppData\Local\Programs\Python\Python39\Lib\site-packages\missingno\missingno.py in <module>
6 import seaborn as sns
7 import pandas as pd
----> 8 from .utils import nullity_filter, nullity_sort
9 import warnings
10
ImportError: attempted relative import with no known parent package
How to fix it?
I have tried to delete the missingno files and reinstalling it using pip install missingno but nothing works.
Running Python in shell and importing missingno, I still get the same error. There is nothing fancy in my code, a simple, generic import which showed no signs of error before kernel restart.
>>> import missingno
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\OK\AppData\Local\Programs\Python\Python39\Lib\site-packages\missingno\missingno.py", line 8, in <module>
from .utils import nullity_filter, nullity_sort
ImportError: attempted relative import with no known parent package
Try opening the missingno.py file in site-packages.
Change
from .utils import nullity_filter, nullity_sort
to
from utils import nullity_filter, nullity_sort
I have installed simpletransformers with success. Why is it not working? A big thank you in advance.
from simpletransformers.language_modeling import LanguageModelingModel
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-9-eb4f4fd6459f> in <module>
----> 1 from simpletransformers.language_modeling import LanguageModelingModel
~\anaconda3\lib\site-packages\simpletransformers\language_modeling\__init__.py in <module>
----> 1 from simpletransformers.config.model_args import LanguageModelingArgs
2 from simpletransformers.language_modeling.language_modeling_model import LanguageModelingModel
~\anaconda3\lib\site-packages\simpletransformers\config\model_args.py in <module>
6 import warnings
7
----> 8 from torch.utils.data import Dataset
9
10
ModuleNotFoundError: No module named 'torch'
I answered my own question with "pip install torch" and updated the Microsoft C++ reading software. :)))
I am trying to load tensorflow within jupyter notebook and receive the following error:
ImportError Traceback (most recent call last) <ipython-input-1-28a19874e1dd> in <module>()
5 import tensorflow as tf
6 from tensorflow.python.framework import ops
----> 7 from tf_utils import load_dataset, random_mini_batches, convert_to_one_hot, predict
8
9 get_ipython().magic(u'matplotlib inline')
/Pathway/tf_utils.py in <module>()
17 import sys
18 import tensorflow as tf
---> 19 import src.utils as utils
20 import logging
21 from tensorflow.contrib import slim
ImportError: No module named src.utils
I have the latest tensorflow installed and have also added models to the PYTHONPATH via:
export PYTHONPATH="$PYTHONPATH:/Pathway/tfmodels-1.9.0"
Do you know how I can resolve this import error?
To resolve this import error I manually imported the missing functions from the following github repo > https://github.com/andersy005/deep-learning-specialization-coursera/blob/master/02-Improving-Deep-Neural-Networks/week3/Programming-Assignments/tf_utils.py