【问题标题】:How can i use NumPy 1.18.5 for Python3.8 with Anaconda?如何将 NumPy 1.18.5 for Python3.8 与 Anaconda 一起使用?
【发布时间】:2021-02-05 05:44:20
【问题描述】:

我在使用 Numpy 1.18.5 版本时遇到问题。我有 Python3.8,它们似乎不兼容。我正在使用 Anaconda Navigator。很抱歉,如果这是非常基本的,但我是这个神奇世界的初学者。提前非常感谢。 这是我收到的消息错误:

$ python Bikeshare.py
C:\Users\Xabi\anaconda3\lib\site-packages\numpy\__init__.py:140: UserWarning: mkl-service package failed to import, therefore Intel(R) MKL initialization ensuring its correct out-of-the box operation under condition when Gnu OpenMP had already been loaded by Python process is not assured. Please install mkl-service package, see http://github.com/IntelPython/mkl-service
  from . import _distributor_init
Traceback (most recent call last):
  File "Bikeshare.py", line 2, in <module>
    import pandas as pd
  File "C:\Users\Xabi\anaconda3\lib\site-packages\pandas\__init__.py", line 16, in <module>
    raise ImportError(
ImportError: Unable to import required dependencies:
numpy:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.8 from "C:\Users\Xabi\anaconda3\python.exe"
  * The NumPy version is: "1.18.5"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: DLL load failed while importing _multiarray_umath: Das angegebene Modul wurde nicht gefunden. 

【问题讨论】:

标签: python numpy anaconda version


【解决方案1】:

您错过了激活 conda 环境,因此出现错误。试试

C:\> conda activate
(Anaconda3) C:\> python Bikeshare.py

如果激活不起作用,则说明您的安装不完整。试试

C:\> conda init

首先。

【讨论】:

    【解决方案2】:

    我可以看到脚本导入 Pandas 时出现错误。因此,您可能还需要更改您的 pandas 版本。

    检查你的 Numpy: 首先尝试找到您的 NumPy 版本。

    import numpy as np
    print(np.__version__)
    1.18.5
    

    如果不是你要找的版本,卸载当前版本,安装指定版本:

    pip uninstall numpy
    pip install numpy==1.18.5
    

    我不确定这是否是一个好主意,但我总是使用 python 的两个先前版本来确保我的所有依赖项都得到满足。由于 Python 3.9 可用,我使用 python 3.7

    【讨论】:

    • 非常感谢您的建议,我一定会这样做的 :)
    猜你喜欢
    • 1970-01-01
    • 2016-08-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-17
    • 1970-01-01
    • 2021-09-23
    • 1970-01-01
    相关资源
    最近更新 更多