我正在将Geopandas加载到沃森工作室的笔记本中。
!conda install --channel conda-forge geopandas geoplot geopy --yes输出似乎表明它工作正常。
!conda安装-通道conda-伪造地质公园地形图-是的
Solving environment: done
## Package Plan ##
environment location: /opt/conda/envs/Python36
added / updated specs:
- geopandas
- geoplot
- geopy
The following packages will be downloaded:
package | build
---------------------------|-----------------
geopandas-0.5.0 | py_3 891 KB conda-forge
------------------------------------------------------------
Total: 357.8 MB
The following NEW packages will be INSTALLED:
geopandas: 0.5.0-py_3 conda-forge
geoplot: 0.2.4-py_0 conda-forge
geopy: 1.20.0-py_0 conda-forge
Downloading and Extracting Packages
geopandas-0.5.0 | 891 KB | ##################################### | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done但是当我试图导入它时
import geopandas
from shapely.geometry import Point # Shapely for converting latitude/longtitude to geometry
from geopandas import GeoDataFrame
import geoplot
import geopy
import geoplot.crs as gcrs
import matplotlib.pyplot as plt
#from scipy import stats
import seaborn as sns
%matplotlib inline我得到了
ModuleNotFoundError回溯(最近一次调用)
在……里面
->1个进口地质公园
ModuleNotFoundError:没有名为“地质公园”的模块
两样都没有
!conda list也没有沃森工作室软件配置细节显示它是加载的。地质和地图学也是如此。
奇怪的是这上周起作用了。Python3.5似乎也存在同样的问题。
我也尝试用pip装载Geopandas,但结果是一样的。看来,conda和pip脚本都不太可能出错。
有谁能提出调查原因的方法吗。我和IBM有一个案子,但我想我也会在这里问。提前谢谢。
发布于 2019-07-08 14:52:33
来自IBM案例
您需要创建一个自定义环境来安装地质公园,这样就不需要显式地安装它。
channels:
- defaults
- conda-forge
# Please add conda packages here
dependencies:
- geopandas=0.3.0
- geoplot=0.2.3
- pysal=1.14.4
- folium=0.7.0
- python=3.6.8
# Please add pip packages here
# To add pip packages, please comment out the next line
#- pip:然后,您可以使用自定义环境为您的笔记本。请看这个:- https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/customize-envs.html?audience=wdp&context=wdp
https://stackoverflow.com/questions/56910377
复制相似问题