最近要做贝叶斯因子检验,需要用到pymc这个库,结果创建新环境之后怎么也装不上,报错如下:
SafetyError: The package for ncurses located at /mnt/d/Linux/miniconda3/pkgs/ncurses-6.4-h59595ed_2
appears to be corrupted. The path ‘share/terminfo/E/Eterm’
has an incorrect size.
reported size: 2224 bytes
actual size: 908 bytes
SafetyError: The package for ncurses located at /mnt/d/Linux/miniconda3/pkgs/ncurses-6.4-h59595ed_2
appears to be corrupted. The path ‘share/terminfo/e/eterm-color’
has an incorrect size.
reported size: 1271 bytes
actual size: 908 bytes
这个ncurses-6.4-h59595ed_2是一个很新的版本,有点小错也正常。当时想可能是这个库的版本问题,想回退到之前版本,结果发现回退不了!报错如下:
CaseInsensitiveFileSystemError('Error with archive /mnt/d/miniconda3/pkgs/ncurses-6.3-h5eee18b_3.conda. You probably need to delete and re-download or re-create this file. Message was:\n\n\n Cannot extract package to a case-insensitive file system. Your install\n destination does not differentiate between upper and lowercase\n characters, and this breaks things. Try installing to a location that\n is case-sensitive. Windows drives are usually the culprit here - can\n you install to a native Unix drive, or turn on case sensitivity for\n this (Windows) location?\n\n package location: %(package_location)s\n extract location: %(extract_location)s\n ')
但实际上我的文件夹是区分大小写的,所以这条报错莫名其妙
于是乎在进行很多试错之后,我把base环境卸载重装了。之后发现解决方法如下:
(1)根据自己的版本安装conda
我的Python版本是3.8.16,我就去conda官网下与之对应的conda包装上了,没有报错。conda版本为conda 23.9.0。
(2)将base环境中的ncurses降版本
本来我自带的ncurses是6.4的,但是这样一创建新环境就报错,这可能是不同环境下ncurses6.4的兼容性有问题,因此要通过如下命令将base环境下的ncurses退回到6.3版本
conda install ncurses=6.3
(3)正常创建环境
conda create -c conda-forge -n pymc_env “pymc>=5”
这样新环境下安装的是ncurses6.4,可以正常使用。