パンダをインポートすると、次のエラーが表示されます。
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.
インストールはwin10でanacondaを介して行われました。
conda create --name EnvName python=3.7 python-pdal geopandas --channel conda-forge
conda activate MyEnv
conda install spyder-kernels
conda list
コマンドはnumpyに対して表示されます:
numpy 1.17.5 py37hc71023c_0 conda-forge
conda install --force-reinstall numpy=1.17.5
を介してnumpyを再インストールしても、問題は解決しません。conda install numpy
は1.18.1へのアップデートを提供しますが、これはジオパンダの他のインポートエラーにつながることに注意してください(ただし、これらのエラーは直接numpyに言及していません)。Windows10へのananconda3_2019_1064ビットのクリーンインストールから始めて、貼り付けたコマンドは問題なく機能します。 私も同じnumpyを取得しますが、numpyとpandasを問題なくインポートできます。
> conda list | find "numpy"
numpy 1.17.5 py37hc71023c_0 conda-forge
conda / anacondaはMKL、外部参照gh-15343、gh-14888などを使用することに注意してください
さらにテストを行いました。 マシン上の既存の環境をすべて削除しました。 残念ながら、 conda update conda
をしたかどうかは覚えていません。
次に、次の方法で新しい環境を作成しました。
conda create --name pdal3 --channel conda-forge python=3.7 spyder-kernels python-pdal geopandas
このコマンドは元の投稿のコマンドと同じではないことに注意してください(引数の順序、およびスパイダーカーネルはすぐに統合されます)。
次の結果が得られました。
そのため、当面は作業を続けることはできますが、問題をどのように解決したかについての洞察は得られません。
これは、カーネルを起動する前にカーネルが存在するcondaenvをアクティブ化しないことが原因で発生したSpyderの問題でした。 4.1.0バージョンで修正されたため、この問題を解決できます。
@ ccordoba12更新していただきありがとうございます。
問題が発生していないことを確認できます。 numpyとspyderの両方のコミュニティに時間を割いてくれてありがとう。