I'm trying to use the Voronoi tessellation from scipy
http://docs.scipy.org/doc/scipy-dev/reference/generated/scipy.spatial.Voronoi.html
but python won't import it
from scipy.spatial import Voronoi
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name Voronoi
however, I don't have a problem importing other classes from scipy.spatial
from scipy.spatial import Delaunay
Related
ImportError Traceback (most recent call last)
c:\Users\ychen\Documents\GitHub\pollen_testing.ipynb Cell 1' in <cell line: 3>()
1 import pandas as pd
2 import numpy as np
----> 3 from psy_strat.stratplot import stratplot
5 from IPython.display import Image
6 from overnight_consistency_checker import ConsistencyChecker, FFT_values
What is wrong with it, I do not know how to fix this problem. I even try to install numpy again, it does still not work out.
Uninstalled & reinstalled scipy package, though cannot seem to import linalg function.
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-3-133368b721e2> in <module>
1 import numpy as np
2 import sklearn
----> 3 from scipy import linlag
ImportError: cannot import name 'linlag' from 'scipy' (C:\Users\lenov\anaconda3\lib\site-packages\scipy\__init__.py)
It's a minor syntax error. It should be "linalg".
while importing tensor flow as import tensorflow it raise an error,:
import tensorflow
Traceback (most recent call last):
File "C:\Users\Amit Maurya\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed while importing _pywrap_tensorflow_internal: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Amit Maurya\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow_init_.py", line 41, in
from tensorflow.python.tools import module_util as module_util
File "C:\Users\Amit Maurya\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python_init.py", line 40, in
from tensorflow.python.eager import context
File "C:\Users\Amit Maurya\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\eager\context.py", line 35, in
from tensorflow.python import pywrap_tfe
File "C:\Users\Amit Maurya\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\pywrap_tfe.py", line 28, in
from tensorflow.python import pywrap_tensorflow
File "C:\Users\Amit Maurya\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 83, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\Amit Maurya\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed while importing _pywrap_tensorflow_internal: The specified module could not be found.
Failed to load the native TensorFlow runtime.
I've had similar issue but I'm not sure if the solution is applicable here, too. Anyway, I'd suggest to install the MS Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019 if you haven't done it yet.
You can find the redistributable here.
I wanted to import geopandas as gpd, but the error message appears
ModuleNotFoundError: No module named 'pandas.api.extensions'.
What I have to do, to import geopandas?
I installed geopandas via anaconda promt:
C:\Users\sar>conda install -c conda-forge geopandas
Collecting package metadata (current_repodata.json): done
Solving environment: done
All requested packages already installed.
When i import geopandas, following code is shown in the console:
import geopandas as gpd
Traceback (most recent call last):
File "<ipython-input-16-a62d01c1d62e>", line 1, in <module>
import geopandas as gpd
File "C:\Users\sar\Anaconda\envs\codingingis\lib\site-packages\geopandas\__init__.py", line 1, in <module>
from geopandas.geoseries import GeoSeries # noqa
File "C:\Users\sar\Anaconda\envs\codingingis\lib\site-packages\geopandas\geoseries.py", line 15, in <module>
from geopandas.base import GeoPandasBase, _delegate_property
File "C:\Users\sar\Anaconda\envs\codingingis\lib\site-packages\geopandas\base.py", line 13, in <module>
from .array import GeometryArray, GeometryDtype
File "C:\Users\sar\Anaconda\envs\codingingis\lib\site-packages\geopandas\array.py", line 7, in <module>
from pandas.api.extensions import ExtensionArray, ExtensionDtype
ModuleNotFoundError: No module named 'pandas.api.extensions'
in array.py this code is not found:
from pandas.api.extensions import ExtensionArray, ExtensionDtype
My issue is about the import of scipy
Reproducing code example:
import scipy
Error message:
Traceback (most recent call last):
File "D:/Projects/gait/tests/__init__.py", line 2, in <module>
import scipy
File "C:\Users\Leynier\AppData\Local\Programs\Python\Python37-32\lib\site-packages\scipy\__init__.py", line 110, in <module>
from scipy._lib._version import NumpyVersion as _NumpyVersion
File "C:\Users\Leynier\AppData\Local\Programs\Python\Python37-32\lib\site-packages\scipy\_lib\__init__.py", line 14, in <module>
from scipy._lib._testutils import PytestTester
ValueError: source code string cannot contain null bytes
Process finished with exit code 1
Scipy/Numpy/Python version information:
Scipy version: 1.3.0
Numpy version: 1.16.4
Python version: 3.7.3
OS: Windows 10