如何使用 Pynsist 在 python 中安装 numpy
How to install numpy in python with Pynsist
如果我使用 Pynsist 包构建了一个应用程序,然后在安装该应用程序之后,我将在应用程序路径的 pkg 文件夹中有一个 numpy 包,就像我在 installer.cfg
中提到的那样。
但是 Python 2.7 的站点包中不会有任何 numpy(安装是因为 python 安装程序由 NSIS 构建的应用程序下载。
那么python怎么知道电脑里有没有numpy呢?
换句话说,应用程序文件夹中的numpy包如何将 link 本身添加到 Python lib/site-package 文件夹中?我们需要将该文件夹复制到站点包位置还是我遗漏了什么?
下面是installer.cfg代码
[Application]
name=FaceLock
version=1.0
# How to launch the app - this calls the 'main' function from the 'myapp' package:
entry_point=openApplication:self
[Python]
version=2.7.14
[Include]
# Packages from PyPI that your application requires, one per line
# These must have wheels on PyPI:
pypi_wheels=opencv-contrib-python==3.4.1.15
numpy==1.14.0
# To bundle packages which don't publish wheels, see the docs on the
# config file.
packages=cv2
PIL
Tkinter
glob
# Other files and folders that should be installed
files=detector.py
dataSetGenerator.py
trainData.py
storeDictionary.py
CheckFace.py
CheckFace.py
Classifiers/
trainer/
Trying/
在这里,为了让应用程序知道还必须导入 numpy,我们在 installer.cfg 文件中添加一个依赖项。依赖是:anaconda-project。
现在可以正常导入numpy了
如果我使用 Pynsist 包构建了一个应用程序,然后在安装该应用程序之后,我将在应用程序路径的 pkg 文件夹中有一个 numpy 包,就像我在 installer.cfg
中提到的那样。
但是 Python 2.7 的站点包中不会有任何 numpy(安装是因为 python 安装程序由 NSIS 构建的应用程序下载。
那么python怎么知道电脑里有没有numpy呢? 换句话说,应用程序文件夹中的numpy包如何将 link 本身添加到 Python lib/site-package 文件夹中?我们需要将该文件夹复制到站点包位置还是我遗漏了什么?
下面是installer.cfg代码
[Application]
name=FaceLock
version=1.0
# How to launch the app - this calls the 'main' function from the 'myapp' package:
entry_point=openApplication:self
[Python]
version=2.7.14
[Include]
# Packages from PyPI that your application requires, one per line
# These must have wheels on PyPI:
pypi_wheels=opencv-contrib-python==3.4.1.15
numpy==1.14.0
# To bundle packages which don't publish wheels, see the docs on the
# config file.
packages=cv2
PIL
Tkinter
glob
# Other files and folders that should be installed
files=detector.py
dataSetGenerator.py
trainData.py
storeDictionary.py
CheckFace.py
CheckFace.py
Classifiers/
trainer/
Trying/
在这里,为了让应用程序知道还必须导入 numpy,我们在 installer.cfg 文件中添加一个依赖项。依赖是:anaconda-project。 现在可以正常导入numpy了