Numpy: Das Importieren der numpy c-Erweiterungen ist fehlgeschlagen.

Erstellt am 27. Jan. 2020  ·  5Kommentare  ·  Quelle: numpy/numpy

Problem

Beim Importieren von Pandas wird der folgende Fehler angezeigt:


  File "D:\code\folder1\folder2\metadata\lidar_processing.py", line 17, in <module>
    import pandas as pd

  File "C:\Users\MyUserName\.conda\envs\EnvName\lib\site-packages\pandas\__init__.py", line 17, in <module>
    "Unable to import required dependencies:\n" + "\n".join(missing_dependencies)

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.
- Try uninstalling and reinstalling numpy.
- If you have already done that, then:
  1. Check that you expected to use Python3.7 from "C:\Users\MyUserName\.conda\envs\EnvName\pythonw.exe",
     and that you have no directories in your PATH or PYTHONPATH that can
     interfere with the Python and numpy version "1.17.5" you're trying to use.
  2. If (1) looks fine, you can open a new issue at
     https://github.com/numpy/numpy/issues.  Please include details on:
     - how you installed Python
     - how you installed numpy
     - your operating system
     - whether or not you have multiple versions of Python installed
     - if you built from source, your compiler versions and ideally a build log

- If you're working with a numpy git repository, try `git clean -xdf`
  (removes all files not under version control) and rebuild numpy.

Note: this error has many possible causes, so please don't comment on
an existing issue about this - open a new one instead.

Original error was: DLL load failed: The specified module could not be found.

Installation von numpy

Die Installation erfolgte über anaconda auf win10:

conda create --name EnvName python=3.7 python-pdal geopandas --channel conda-forge  
conda activate MyEnv
conda install spyder-kernels

Der Befehl conda list zeigt für numpy Folgendes an:
numpy 1.17.5 py37hc71023c_0 conda-forge

Andere Information

  • Windows 10 Version 1803 (OS Build 17134.706)
  • Die Neuinstallation von numpy über conda install --force-reinstall numpy=1.17.5 löst das Problem nicht.
  • Beachten Sie, dass conda install numpy ein Update auf 1.18.1 bereitstellen würde, dies jedoch zu anderen Importfehlern für Geopandas führt (diese Fehler erwähnen jedoch nicht direkt numpy).
32 - Installation 33 - Question

Alle 5 Kommentare

Ausgehend von einer Neuinstallation von ananconda3_2019_10 64-Bit unter Windows 10 funktionieren die von Ihnen eingefügten Befehle für mich einwandfrei. Ich bekomme auch die gleiche Anzahl, aber ich kann problemlos Numpy und Pandas importieren.

> conda list | find "numpy"
numpy                     1.17.5           py37hc71023c_0    conda-forge

Beachten Sie, dass conda / anaconda MKL, xref gh-15343, gh-14888 und einige andere verwenden

Ich habe einige weitere Tests durchgeführt. Ich habe alle vorhandenen Umgebungen auf dem Computer entfernt. Ich erinnere mich leider nicht, ob ich ein conda update conda oder nicht.
Ich habe dann eine neue Umgebung erstellt über:
conda create --name pdal3 --channel conda-forge python=3.7 spyder-kernels python-pdal geopandas
Beachten Sie, dass dieser Befehl nicht mit dem im ursprünglichen Beitrag identisch ist (Reihenfolge der Argumente und sofort integrierte Spyder-Kernel).
Ich habe folgendes Ergebnis erhalten:

  1. Fehler in der Konsole von Spyder: siehe Spyder Github . Dies scheint jedoch ein Spyder-Problem zu sein.
  2. Wenn ich mein Programm direkt von der Konsole aus starte, funktioniert es.

So kann ich meine Arbeit vorerst fortsetzen, aber keinen Einblick geben, wie ich das Problem gelöst habe.

Dies war ein Problem in Spyder, das dadurch verursacht wurde, dass wir die conda env, in der unser Kernel lebt, nicht aktiviert haben, bevor wir sie gestartet haben. Es wurde in unserer Version 4.1.0 behoben, sodass dieses Problem geschlossen werden kann.

@ ccordoba12 Danke für das Update.

Ich kann bestätigen, dass das Problem nicht mehr vorliegt. Vielen Dank an die Numpy- und Spyder-Community für die dafür aufgewendete Zeit.

War diese Seite hilfreich?
0 / 5 - 0 Bewertungen