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 - remote machine #15892

Closed
TheEverlastingBish opened this issue Apr 1, 2020 · 6 comments
Closed

Importing the numpy c-extensions failed - remote machine #15892

TheEverlastingBish opened this issue Apr 1, 2020 · 6 comments
Labels
31 - Third-party binaries Install/import issues other than Anaconda-specific 33 - Question Question about NumPy usage or development

Comments

@TheEverlastingBish
Copy link

TheEverlastingBish commented Apr 1, 2020

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

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)]

@seberg seberg added 33 - Question Question about NumPy usage or development 31 - Third-party binaries Install/import issues other than Anaconda-specific labels Apr 1, 2020
@charris
Copy link
Member

charris commented Apr 1, 2020

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

@seberg
Copy link
Member

seberg commented Apr 1, 2020

I cannot help you, my best guess is that the operating system is refusing to load libraries from the remote drive, or that you are actually not using the same machine (python version, compatible binaries). To be clear, someone here may happen to know whats going on and give you a tip, but it is extremely unlikely that this is specific to NumPy.

Or easier what Chuck said :).

@TheEverlastingBish
Copy link
Author

Ok, thanks guys.
I think I may have to install miniconda on the user's machine and then create the environment and try to run the app from there.

@seberg
Copy link
Member

seberg commented 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!

@TheEverlastingBish
Copy link
Author

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

This is interesting though. I also have an installation on another computer and that has Anaconda installed on it. There, when I run a batch file like so:

"C:\anaconda\envs\analytics\python.exe" "C:\PySpace\PRODUCTION\Projects\jingle-bells\src\main.py"

... it runs fine without any activate command per se.

So it looks to me somehow, you can't run a env+package from a computer that does not have conda installed.

@TheEverlastingBish
Copy link
Author

Not truly a numpy-specific issue. This is an environment / OS-based issue. Only solution is to install the correct package manager and/or environment on target machine separately and then run the program.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
31 - Third-party binaries Install/import issues other than Anaconda-specific 33 - Question Question about NumPy usage or development
Projects
None yet
Development

No branches or pull requests

3 participants