conda环境移动后出现openssl报错

autodl上移动miniconda3后报错
原始路径 /root/miniconda3
新路径 /root/autodl-tmp/miniconda3

具体报错信息
RuntimeError: OpenSSL 3.0's legacy provider failed to load. This is a fatal error by default, but cryptography supports running without legacy algorithms by setting the environment variable CRYPTOGRAPHY_OPENSSL_NO_LEGACY. If you did not expect this error, you have likely made a mistake with your OpenSSL configuration.

解决方案:使用系统自带的openssl而不是conda的 (其中“/root/autodl-tmp/”是{$PATH}需要用户自己替换成实际路径)
操作

  1. 首先,确认openssl的位置
    which openssl
    得到/root/autodl-tmp/miniconda3/bin/openssl
    此时会发现openssl在conda的bin目录下

  2. 把conda目录下的openssl改名
    mv /root/autodl-tmp/miniconda3/bin/openssl /root/autodl-tmp/miniconda3/bin/openssl-old

  3. 对/usr/local/bin目录下的openssl做软链接
    ln -s /usr/local/bin/openssl /root/autodl-tmp/miniconda3/bin/openssl

  4. 卸载cryptography库,重新安装一次

posted @ 2025-08-08 11:21  F1ash000  阅读(50)  评论(0)    收藏  举报