question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Importing the numpy c-extensions failed - remote machine

See original GitHub issue

Problem Description

  • I did the development on my current machine using an conda environment and it works fine!
  • I copied the whole env folder over to a UNC drive and then the git repo folder.
  • I tried to run it from the remote UNC drive env from my computer and it works fine!
  • I asked another user to try the same thing and they get the Importing the numpy c-extensions failed error.
  • I recreated my working environment as follows: Dev machine: conda list --explicit > webdev.txt Target machine: conda create --prefix "\path\to\unc-drive-folder\webdev" --file webdev.txt
  • I tried to run it from the UNC drive env from my computer and it works fine!
  • I asked the user to try the same thing again and they still get Importing the numpy c-extensions failed error.

The user and I are using the same environment and accessing it from the same network drive so how does it run for me but not for the other user?

Reproducing code example:

import numpy as np

Error message:

Traceback (most recent call last): File “run.py”, line 15, in <module>

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.8 from “X:\XXX\webdev\python.exe”, and that you have no directories in your PATH or PYTHONPATH that can interfere with the Python and numpy version “1.18.1” 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 while importing _multiarray_umath: The specified module could not be found.

Numpy/Python version information:

1.18.1 3.8.2 | packaged by conda-forge | (default, Mar 23 2020, 17:32:17) [MSC v.1916 64 bit (AMD64)]

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
sebergcommented, Apr 1, 2020

@TheEverlastingBish cool, can you post if you have a solution? That way you may help others who find it here. Also close it once you find one please. Hope you find what is going on quickly!

1reaction
charriscommented, Apr 1, 2020

A common cause of this problem on Conda is a failure to activate the environment. Was that done?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Importing the numpy c-extensions failed - python
I'm using Python 3.8 by Miniconda on Win 10 system. I solved the problem by changing default terminal from PowerShell to Command Prompt....
Read more >
Troubleshooting ImportError — NumPy v1.25.dev0 Manual
Importing the numpy c-extensions failed. This error can happen for different reasons, often due to issues with your setup.
Read more >
Compile NumPy with ifort, MSVC and MKL - DLL load failed
Importing the numpy C -extensions failed. This error can happen for many reasons, often due to issues with your setup or how NumPy...
Read more >
Building, Cython/C Extensions, and Releasing
This function allows for the creation of shims that allow a subpackage to be imported under another name. For example, astropy.io.fits used to...
Read more >
Debugging Python C extensions with GDB - Red Hat Developer
Another issue was that C extensions were linked to libpython. When a C extension was built in release mode and imported into a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found