mherrmann / fbs-tutorial

Tutorial for creating Python/Qt GUIs with fbs
https://build-system.fman.io
GNU General Public License v3.0
1.95k stars 161 forks source link

conda env can not find the 'makensis' #56

Closed cuicaihao closed 3 years ago

cuicaihao commented 3 years ago

conda env can not find the 'makensis' to build the installer files.

image Windows Specs:

I used the conda to create an environment for Qt development and you can see all the packages installed in this env.

(base) ➜  ~ conda env list
# conda environments:
#
base                  *  D:\Miniconda3
paddle                   D:\Miniconda3\envs\paddle
qt                       D:\Miniconda3\envs\qt

(base) ➜  ~ conda activate qt
(qt) ➜  ~ conda list
# packages in environment at D:\Miniconda3\envs\qt:
#
# Name                    Version                   Build  Channel
altgraph                  0.17                     pypi_0    pypi
autopep8                  1.5.5              pyh44b312d_0    conda-forge
certifi                   2020.12.5        py36ha15d459_1    conda-forge
fbs                       0.9.0                    pypi_0    pypi
future                    0.18.2                   pypi_0    pypi
macholib                  1.14                     pypi_0    pypi
pefile                    2019.4.18                pypi_0    pypi
pip                       21.0.1             pyhd8ed1ab_0    conda-forge
pycodestyle               2.6.0              pyh9f0ad1d_0    conda-forge
pyinstaller               3.4                      pypi_0    pypi
pyqt5                     5.15.2                   pypi_0    pypi
pyqt5-sip                 12.8.1                   pypi_0    pypi
pyside6                   6.0.1                    pypi_0    pypi
python                    3.6.13          h39d44d4_0_cpython    conda-forge
python_abi                3.6                     1_cp36m    conda-forge
pywin32-ctypes            0.2.0                    pypi_0    pypi
setuptools                49.6.0           py36ha15d459_3    conda-forge
shiboken6                 6.0.1                    pypi_0    pypi
toml                      0.10.2             pyhd8ed1ab_0    conda-forge
vc                        14.2                 hb210afc_3    conda-forge
vs2015_runtime            14.28.29325          h5e1d092_3    conda-forge
wheel                     0.36.2             pyhd3deb0d_0    conda-forge
wincertstore              0.2             py36ha15d459_1006    conda-forge
(qt) ➜  ~

I passed the following commands with in the tutorial:

fbs startproject
fbs run
fbs freeze

but the command

fbs installer

gave me errors as follows.

FileNotFoundError: fbs could not find executable 'makensis'. Please install NSIS and add its installation directory to your PATH environment variable.

I have installed NSIS and added it to my Env PATH. But it looks like the conda env cannot find the path specified on Windows. I looked into one solution addressed by conda: windows-environment-has-not-been-activated. But I can not understand how the proposed solution works.

=================this is not a solution=======================

Thus, I tried to copy the entire NSIS exe files to python env as the following figure shows. Screenshot 2021-02-21 112247 But it leads to another error:

subprocess.CalledProcessError: Command '['makensis', 'Installer.nsi']' returned non-zero exit status 2.

I hope I have proved enough information to repeat this issue. Look forward to seeing any feedback.

By the way, I used the 'conda init PowerShell command when install mininconda. so my default shell is on conda base.

image

cuicaihao commented 3 years ago

After a few more tests + restart the PC, I found a solution with the following commands.

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
Loading personal and system profiles took 1411ms.
(base) ➜  QT conda activate qt
(qt) ➜  QT fbs installer
Created target\HelloWorldSetup.exe.
(qt) ➜  QT cmd
Microsoft Windows [Version 10.0.19042.804]
(c) 2020 Microsoft Corporation. All rights reserved.

D:\Code\QT>fbs installer
Created target\HelloWorldSetup.exe.

image

I think powershell somehow blocked the path command on my pc. When I switched to cmd and run the command, all the NSIS tools are loaded properly.

image