jett chen
jett chen

Reputation: 1173

ImportError: DLL load failed while importing _multiarray_umath

I use cx_Freeze to freeze python app, it run my PC work well, But when I copy to my friend PC, it run errors?

C:\Users\IPC\Desktop\t\exe.win32-3.8>PLC-Log.exe
Traceback (most recent call last):
  File "D:\python38_x32\lib\site-packages\numpy\core\__init__.py", line 22, in <module>
  File "D:\python38_x32\lib\site-packages\numpy\core\multiarray.py", line 12, in <module>
  File "D:\python38_x32\lib\site-packages\numpy\core\overrides.py", line 7, in <module>
ImportError: DLL load failed while importing _multiarray_umath: 找不到指定的模块。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\python38_x32\lib\site-packages\cx_Freeze\initscripts\__startup__.py", line 104, in run
  File "D:\python38_x32\lib\site-packages\cx_Freeze\initscripts\Console.py", line 15, in run
  File "main.py", line 14, in <module>
  File "D:\python38_x32\lib\site-packages\numpy\__init__.py", line 150, in <module>
  File "D:\python38_x32\lib\site-packages\numpy\core\__init__.py", line 48, in <module>
ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.8 from "C:\Users\IPC\Desktop\t\exe.win32-3.8\PLC-Log.exe"
  * The NumPy version is: "1.21.1"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: DLL load failed while importing _multiarray_umath: 找不到指定的模块。


C:\Users\IPC\Desktop\t\exe.win32-3.8>

Upvotes: 0

Views: 3244

Answers (1)

Zichzheng
Zichzheng

Reputation: 1290

I think the cause is you don't have your python package added to Window's system environment.

If you are using Anaconda. You will want to add the anaconda library bin path to your PATH which is like "C:\Users\username\Anaconda3\Library\bin" . Otherwise, I think from your code block you can add D:\python38_x32\lib\site-packages.

Upvotes: 1

Related Questions