简体   繁体   中英

How to install numpy in python with Pynsist

If i have built an application using Pynsist package and then after the installation of that application, I will have a numpy package in the pkg folder of the application path just like what i mentioned in the installer.cfg . But there wont be any numpy in the site-packages of Python 2.7 (installed because of the python installer downloaded by NSIS built application.

So how would the python know if there is a numpy in the computer or not? In other words, how would the numpy package in the application folder will link itself to Python lib/site-package folder? Do we need to copy that folder into the site-package location or am I missing something?

Below is the installer.cfg code

[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/

Here, to let the application know that numpy has also to be imported, we add a dependency in installer.cfg file. The dependency is: anaconda-project. Now the numpy can be imported properly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM