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".
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.
I just used used the Seaborn library about 5 days ago, no problems.
Tried to use it yesterday and it's giving an error when I try to import. Someone about a year ago had the same exact problem but their fix did not work for me. I'm trying to complete a project and this is a huge set back so if anyone can help, please do!
input
import seaborn as sns
result
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-3-a84c0541e888> in <module>
----> 1 import seaborn as sns
/opt/anaconda3/envs/datascience/lib/python3.6/site-packages/seaborn/__init__.py in <module>
8 from .palettes import *
9 from .linearmodels import *
---> 10 from .categorical import *
11 from .distributions import *
12 from .timeseries import *
/opt/anaconda3/envs/datascience/lib/python3.6/site-packages/seaborn/categorical.py in <module>
5 from scipy import stats
6 import pandas as pd
----> 7 from pandas.core.series import remove_na
8 import matplotlib as mpl
9 from matplotlib.collections import PatchCollection
ImportError: cannot import name 'remove_na'
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
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