python - 如何使用Pynsist在python中安装numpy

标签 python numpy opencv nsis pynsist

如果我使用Pynsist软件包构建了一个应用程序,然后在安装了该应用程序之后,我将在应用程序路径的pkg文件夹中拥有一个numpy软件包,就像我在installer.cfg中提到的那样。
但是Python 2.7的站点包中不会有任何numpy(之所以安装,是因为NSIS内置应用下载了python安装程序。

那么,python如何知道计算机中是否存在numpy?
换句话说,应用程序文件夹中的numpy包如何将自身链接到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了。

关于python - 如何使用Pynsist在python中安装numpy,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50776779/

相关文章:

python - Linux/庆典 : Sourcing a script and then assigning it to a variable

Python - 从 numpy 数组分布计算 pdf

python - Numpy:将方矩阵的索引转换为其上三角索引的有效方法

python - 如何更新 h5py 中的数组?

python - 如何将日期从日-月-年重新格式化为年-月-日?

python - 按多个单词的标签拆分的术语

c++ - 连接 OpenCV Mat 和单个值

delphi - Delphi-OpenCV高斯模糊?

opencv - 如何用反射光分割图像

c# - 在 aspx 页面中显示 python 的输出