如何使用miniforge更改numpy版本

发布于 2025-01-30 11:35:55 字数 246 浏览 6 评论 0原文

我已经在Mac上安装了Miniforge,其中使用了Jupyter笔记本上的“本地env”。我无法在此内核上更改Numpy版本(需要降级到1.19.5),已经尝试了: (1)pip安装numpy == 1.19.5& (2)conda安装-c conda -forge numpy = 1.19.5。

Numpy版本似乎在Conda-Ipython3内核上很容易变化,但是我的项目

在所有这些方面都在“本地env”上运行,但仍在学习。请帮忙

I have installed miniforge on my mac , in that using a 'local env' on jupyter notebook. I can't change the numpy version (need to downgrade to 1.19.5) on this kernel, have tried:
(1)pip install numpy==1.19.5 &
(2)conda install -c conda-forge numpy=1.19.5.

numpy version seems to be changing easily on conda-ipython3 kernel, but my project is running on 'local env'

very new to all this, still learning. Please help

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

绮筵 2025-02-06 11:35:56

首先确保通过运行激活您的本地环境:.../{您的VENV文件夹路径}/scripts/activate。因为如果您在错误的虚拟环境上安装numpy,则它将无法正常工作。
然后通过运行pip卸载numpy来卸载numpy。然后安装所需的numpy版本。

first make sure that your local environment is activated by running: .../{your venv folder path}/Scripts/activate. Because if you install numpy on the wrong virtual environment then it won't work.
Then uninstall numpy by running pip uninstall numpy. Then install the numpy version you want.

迷爱 2025-02-06 11:35:56

您可以执行以下操作以确保所需的numpy版本:

  1. 激活本地环境
  2. 卸载任何先前安装的numpy
pip uninstall numpy
  1. numpy 版本。 >版本:
pip install numpy=1.19.5
  1. 检查numpy的已安装版本:
pip freeze

如果要导出软件包列表,请使用:

pip freeze > requirements.txt

You can do the following to ensure you have desired numpy version:

  1. Activate your local environment
  2. Uninstall any previously installed numpy version by using:
pip uninstall numpy
  1. Install the desired numpy version:
pip install numpy=1.19.5
  1. Check the installed version of numpy:
pip freeze

If you want to export the package list use:

pip freeze > requirements.txt
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文