python的环境问题相关

1. 在虚拟环境中安装ipykernel时的报错信息:

conda install -n pyart_env ipykernel --update-deps --force-reinstall

出现:

CondaVerificationError: The package for debugpy located at D:\Anaconda\pkgs\debugpy-1.6.6-py38hd3f51b4_0
appears to be corrupted. The path 'Lib/site-packages/debugpy/_vendored/pydevd/pydevd_attach_to_process/inject_dll_amd64.exe'
specified in the package manifest cannot be found.

CondaVerificationError: The package for pywin32 located at D:\Anaconda\pkgs\pywin32-304-py38hd3f51b4_2
appears to be corrupted. The path 'Lib/site-packages/win32/pythonservice.exe'
specified in the package manifest cannot be found.

解决方法:

step1: 删除所有package和缓存包

conda clean --packages --tarballs

然后再安装时又出现了错误InvalidArchiveError('Error with archive D:\\Anaconda\\pkgs\\lcms2-2.14-ha5c8aab_1c5up1cre\\pkg-lcms2-2.14-ha5c8aab_1.tar.zst.  You probably need to delete and re-download or re-create this file,重新下载再安装也没有解决,就先没有管这个环境了。

2. import xarray时报错:

AttributeError: module 'dask.array' has no attribute 'lib'

解决方法:从2022.6.0降级到2022.3.0

pip install --upgrade xarray==2022.3.0

3. conda install pyart 时很多inconsistency的错误:

换为pip install。

装不上库的时候优先尝试这个方法。

4. 常用库的安装

5. 'gdal_translate ' is not recognized as an internal or external command, operable program or batch file. 

解决方法:找到了可执行文件的路径(D:\Anaconda\Lib\site-packages\osgeo),运行D:\Anaconda\Lib\site-packages\osgeo\gdal_translate XXX 即可。也可将其加入到环境变量当中。

6. 离线查看vscode版本号

go to Help->About

7. cartopy 

anaconda安装有很多库不兼容没装得成,直接pip install cartopy。

print (cartopy.config['data_dir']) 可以查到地图文件存放路径。

然后到naturalEarth官网下载physical文件(10、50和100m比例尺的都下载下来),点击进去选择download all,然后把3个zip文件传到.../.local/share/cartopy/shapefiles/natural_earth/physical文件夹下并解压。

这样画地理边界就可以了。cartopy和wrf-python结合画图后面单独写。

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值