Python-Pyinstaller exe文件不起作用:无法导入所需的依赖项numpy

时间:2020-01-02 21:48:49

标签: python pandas numpy pyinstaller

我创建了一个python脚本来在线抓取数据。
我使用的模块是

import requests
from bs4 import BeautifulSoup
import pandas   
import datetime
import xlsxwriter

由pyinstaller生成exe文件后,我的程序无法正常运行以获取数据。 我觉得熊猫有问题。
我按照错误消息中的指示卸载并重新安装了pandas和numpy。 我当前的熊猫是0.25.1,numpy是1.18.0。我使用VS代码中的终端获取exe文件,并且在我的PC中安装了Anaconda。

下面是错误消息:

错误消息

This programme was build by WL.
Would you like to get the price of the property on sale within 1 miles radius around Buckingham Palace?
Please Enter Y or y to get the file: y
Traceback (most recent call last):
  File "RightmoveScraping.py", line 16, in <module>
  File "c:\users\tat\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\loader\pyimod03_imporers.py", line 621, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\pandas\__init__.py", line 16, 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 "C:\Users\tat\Desktop\Python\dist\RightmoveScraping.exe",
    and that you have no directories in your PATH or PYTHONPATH that can interfere with the Python and numpy version "1.8.0" 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` (remove 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.

[1664] Failed to execute scriot RightmoveScraping

0 个答案:

没有答案