Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing the numpy c-extensions failed. #15447

Closed
Rabijns opened this issue Jan 27, 2020 · 6 comments
Closed

Importing the numpy c-extensions failed. #15447

Rabijns opened this issue Jan 27, 2020 · 6 comments
Labels
32 - Installation Problems installing or compiling NumPy 33 - Question Question about NumPy usage or development

Comments

@Rabijns
Copy link

Rabijns commented Jan 27, 2020

Issue

when importing pandas, the following error appears:


  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 of numpy

Installation was done via anaconda on win10:

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

The conda list command shows for numpy:
numpy 1.17.5 py37hc71023c_0 conda-forge

Other info

  • windows 10 Version 1803 (OS Build 17134.706)
  • reinstalling numpy via conda install --force-reinstall numpy=1.17.5 does not solve the issue.
  • note that conda install numpy would provide an update to 1.18.1, but this leads to other import errors for geopandas (however, those errors do not directly mention numpy).
@seberg seberg added 32 - Installation Problems installing or compiling NumPy 33 - Question Question about NumPy usage or development labels Jan 28, 2020
@mattip
Copy link
Member

mattip commented Jan 28, 2020

Starting from a clean install of ananconda3_2019_10 64-bit on windows 10 the commands you pasted work fine for me. I also get the same numpy, but I can import numpy and pandas without a problem.

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

Note that conda/anaconda use MKL, xref gh-15343, gh-14888 and some others

@Rabijns
Copy link
Author

Rabijns commented Feb 16, 2020

I did some further testing. I removed all existing environments on the machine. I do unfortunately not remember if I did a conda update conda or not.
I then created a new environment via:
conda create --name pdal3 --channel conda-forge python=3.7 spyder-kernels python-pdal geopandas
Note that this command is not identical to the one in the original post (order of arguments, and spyder-kernels immediately integrated).
I got the following result:

  1. error in the console of spyder: see spyder github. This however seems to be a spyder issue.
  2. when I launch my program directly from console, it works.

So, I can continue my work for the time being, but not offer any insight in how I solved the issue.

@ccordoba12
Copy link

This was a problem in Spyder caused by us not activating the conda env where our kernel lives before starting it. It was fixed in our 4.1.0 version, so this issue can be closed.

@charris
Copy link
Member

charris commented Mar 21, 2020

@ccordoba12 Thanks for the update.

@charris charris closed this as completed Mar 21, 2020
@Rabijns
Copy link
Author

Rabijns commented Mar 28, 2020

I can confirm that the issue is no longer present. Thanks to both the numpy and spyder community for the time spent on it.

@prakashgupta04
Copy link

I get the same issue with airflow 1.10 while using koalas 1.30, Any reason for it, because it works fine in my local environment both in linux and mac os

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
32 - Installation Problems installing or compiling NumPy 33 - Question Question about NumPy usage or development
Projects
None yet
Development

No branches or pull requests

6 participants