- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
<分区>
我的 Python 代码涉及 xgboost
库,我现在尝试使用 pyinstaller
制作 exe。环境是:
68 INFO: PyInstaller: 4.0.dev0+8196c57ab
69 INFO: Python: 3.6.9 (conda)
70 INFO: Platform: Windows-10-10.0.17763-SP0
我已经测试过在此环境中从命令行运行 .py。
我在环境中找到相关文件:dll
、VERSION
和文件夹,并手动添加它们:(在this 之后)(我将命令分解为新行以提高可读性)
(py36_PP) C:\Users\MarkZ\G_project\Model>pyinstaller PPP_2_main.py -F
--add-data "C:\Users\MarkZ\AppData\Local\Continuum\anaconda3\envs\py36_PP\Lib\site-packages\xgboost\*;xgboost/"
--add-data "C:\Users\MarkZ\AppData\Local\Continuum\anaconda3\envs\py36_PP\Lib\site-packages\xgboost\VERSION;xgboost/"
--add-data "C:\Users\MarkZ\AppData\Local\Continuum\anaconda3\envs\py36_PP\Library\mingw-w64\bin\xgboost.dll;xgboost/"
我是如何找到这些路径的:
在python中导入这个库并查看它的属性
(py36_PP) C:\Users\MarkZ\GRS-PP-churn-project\Model>python
Python 3.6.9 |Anaconda, Inc.| (default, Jul 30 2019, 14:00:49) [MSC v.1915 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import xgboost
>>> print(xgboost.__file__)
C:\Users\MarkZ\AppData\Local\Continuum\anaconda3\envs\py36_PP\lib\site-packages\xgboost\__init__.py
搜索:
(base) C:\Users\MarkZ\AppData\Local\Continuum\anaconda3>dir /s *xgboost*
Volume in drive C is OSDisk
Volume Serial Number is F0FE-4464
Directory of C:\Users\MarkZ\AppData\Local\Continuum\anaconda3\conda-meta
09/16/2019 01:58 PM 11,072 libxgboost-0.90-0.json
09/16/2019 01:58 PM 11,048 py-xgboost-0.90-py37_0.json
09/16/2019 01:58 PM 1,134 _py-xgboost-mutex-2.0-cpu_0.json
3 File(s) 23,254 bytes
Directory of C:\Users\MarkZ\AppData\Local\Continuum\anaconda3\envs\py36_PP\conda-meta
09/27/2019 01:45 AM 11,022 libxgboost-0.90-0.json
09/27/2019 01:45 AM 10,998 py-xgboost-0.90-py36_0.json
09/27/2019 01:45 AM 1,084 _py-xgboost-mutex-2.0-cpu_0.json
3 File(s) 23,104 bytes
Directory of C:\Users\MarkZ\AppData\Local\Continuum\anaconda3\envs\py36_PP\Lib\site-packages
09/27/2019 01:45 AM <DIR> xgboost
0 File(s) 0 bytes
Directory of C:\Users\MarkZ\AppData\Local\Continuum\anaconda3\envs\py36_PP\Library\mingw-w64\bin
06/07/2019 02:23 PM 4,128,032 xgboost.dll
06/07/2019 02:23 PM 4,218,018 xgboost.exe
2 File(s) 8,346,050 bytes
Directory of C:\Users\MarkZ\AppData\Local\Continuum\anaconda3\envs\py36_PP\Library\mingw-w64\include
09/27/2019 01:45 AM <DIR> xgboost
0 File(s) 0 bytes
Directory of C:\Users\MarkZ\AppData\Local\Continuum\anaconda3\envs\py36_PP\Library\mingw-w64\lib
06/07/2019 02:23 PM 7,035,268 libxgboost.a
1 File(s) 7,035,268 bytes
Directory of C:\Users\MarkZ\AppData\Local\Continuum\anaconda3\Lib\site-packages
09/16/2019 01:58 PM <DIR> xgboost
0 File(s) 0 bytes
Directory of C:\Users\MarkZ\AppData\Local\Continuum\anaconda3\Library\mingw-w64\bin
06/07/2019 02:23 PM 4,128,032 xgboost.dll
06/07/2019 02:23 PM 4,218,018 xgboost.exe
2 File(s) 8,346,050 bytes
Directory of C:\Users\MarkZ\AppData\Local\Continuum\anaconda3\Library\mingw-w64\include
09/16/2019 01:58 PM <DIR> xgboost
0 File(s) 0 bytes
Directory of C:\Users\MarkZ\AppData\Local\Continuum\anaconda3\Library\mingw-w64\lib
06/07/2019 02:23 PM 7,035,268 libxgboost.a
1 File(s) 7,035,268 bytes
Directory of C:\Users\MarkZ\AppData\Local\Continuum\anaconda3\pkgs
09/27/2019 01:45 AM <DIR> libxgboost-0.90-0
09/16/2019 01:58 PM 1,913,797 libxgboost-0.90-0.conda
09/27/2019 01:45 AM 4,050,208 libxgboost-0.90-0.tar.bz2
09/27/2019 01:45 AM <DIR> py-xgboost-0.90-py36_0
09/27/2019 01:45 AM 78,382 py-xgboost-0.90-py36_0.tar.bz2
09/16/2019 01:58 PM <DIR> py-xgboost-0.90-py37_0
09/16/2019 01:58 PM 76,618 py-xgboost-0.90-py37_0.conda
09/27/2019 01:45 AM <DIR> _py-xgboost-mutex-2.0-cpu_0
09/16/2019 01:58 PM 9,208 _py-xgboost-mutex-2.0-cpu_0.conda
09/27/2019 01:45 AM 9,140 _py-xgboost-mutex-2.0-cpu_0.tar.bz2
6 File(s) 6,137,353 bytes
Directory of C:\Users\MarkZ\AppData\Local\Continuum\anaconda3\pkgs\libxgboost-0.90-0\info\recipe
05/28/2019 11:57 AM 959 install-libxgboost.sh
1 File(s) 959 bytes
Directory of C:\Users\MarkZ\AppData\Local\Continuum\anaconda3\pkgs\libxgboost-0.90-0\info\recipe\parent
06/06/2019 04:41 PM 2,814 0001-conda-Unbundle-libxgboost.-dll-dylib-so.patch
05/28/2019 11:57 AM 959 install-libxgboost.sh
05/28/2019 11:57 AM 159 install-py-xgboost.sh
06/07/2019 02:06 PM 292 install-r-xgboost.sh
05/28/2019 11:57 AM 736 test-py-xgboost.py
05/28/2019 11:57 AM 1,601 test-r-xgboost.r
6 File(s) 6,561 bytes
Directory of C:\Users\MarkZ\AppData\Local\Continuum\anaconda3\pkgs\libxgboost-0.90-0\Library\mingw-w64\bin
06/07/2019 02:23 PM 4,128,032 xgboost.dll
06/07/2019 02:23 PM 4,218,018 xgboost.exe
2 File(s) 8,346,050 bytes
Directory of C:\Users\MarkZ\AppData\Local\Continuum\anaconda3\pkgs\libxgboost-0.90-0\Library\mingw-w64\include
09/27/2019 01:45 AM <DIR> xgboost
0 File(s) 0 bytes
Directory of C:\Users\MarkZ\AppData\Local\Continuum\anaconda3\pkgs\libxgboost-0.90-0\Library\mingw-w64\lib
06/07/2019 02:23 PM 7,035,268 libxgboost.a
1 File(s) 7,035,268 bytes
Directory of C:\Users\MarkZ\AppData\Local\Continuum\anaconda3\pkgs\py-xgboost-0.90-py36_0\info\recipe
05/28/2019 11:57 AM 159 install-py-xgboost.sh
1 File(s) 159 bytes
Directory of C:\Users\MarkZ\AppData\Local\Continuum\anaconda3\pkgs\py-xgboost-0.90-py36_0\info\recipe\parent
06/06/2019 04:41 PM 2,814 0001-conda-Unbundle-libxgboost.-dll-dylib-so.patch
05/28/2019 11:57 AM 959 install-libxgboost.sh
05/28/2019 11:57 AM 159 install-py-xgboost.sh
06/07/2019 02:06 PM 292 install-r-xgboost.sh
05/28/2019 11:57 AM 736 test-py-xgboost.py
05/28/2019 11:57 AM 1,601 test-r-xgboost.r
6 File(s) 6,561 bytes
Directory of C:\Users\MarkZ\AppData\Local\Continuum\anaconda3\pkgs\py-xgboost-0.90-py36_0\Lib\site-packages
09/27/2019 01:45 AM <DIR> xgboost
0 File(s) 0 bytes
Directory of C:\Users\MarkZ\AppData\Local\Continuum\anaconda3\pkgs\py-xgboost-0.90-py37_0\info\recipe
05/28/2019 11:57 AM 159 install-py-xgboost.sh
1 File(s) 159 bytes
Directory of C:\Users\MarkZ\AppData\Local\Continuum\anaconda3\pkgs\py-xgboost-0.90-py37_0\info\recipe\parent
06/06/2019 04:41 PM 2,814 0001-conda-Unbundle-libxgboost.-dll-dylib-so.patch
05/28/2019 11:57 AM 959 install-libxgboost.sh
05/28/2019 11:57 AM 159 install-py-xgboost.sh
06/07/2019 02:06 PM 292 install-r-xgboost.sh
05/28/2019 11:57 AM 736 test-py-xgboost.py
05/28/2019 11:57 AM 1,601 test-r-xgboost.r
6 File(s) 6,561 bytes
Directory of C:\Users\MarkZ\AppData\Local\Continuum\anaconda3\pkgs\py-xgboost-0.90-py37_0\Lib\site-packages
09/16/2019 01:58 PM <DIR> xgboost
0 File(s) 0 bytes
Directory of C:\Users\MarkZ\AppData\Local\Continuum\anaconda3\pkgs\_py-xgboost-mutex-2.0-cpu_0\info\recipe\parent
06/28/2018 06:15 PM 2,500 0001-conda-Unbundle-libxgboost.-dll-dylib-so.patch
06/28/2018 06:15 PM 959 install-libxgboost.sh
06/28/2018 06:15 PM 159 install-py-xgboost.sh
06/28/2018 06:15 PM 521 install-r-xgboost.sh
06/28/2018 06:15 PM 736 test-py-xgboost.py
06/28/2018 06:15 PM 1,601 test-r-xgboost.r
6 File(s) 6,476 bytes
Total Files Listed:
48 File(s) 52,355,101 bytes
11 Dir(s) 34,365,415,424 bytes free
它仍然无法加载 xgboost:
(py36_PP) C:\Users\MarkZ\G_project\Model>dist\PPP_2_main
Traceback (most recent call last):
File "PPP_2_main.py", line 28, in <module>
import xgboost as xgb
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "c:\users\MarkZ\appdata\local\continuum\anaconda3\envs\py36_pp\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 621, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\xgboost\__init__.py", line 11, in <module>
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "c:\users\MarkZ\appdata\local\continuum\anaconda3\envs\py36_pp\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 621, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\xgboost\core.py", line 161, in <module>
File "site-packages\xgboost\core.py", line 123, in _load_lib
File "site-packages\xgboost\libpath.py", line 52, in find_lib_path
xgboost.libpath.XGBoostLibraryNotFound: Cannot find XGBoost Library in the candidate path, did you install compilers and run build.sh in root path?
List of candidates:
C:\Users\MarkZ\AppData\Local\Temp\_MEI234002\Library\mingw-w64\bin\xgboost.dll
C:\Users\MarkZ\AppData\Local\Temp\_MEI234002\xgboost\../../windows/x64/Release/xgboost.dll
C:\Users\MarkZ\AppData\Local\Temp\_MEI234002\xgboost\./windows/x64/Release/xgboost.dll
[18264] Failed to execute script PPP_2_main
看起来 pyinstaller
找不到 xgboost
- 我应该添加到 VERSION
文件或 dll
的路径吗?
我通过 spring ioc 编写了一些 Rest 应用程序。但我无法解决这个问题。这是我的异常(exception): org.springframework.beans.factory.BeanC
我对 TestNG、Spring 框架等完全陌生,我正在尝试使用注释 @Value通过 @Configuration 访问配置文件注释。 我在这里想要实现的目标是让控制台从配置文件中写出“hi”,通过
为此工作了几个小时。我完全被难住了。 这是 CS113 的实验室。 如果用户在程序(二进制计算器)结束时选择继续,我们需要使用 goto 语句来到达程序的顶部。 但是,我们还需要释放所有分配的内存。
我正在尝试使用 ffmpeg 库构建一个小的 C 程序。但是我什至无法使用 avformat_open_input() 打开音频文件设置检查错误代码的函数后,我得到以下输出: Error code:
使用 Spring Initializer 创建一个简单的 Spring boot。我只在可用选项下选择 DevTools。 创建项目后,无需对其进行任何更改,即可正常运行程序。 现在,当我尝试在项目
所以我只是在 Mac OS X 中通过 brew 安装了 qt。但是它无法链接它。当我尝试运行 brew link qt 或 brew link --overwrite qt 我得到以下信息: ton
我在提交和 pull 时遇到了问题:在提交的 IDE 中,我看到: warning not all local changes may be shown due to an error: unable
我跑 man gcc | grep "-L" 我明白了 Usage: grep [OPTION]... PATTERN [FILE]... Try `grep --help' for more inf
我有一段代码,旨在接收任何 URL 并将其从网络上撕下来。到目前为止,它运行良好,直到有人给了它这个 URL: http://www.aspensurgical.com/static/images/a
在过去的 5 个小时里,我一直在尝试在我的服务器上设置 WireGuard,但在完成所有设置后,我无法 ping IP 或解析域。 下面是服务器配置 [Interface] Address = 10.
我正在尝试在 GitLab 中 fork 我的一个私有(private)项目,但是当我按下 fork 按钮时,我会收到以下信息: No available namespaces to fork the
我这里遇到了一些问题。我是 node.js 和 Rest API 的新手,但我正在尝试自学。我制作了 REST API,使用 MongoDB 与我的数据库进行通信,我使用 Postman 来测试我的路
下面的代码在控制台中给出以下消息: Uncaught DOMException: Failed to execute 'appendChild' on 'Node': The new child el
我正在尝试调用一个新端点来显示数据,我意识到在上一组有效的数据中,它在数据周围用一对额外的“[]”括号进行控制台,我认为这就是问题是,而新端点不会以我使用数据的方式产生它! 这是 NgFor 失败的原
我正在尝试将我的 Symfony2 应用程序部署到我的 Azure Web 应用程序,但遇到了一些麻烦。 推送到远程时,我在终端中收到以下消息 remote: Updating branch 'mas
Minikube已启动并正在运行,没有任何错误,但是我无法 curl IP。我在这里遵循:https://docs.traefik.io/user-guide/kubernetes/,似乎没有提到关闭
每当我尝试docker组成任何项目时,都会出现以下错误。 我尝试过有和没有sudo 我在这台机器上只有这个问题。我可以在Mac和Amazon WorkSpace上运行相同的容器。 (myslabs)
我正在尝试 pip install stanza 并收到此消息: ERROR: No matching distribution found for torch>=1.3.0 (from stanza
DNS 解析看起来不错,但我无法 ping 我的服务。可能是什么原因? 来自集群中的另一个 Pod: $ ping backend PING backend.default.svc.cluster.l
我正在使用Hibernate 4 + Spring MVC 4当我开始 Apache Tomcat Server 8我收到此错误: Error creating bean with name 'wel
我是一名优秀的程序员,十分优秀!