为python3.9安装numpy的麻烦

发布于 2025-01-25 19:12:00 字数 630 浏览 1 评论 0原文

我在Ubuntu上安装了几个Python版本。我想念什么?

user@serverA:/folderB$ python3.9 -m pip install numpy
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: numpy in /usr/lib/python3/dist-packages (1.13.3)
user@serverA:/folderB$ python3.9 logs_unifier.py 
Traceback (most recent call last):
  File "/folderB/logs_unifier.py", line 2, in <module>
    import pandas as pd
  File "/usr/lib/python3/dist-packages/pandas/__init__.py", line 18, in <module>
    raise ImportError(
ImportError: Missing required dependencies ['numpy']
user@serverA:/folderB$ 

I am running on ubuntu with several python versions installed. What am I missing?

user@serverA:/folderB$ python3.9 -m pip install numpy
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: numpy in /usr/lib/python3/dist-packages (1.13.3)
user@serverA:/folderB$ python3.9 logs_unifier.py 
Traceback (most recent call last):
  File "/folderB/logs_unifier.py", line 2, in <module>
    import pandas as pd
  File "/usr/lib/python3/dist-packages/pandas/__init__.py", line 18, in <module>
    raise ImportError(
ImportError: Missing required dependencies ['numpy']
user@serverA:/folderB$ 

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

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

发布评论

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

评论(1

雄赳赳气昂昂 2025-02-01 19:12:00

尝试运行Python3.9 -M Pip install -u -u -user numpy-U表示升级,- 用户表示它将在您的用户文件夹中安装,而不是系统文件夹 - 它只是摆脱了该消息。

Numpy可以使用1.22版,因此pandas可能不适用于旧版本。

Try running python3.9 -m pip install -U --user numpy. -U means upgrade, and --user means it'll install in your user folder, not the system folder - it just gets rid of that message.

NumPy is up to version 1.22, so it's possible that pandas just doesn't work with the old version.

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