【问题标题】:After reinstalling Anaconda I can't use numpy or install a requirements.txt重新安装 Anaconda 后,我无法使用 numpy 或安装 requirements.txt
【发布时间】:2021-09-03 02:57:18
【问题描述】:

我在运行一些笔记本时遇到了问题,因为速度太慢了。我每次都必须重新启动内核才能正常运行。我决定重新安装 anaconda,但现在不行了。

以前能够运行的 numpy 行现在不能: np.divide(b, a, where=a.dtypes.ne(object)).combine_first(a)。这与this 帖子有关。错误如下:TypeError: unsupported operand type(s) for /: 'str' and 'str'。但同样,它曾经有效。

我认为在考虑 numpy 和 python 的版本时,通过加载可用(并且以前工作过)的 requirements.txt 文件可以解决问题。但是现在这也不起作用。我收到以下错误:ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: 'C:\\ci\\argon2-cffi_1596828585465\\work'。我发现问题与路径有关,但我无法修复它。

我也尝试过手动降级 python 和 numpy,但没有。

知道这里会发生什么吗?

【问题讨论】:

    标签: python numpy anaconda requirements.txt


    【解决方案1】:

    基于第一个错误声明:

    TypeError:/: 'str' 和 'str' 的操作数类型不受支持

    这似乎是由于数据计算中的数据类型(在您的情况下为字符串)所致。类似这个错误:TypeError: unsupported operand type(s) for /: 'str' and 'str'

    也许,如果您发现 Numpy 未正确安装,您可以在 Conda 终端中重新安装 numpy 模块。 Installing Conda package

    【讨论】:

    • 我尝试重新安装 numpy 几次,但似乎没有用。最后,只从here安装旧版本的Anaconda修复它
    • 很高兴听到您在重新安装到旧版本的 Anaconda 后解决了问题。我还找到了一个与您讨论类似问题的链接:link。可能对你有帮助。
    猜你喜欢
    • 2016-02-22
    • 1970-01-01
    • 2019-03-18
    • 1970-01-01
    • 1970-01-01
    • 2020-01-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多