Re: [PyInstaller] Having been run as an .exe, the django admin panel hides models except users and user groups

2020-03-04 Thread 'Chris Barker' via PyInstaller
I'm not very familiar with Django, but I recently did something
similar with PYramid.

The trick *may* be that Django is doing a bunch of its configuration/
discovery dynamically, at run time. That was the case with Pyramid --
essentially is was scanning the code at run time looking for views to
include.

So when PyInstaller ran, it didn't  know that those view files needed to be
included, so at run time, they weren't found.

You may need to either:

change your config so that everything is explicitly imported / included
statically.
or
add the extra modules to PyInstaller (via the spec file) by hand.

Sorry to not be more specific, but maybe this will give you some ideas.

-CHB



On Wed, Mar 4, 2020 at 8:02 AM Shi James <137...@gmail.com> wrote:

> I created the most simple Python/Django project following to the standard
> procedure: virtual environment => startproject, startapp, simple model with
> one Char field. Also I add my model to the admin.py file. Then I ran
> makemigrations, migrate, createsuperuser.
>
> If I run like python manage.py runserver then everything is perfect: I
> can view and edit my model.
>
> But I need to run my program as a single exe-file. For that purpose I use
> PyInstaller with default settings. The exe file is generated with no errors.
>
> And here is the problem: there is no my model at the Admin Panel except
> User and User Groups.
>
> My environment is Python 3.7, Django 2.2, Pyinstaller 3.4, Windows 7.
> Everything is under a virtual environment.
>
> Have anyone run into that problem? Is there any workaround to it?
>
> Thanks in advance.
>
> --
> You received this message because you are subscribed to the Google Groups
> "PyInstaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pyinstaller+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pyinstaller/6a3f4485-1a05-428e-9d25-7f482b534b50%40googlegroups.com
> 
> .
>


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/CALGmxEJ6AjxGDDnTZ5%2BCMmZM7fRFBGMLHOstO0VtNnpqCtba-A%40mail.gmail.com.


Re: [PyInstaller] pyinstaller .app doesn't work on other people's computers unless I do chmod +x

2020-02-25 Thread 'Chris Barker' via PyInstaller
On Mon, Feb 24, 2020 at 1:34 AM JAY JAY  wrote:

> Hopefully a simple question, but I can't run my app once I send it to
> someone else, or upload it and download it to my own computer:
>
> "The application X cannot be opened."
>
> Once I add chmod +x, it works! So, I'm almost there! How do I make this
> possible?
>

that's odd -- PyInstaller should have set that :-(


> Bonus: is there any way to avoid the unidentified developer message, which
> requires you to right-click and select Open on a mac? Thanks!!!
>

That requires "signing" it -- which requires a developer's license from
Apple, and some trickery that I don't really understand. It can be done,
but I don't think it can be done without giving Apple $$ -- not a whole lot
of $$ for someone selling their app, but still...

-CHB



-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/CALGmxEKLBwg39hLKp4P19_xaDQDGqw3pqBz8fTMVUUSiLttygA%40mail.gmail.com.


[PyInstaller] Re: Debugging a Recursion Error

2020-02-01 Thread 'Chris Barker' via PyInstaller
To pick up on my own note:

Turns out I had an unneeded dependency on numpy and scipy. I wanted to
remove that anyway, 'cause those are huge, and when I did, this
recursion issue went away.

But I do sometimes need scipy -- so it would good it could work.

I suspect that PyInstaller could be a little smarter about not getting
caught in deep recursions ...

-CHB











On Tue, Jan 28, 2020 at 9:05 AM Chris Barker  wrote:

> When running pyinstaller, it churns away for a long time, and results in
> an recursion limit exceeded error.
>
> I even cranked up the recursion limit in the spec file (as suggested
> elsewhere in this list) and it took longer, but same error.
>
> I am highly suspicious that this is an infinite recursion.
>
> I've boiled it down to one module -- if I don't import that, it all works
> fine (except for not getting that critical functionality :-( ).
>
> But I can't see anything wrong with that module -- no circular imports,
> for instance.
>
> How can I debug this? I'd like to see where it's getting caught in that
> deep if not infinite recursion.
>
> Alternatively, can I tell pyinstaller to include a module but not scan it
> for imports?
>
> Thanks,
>
> -CHB
>
>
> --
>
> Christopher Barker, Ph.D.
> Oceanographer
>
> Emergency Response Division
> NOAA/NOS/OR(206) 526-6959   voice
> 7600 Sand Point Way NE   (206) 526-6329   fax
> Seattle, WA  98115   (206) 526-6317   main reception
>
> chris.bar...@noaa.gov
>


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/CALGmxEK6xq_4JHT2eYQNK9%2BeB6PC%2B1Zk5KaOFHbsDfVhNGv5Ew%40mail.gmail.com.


[PyInstaller] Debugging a Recursion Error

2020-01-28 Thread 'Chris Barker' via PyInstaller
When running pyinstaller, it churns away for a long time, and results in an
recursion limit exceeded error.

I even cranked up the recursion limit in the spec file (as suggested
elsewhere in this list) and it took longer, but same error.

I am highly suspicious that this is an infinite recursion.

I've boiled it down to one module -- if I don't import that, it all works
fine (except for not getting that critical functionality :-( ).

But I can't see anything wrong with that module -- no circular imports, for
instance.

How can I debug this? I'd like to see where it's getting caught in that
deep if not infinite recursion.

Alternatively, can I tell pyinstaller to include a module but not scan it
for imports?

Thanks,

-CHB


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/CALGmxEKyMWE9bbU0nPNyypVP6Cn83MgOkupO-Ne%3DjRdSqK8HrA%40mail.gmail.com.


Re: [PyInstaller] Re: Pyinstaller: calling another Tkinter restarts the app and doesn't bring up other Toplevel() window.

2020-02-17 Thread 'Chris Barker' via PyInstaller
I think you need to rethink a bit what you are doing here:

You are calling a python program from within a python program? Why? Do you
need two programs running?

If you do have a good reason, then you need to rethink how you are using
PyInstaller (and maybe it's not the right tool).

PyInstaller is designed to make ONE single application out of a pile of
Python code. It sounds like you need two (or more?) applications. In which
case, I think there are ways to make multiple top level programs that share
the same libs, etc. Do a little googling, I can't find it at the moment,
but it is possible, if not well tested.

-CHB






On Mon, Feb 17, 2020 at 12:29 AM JAY JAY  wrote:

> Yeah soo.. I figured out my problem. BONKERS.
>
> Turns out I was using this:
>
> subprocess.call([sys.executable,"file"])
>
> AAAND.. if you run the python script without pyinstaller, sys.executable = 
> the python interpreter. In a bundled pyinstaller app, that's NOT WHAT IT 
> IS!!! It's actually the executable file itself. So, I was inadvertently 
> running the app over and over. I tell you.. that is just nuts. Seriously 
> programmers?
>
> So, I had to figure out another way to execute my py file inside my py 
> script. Easy right? Ok, but I needed an argument.. so exec(open(read()) 
> wouldn't work.. or would it? Apparently this does:
>
> sys.argv = ["file.py"), vArguments]
> exec(open(os.path.join(wd,"tests","errorMessage.py")).read(), globals())
>
> Please note that I also included "globals()" there, because apparently exec 
> won't include any imports unless you do that. WTF? I'm... ambivalent about 
> Python at the moment. What are all these gotchas??
>
>
> On Sunday, 16 February 2020 16:23:18 UTC-6, JAY JAY wrote:
>>
>> I have an app like this
>>
>> Main.py (includes root and Tk.Toplevel()) -- PythonDataProcessing.py --
>> tkinterErrorMessage.py (includes another Tk.Toplevel()).
>>
>> When I run this on my computer via python main.py, the initial toplevel
>> window opens, and any subsequent error message pulls up toplevel windows as
>> expected. When I put it all through Pyinstaller and run the app, instead of
>> a tkinter toplevel error message, I get initial main.py toplevel window,
>> almost like the program is running itself again. WTF?
>>
>> I suspect this has to do with hooks in some way? Has anyone run into
>> something like this? Wtf is going on? Like they say.. NOTHING IS EASY!
>> Thanks for your help!
>>
> --
> You received this message because you are subscribed to the Google Groups
> "PyInstaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pyinstaller+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pyinstaller/4aa122fb-a375-4f52-9a6e-a6507dbe695a%40googlegroups.com
> 
> .
>


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/CALGmxELiuCT1M9T9wwxY7aJ8O3zGHED9POrXD7-bXFJFj9VvRA%40mail.gmail.com.


Re: [PyInstaller] Re: Pyinstaller: calling another Tkinter restarts the app and doesn't bring up other Toplevel() window.

2020-02-18 Thread 'Chris Barker' via PyInstaller
I encourage you to do a little more research into how python works -- in
particular modules and packages - I think you are missing some key points.
A couple comments:

On Tue, Feb 18, 2020 at 12:26 AM JAY JAY  wrote:

> thank you for your message!! the main reason is not having the program be
> an unweildy mess. The user interacts with variables that are used on
> completely different pages, and it's just easier to compile them into
> different scripts rather than one huge file.
>

you absolutely want to structure a larger-than-trivial program in multiple
files -- a python file is a "module", and a "package is a collection of
modules, usually in one dir (with a __init__.py file in it). If you have a
less than trivial application, the functionality should be in multiple
modules, which are imported into the files that need them. There should be
one "top level" script, which is often as simple as something like:

import my_app
my_app.main()


My main problem was that this is the general assumption about python app
> architecture? TK also is built around the idea that there should only be
> one window.
>

no, it's not -- but it is build around teh assumption of one application
running at a time -- you can create any number of windows.


> however I was trying to use the app to spit out tkinter error messages
> whenever there was a user error.
>

you can make error dialogs


> My main problem was not really with pyinstaller but with not using
> Toplevel() as opposed to new instances of tkinter. One of those gotchas.
>

Exactly -- you want ONE Tkinter application...

In a similar way pyinstaller I guess assumes that you'll have one file?
>

not at all -- it assumes that you have one start up script, and then it
will look for anything imported there, and automatically include all of
them.


> Maybe I'm just a newb but I love modularity.
>

good instinct -- yes, you want modularity -- that's why they are called
modules :-)

So, after I figured out I had to add all of these individual files or
> directories via the spec file,
>

you really shouldn't' have to hand manipulate the spec file for anything
"normal"


> I can definitely compile it all under one bundle, which will go different
> places depending on which scripts are activated. Took me a bit but now it's
> more of a package app rather than a single use tool. I like your idea on
> sharing libraries between apps though, I will investigate!!
>

look up how to make a python package -- note that a lot of the docs get
into how to make it available to others via PyPi, which you probably don't
want to do -- but the structure is the same, even if you keep it to
yourself.

This may help you get started:

http://pythonchb.github.io/PythonTopics/where_to_put_your_code.html

In short: you probably want to create a package of all the code you need
for your app. part of that will be a script to start it up.

Then point PyInstaller at that start up script, and presto -- a stand alone
application.

HTH,
-CHB






>
> thank you again for being kind and sharing ur thoughts!
>
> On Mon, Feb 17, 2020, 4:16 PM 'Chris Barker' via PyInstaller <
> pyinstaller@googlegroups.com> wrote:
>
>> I think you need to rethink a bit what you are doing here:
>>
>> You are calling a python program from within a python program? Why? Do
>> you need two programs running?
>>
>> If you do have a good reason, then you need to rethink how you are using
>> PyInstaller (and maybe it's not the right tool).
>>
>> PyInstaller is designed to make ONE single application out of a pile of
>> Python code. It sounds like you need two (or more?) applications. In which
>> case, I think there are ways to make multiple top level programs that share
>> the same libs, etc. Do a little googling, I can't find it at the moment,
>> but it is possible, if not well tested.
>>
>> -CHB
>>
>>
>>
>>
>>
>>
>> On Mon, Feb 17, 2020 at 12:29 AM JAY JAY 
>> wrote:
>>
>>> Yeah soo.. I figured out my problem. BONKERS.
>>>
>>> Turns out I was using this:
>>>
>>> subprocess.call([sys.executable,"file"])
>>>
>>> AAAND.. if you run the python script without pyinstaller, sys.executable = 
>>> the python interpreter. In a bundled pyinstaller app, that's NOT WHAT IT 
>>> IS!!! It's actually the executable file itself. So, I was inadvertently 
>>> running the app over and over. I tell you.. that is just nuts. Seriously 
>>> programmers?
>>>
>>> So, I had to figure out another way to execute my py file inside my py 
>>> script. Easy right? Ok, but I needed an argument.. so exec(open(read()) 
>>> wouldn't work.. or would i

Re: [PyInstaller] pyinstaller + librosa: "Module not found" for EXE, even w/ hidden import?

2020-04-04 Thread 'Chris Barker' via PyInstaller
it seems you've solved your issue, but a note:

My environment/install looks like this:
>   conda create --name myapp python=3.7
>   conda activate myapp
>   conda install -c numba numba  # numba is optional, actually
>   conda install -c conda-forge librosa
>   conda install pyqt pillow pyaudio
>   pip install pyinstaller   # conda's version is 3.5,
> pip's is 3.6
>

conda-forge has 3.6. As a rule, if you want the latest and greatest,
conda-forge is the way to go. I've found it works well to add the
conda-forge channel first in your config, and go from there.

It also works better to always give conda the entire list of dependencies
at once: put them in a requirements file, and pass that to conda. IN your
example, that would be:

conda_requirements.txt:

python=3.7
numba
librosa
pyqt
pillow
pyaudio
pyinstaller

Then you can do:

conda create -n myapp --file conda_requriements.txt

or you can create the env, and do:

conda install --file conda_requriements.txt

If requirements change: either a new one, or an updated version, you still
want to pass them all in at once.

This lets the conda requirements resolvet use all the information to build
an optimal environment, even with only one change.

Better yet, make an environment.yaml file with all the versions pinned, and
use that to build the environment for your pyinstaller build. You are
assured consistency that way.

HTH,

-CHB







>
> my setuptools version is 41.4.0...perhaps a downgrade could help?
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "PyInstaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pyinstaller+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pyinstaller/900beedb-ffa7-4322-9969-3824a37531cd%40googlegroups.com
> 
> .
>


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/CALGmxELHz4HuOFH5Eu5X27j-o7M-tTVss9mUwAALgXTrF_Lq5A%40mail.gmail.com.


Re: [PyInstaller] Re: Is there any way to specify which modules to import?

2020-03-27 Thread 'Chris Barker' via PyInstaller
On Fri, Mar 27, 2020 at 2:13 AM abhishek bhatta 
wrote:

> I looked into that but there are too many packages that needs to be in the
> exclude list.
>

you might take a step back and try to figure out *why* PyInstller thinks
you need all those packages.

Perhaps you can do your imports differently, and get a more compact install.

-CHB





> That is going to be an overhead, is there some way to just point which
> packages to import.
>
> On Friday, March 27, 2020 at 12:50:07 AM UTC+5:30, Amir Rossert wrote:
>>
>> Hi, try to look at —hidden-import and —exclude-module flags
>>
>> https://pythonhosted.org/PyInstaller/usage.html#what-to-bundle-where-to-search
>
> --
> You received this message because you are subscribed to the Google Groups
> "PyInstaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pyinstaller+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pyinstaller/7052d4a3-3cf6-4c12-99bc-ad0cf1b97b34%40googlegroups.com
> 
> .
>


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/CALGmxE%2BKtD5z29pxk2ncf2OLW4g9XAt19iCuM5UF9whmfnpOVQ%40mail.gmail.com.


Re: [PyInstaller] Re: Is there any way to specify which modules to import?

2020-03-29 Thread 'Chris Barker' via PyInstaller
yup -- a lot of this is BIG.

numpy is 23MB on my Mac -- yours seems big -- maybe using MKL?

You may not be using all of numpy, but it's really hard to tease out what
you are really using mostly it doesn't matter: disk space is really cheap
these days. Bandwidth not always, but still, folks are used to big
downloads.

-CHB


On Sun, Mar 29, 2020 at 8:21 AM Eric Fahlgren 
wrote:

> On my system (Win 10 Pro 64,  Py 3.8.1) numpy itself is almost all of that
> and SciPy 1.5x that, again.  Throw in Qt and I'm surprised you're not well
> over 100 meg.  Our installer is over 350 Mb with numpy, scipy, wx and
> vtk...  Just because you don't use something directly doesn't mean it's not
> necessary to resolve dependencies.
>
>  57,630,720  T:/Python38/Lib/site-packages/numpy/
> 109,117,440  T:/Python38/Lib/site-packages/scipy/
>
> On Sat, Mar 28, 2020 at 3:44 AM abhishek bhatta 
> wrote:
>
>> Thanks Eric and Chris,
>>
>> I understand that Pyinstaller is checking and importing the dependencies
>> but there must either be some bug with that part or I am missing something.
>>
>> Here is the full scenario.
>> Here is all the imports I am using in my original code:
>>
>> #>>
>> #Import
>>
>> #>>
>> import sys
>> import time
>> import socket, errno
>> import struct
>> import datetime as dt
>> from PyQt5.QtCore import *
>> from PyQt5.QtGui import *
>> from PyQt5.QtWidgets import *
>> from collections import OrderedDict
>> from functools import reduce
>> from math import *
>> from statistics import mean
>> from threading import Thread, Lock
>> import os
>> import fnmatch
>> import paramiko
>> import shutil
>> import subprocess
>> import win32process
>> import psutil
>> import winreg
>> import numpy as np
>>
>> print("This is a test")
>>
>> #>>
>> #End
>>
>> #>>
>>
>> I saved it with the name "test.py".
>>
>> If I try to compile this into an exe with the following command "*pyinstaller
>> --win-private-assemblies --win-no-prefer-redirects -w -F -n test.exe
>> test.py*"
>> The size of the exe comes up to 61.1 MB
>>
>> Now if I just exclude scipy and execute the following command "*pyinstaller
>> --win-private-assemblies --win-no-prefer-redirects --exclude scipy -w -F -n
>> test.exe test.py*"
>> The size of the exe goes to 52.9 MB
>>
>> *Ques: Why does Pyinstaller consider scipy as a necessary import?*
>>
>>
>>
>> Thanks Steve,
>>
>> I am going to look into the venv setup and only install the necessary
>> packages there to find out about any other issues.
>> Also, pylint is a good way to go as well.
>>
>>
>> Regards,
>> Abhishek Bhatta
>>
>>
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "PyInstaller" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to pyinstaller+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/pyinstaller/551c94ee-d187-47f8-8127-06e4273c3080%40googlegroups.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "PyInstaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pyinstaller+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pyinstaller/CAP2Qz%2BVruN_ekZUOkSpCMOkO_Og6Xw8rFhc6z6286n__%2BzKXMA%40mail.gmail.com
> 
> .
>


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/CALGmxEK-b-rJprJ%2B8jOWj53JG3tUgB0_FzR%2BcVxtn2pO60T6Nw%40mail.gmail.com.


Re: [PyInstaller] Subprocess inherits sys.path from application packed with PyInstaller

2020-05-12 Thread 'Chris Barker' via PyInstaller
On Mon, May 11, 2020 at 1:16 AM Spooky Shadow  wrote:


> I have a tool organizer written in python that opens other apps using
> subprocess.
>

This is going to to come down to the details of how exactly you do that.
I'm a little fuzzy, but the subprocess module allows you to control how
things are set up before you run the command. in this case, you may be
interested in:

"""
If *env* is not None, it must be a mapping that defines the environment
variables for the new process; these are used instead of the default
behavior of inheriting the current process’ environment. It is passed
directly to Popen
.
"""
and maybe the "shell" parameter as well.

If you are simply using "python.exe", then it'll be up to the whatever PATH
is set to find Python.

the trick here is that you are shipping one thing, and then expecting it to
run stuff with "the system Python", but Windows does not HAVE a system
Python, so that may not exist, or be installed in a different way, etc. If
you can count on your users to have installed the cPyton installed in the
degfault way, then you can probably use a full path, somethign like:

C:\\WINDOWS\\SYSTEM32\\python27]python.exe

(not on Windows now, so not exactly sure).

However:

1) maybe you DO want the subprocesses to use your bundled Python? tHat way
you can be assured that it's bundled hwo you want it, with any required
dependencies, etc.

2) your sys.path is pretty odd -- it seems to be using the bundled python,
but it's got a bunch of system stuff on the sys.path -- THAT seems a recipe
for disaster.

HTH,
-CHB












> Those apps can execute scripts written in python. The problem is that when
> I pack organizer with PyInstaller and run it, whenever apps oppened by it
> run python scripts, they use python packed inside of organizer.
>
> Easiest example: I open cmd via organizer and write this:
>
> >pythonPython 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:25:58) [MSC v.1500 
> >64 bit (AMD64)] on win32Type "help", "copyright", "credits" or "license" for 
> >more information.>>> import sys>>> sys.path['', 
> >'C:\\Users\\myuser\\AppData\\Local\\Temp\\_MEI156362\\python27.zip', 
> >'C:\\Python27\\DLLs', 'C:\\Python27\\lib', 'C:\\Python27\\lib\\plat-win', 
> >'C:\\Python27\\lib\\lib-tk', 'C:\\Python27', 
> >'C:\\Python27\\lib\\site-packages', 
> >'C:\\Python27\\lib\\site-packages\\win32', 
> >'C:\\Python27\\lib\\site-packages\\win32\\lib', 
> >'C:\\Python27\\lib\\site-packages\\Pythonwin', 
> >'C:\\Python27\\lib\\site-packages\\wx-3.0-msw']
>
> If I open cmd regulary and do the same the output is like this:
>
> ['', 'C:\\WINDOWS\\SYSTEM32\\python27.zip', 'C:\\Python27\\DLLs', 
> 'C:\\Python27\\lib', 'C:\\Python27\\lib\\plat-win', 
> 'C:\\Python27\\lib\\lib-tk', 'C:\\Python27', 
> 'C:\\Python27\\lib\\site-packages', 
> 'C:\\Python27\\lib\\site-packages\\win32', 
> 'C:\\Python27\\lib\\site-packages\\win32\\lib', 
> 'C:\\Python27\\lib\\site-packages\\Pythonwin', 
> 'C:\\Python27\\lib\\site-packages\\wx-3.0-msw']
>
> How can i make it use the sysytem interpreter when oppened from .exe?
>
> --
> You received this message because you are subscribed to the Google Groups
> "PyInstaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pyinstaller+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pyinstaller/d42c6742-c52e-4286-911d-9521e41aaedc%40googlegroups.com
> 
> .
>


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/CALGmxE%2BGNOWzPBrG1oQmMc3yif%3DimAVrnQC1f3CspHEhRf8%3DMA%40mail.gmail.com.


Re: [PyInstaller] put DLLs, PYDs and modules under a sub-directory?

2020-07-08 Thread 'Chris Barker' via PyInstaller
FWIW, I think this is a great idea -- that dir can get VERY cluttered.

But it may be a challenge, particularly on Windows, as the model for dlls
is to look for them "alongside" the exe they link to.

But maybe adding to PATH, or putting in a link or shortcut for the main.exe
file could work?

-CHB


On Wed, Jul 8, 2020 at 8:04 AM 进陆  wrote:

>
> Currently, the pyinstaller copies many DLLs and PYDs to the `dist\main\`
> directory where `main.exe` lives. So it takes some time for a user to find
> the real application file to launch.
>
> I know pyinstaller can produce a single executable file. But it will be at
> least 40M if wxPython is used.
>
> My question is, how to tell pyinstaller to copy DLLs, PYDs and other
> python modules into a directory, for example `supporting`, so there is only
> 2 files, i.e. `main.exe` and `main.exe.manifest` under the `dist\main\`
> directory?
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "PyInstaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pyinstaller+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pyinstaller/81b5a35e-b240-4e8c-866a-c60fe5e13766o%40googlegroups.com
> 
> .
>


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/CALGmxEJXXcRrpstdo_k6eFV5zu3yYH1i_fctk2zEieUawFeXGA%40mail.gmail.com.


Re: [PyInstaller] Re: numpy using mkl libraries

2020-07-06 Thread 'Chris Barker' via PyInstaller
> *Question*: why the mkl libraries are not properly detected/used during
>>> runtime even if they are included in the executable?
>>>
>>
MKL does some run-time magic to detect the processor and the like, so it
may be linking in an unusual way that PyInstaller can not detect.

Adding it by hand may be the only solution. But it would be good it have a
recipe for this.

-CHB

-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/CALGmxE%2BCEF0nVPFDdn937U%3Dyo2Rfxd2S2FOjQNE055Nm6DEcRg%40mail.gmail.com.


Re: [PyInstaller] Re: Scipy Interpolate module

2020-06-24 Thread 'Chris Barker' via PyInstaller
Just a note:

Anaconda supplies a  complete Python install that is not-very-different
than the one from Python.org. And the PyInstaller that it supplies is the
same as well (modulo the version).

The one way that Anaconda IS different with regard to PyInstaller is that
it supplies compiled C libraries as well, and these may be in different
places. Though usually PyInstaller can find them. Another difference is
that some versions of Anaconda use the Intel MKL math libs, which can be
pretty darn big.

So: most of the differences you are seeing is not due to using Anaconda,
but rather something about configuration and PyInstaller version.

-CHB






On Tue, Jun 23, 2020 at 8:25 AM bwoodsend  wrote:

> As for your larger filesize - that is because of PyInstaller picking up
> optional dependencies and assuming you need them. The story usually goes:
>
>- A library you are using either has as a convenience matplotlib
>visualisation method in it or uses matplotlib somewhere hidden in its test
>suite. (In scipy’s case its scipy/optimize/_shgo_lib/triangulation.py.)
>- Matplotlib optionally supports every GUI library in existence as a
>backend to show it’s graphs with - it only needs one but PyInstaller
>includes all of them (so PyQt5, (deprecated) PyQt4, TKinter, PySide,
>Pyside2) as well as IPython’s inline-plotting support.
>- IPython uses all sorts of stuff so once PyInstaller sees that it
>wants to include more or less your entire conda environment.
>
> You can see this chain of inclusion in build/name/xref-name.html. If
> those modules aren’t installed then they are ignored. This is why you’ll
> see the advise everywhere to use a clean minimal environment for
> PyInstaller. Alternatively you can --exclude them. e.g. --exclude
> matplotlib --exclude PyQt5. Sometimes you can even exclude subpackages
> such as --exclude scipy.integrate. You can test if your script needs a
> package outside of PyInstaller by putting sys.modules["package_name"] =
> None at the top of your script and seeing if it can still run normally.
> If you don't get an import error, it's usually safe to exclude.
>
> I’d like to track down why your plain Python PyInstaller didn’t work -
> could you provide more details on that?
>
> Brénainn
> On Tuesday, June 23, 2020 at 11:50:50 AM UTC+1 its...@gmail.com wrote:
>
>> Thank you very much for your note.
>> I did what you suggested (a very good idea), and it looks as if the scipy
>> packages are there:
>> [image: image]
>>
>> I launched the .exe file, and it completed without an error. Encouraged,
>> I ran again pyinstaller –F scipytest.py, and the resulting executable also
>> works! I have no idea what happened since day before yesterday when it did
>> not work.
>> Sine the Python pyinstaller did not work for me, I resorted to the
>> Anaconda pyinstaller which worked fine. I prefer the Python pyinstaller
>> because it runs much faster (about one minute versus a few minutes in
>> Anaconda) and produces much smaller .exe files (about 100MB, versus ~300MB
>> in Anaconda).
>> I saw indeed warnings in Anaconda documentation against using pip. Since
>> I want to use both Anaconda and Python, I will probably setup two separate
>> machines, one only with Python and the other only with Anaconda.
>>
>> Best,
>> Itsik
>>
>> *From:* bwoodsend
>> *Sent:* Monday, June 22, 2020 1:36 PM
>> *To:* PyInstaller
>> *Subject:* [PyInstaller] Re: Scipy Interpolate module
>>
>> scipy.interpolate is working no problem on my Windows. Scipy is on
>> PyInstaller’s list of packages which may require tight version control. I’m
>> using:
>>
>> python==3.7.7
>> PyInstaller==3.6
>> scipy==1.4.1
>>
>> I also notice your using Anaconda which rearranges your package
>> structures in a way PyInstaller often can’t follow which can lead to
>> files/packages not being found.
>>
>> Can you build in 1-dir mode (the default), navigate inside the dist
>> folder and tell me if the scipy pyd files are in there? They should be
>> under dist\your_program\scipy\interpolate. Chances are they're not but
>> it's a place to start.
>> --
>> You received this message because you are subscribed to the Google Groups
>> "PyInstaller" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to pyinstaller...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/pyinstaller/fdc99e58-97a1-4da1-a19f-1067f76dc768n%40googlegroups.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "PyInstaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pyinstaller+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> 

Re: [PyInstaller] Re: Python/C API project - compile to exe

2020-07-23 Thread 'Chris Barker' via PyInstaller
I don't think you want PyInstaller here. In fact, what you are doing is
simply writing a C++ application, Python, in this case, is being used as a
C library.

So what you need to do is bundle up your app like any C++ app, that is to
say:

* It has to be linked to the Python libs
* It has to have access to the Python standard library
* It has to have access to your Python code

I'm sure it's *possible* to do all of that in a single exe file, but it's
going to be hard.

So I'd plan on making an installer that creates a folder that has your exe
and anything you need in it.

BTW, I think you are making things harder on yourself than you could. As a
rule, it's easier to call C++ from Python than the other way around (via
ctypes, Cython, pybind11 etc.

And there already is wxPython for a wx GUI. As the GUI isn't usually the
performance bottleneck, I'd write that in Python, too :-)

Good luck,

-CHB






On Thu, Jul 23, 2020 at 8:12 AM bwoodsend  wrote:

> Ahh your embedding Python into C++. I’ve never done that so I probably
> can’t help much. I imagine your C++ program needs to be able to find
> python3.dll and all its dependents so it needs to be in either your PATH
> or your current working directory. And it will also need
> PythonApplication1.py to be separated from the PyInstaller exe.
>
> If you PyInstaller PythonApplication1.py, compile your C++ code, then
> copy PythonApplication1.py and cppFile.exe into dist/PythonApplication1/.
> Then launch `cppFile.exe`. Don’t try to use --onefile with PyInstaller
> yet - I can show you how to turn it into a single file after we’ve got it
> working as a bundle first.
> ​
>
> --
> You received this message because you are subscribed to the Google Groups
> "PyInstaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pyinstaller+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pyinstaller/ace71e6b-cb01-4691-8b01-2eb3e6356a4fn%40googlegroups.com
> 
> .
>


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/CALGmxE%2BkV%2B6%2BeTyq1gPFOEN8qn0%2B34EYsDAraWY0EFX8dLWG2Q%40mail.gmail.com.


[PyInstaller] Re: Error with mimetype on OS-X 11 (Big Sur)

2021-12-17 Thread 'Chris Barker' via PyInstaller
Another hint:

I found the default_project.maproom template in:

MapRoom.app/Contents/Resources/maproom/templates

So maybe it's simply a.matter of getting that on the search path somehow.
But how?

Here's the error again:

No document available for {'mime': 'application/x-maproom-project-zip',
'loader': , 'uri': 'template://default_project.maproom'}

so how do I set the root dir for that uri? what is it now? how can I tell?

-CHB



On Thu, Dec 16, 2021 at 11:35 AM Chris Barker  wrote:

> I've just got a new mac with OS-X 11.6 (still Intel).
>
> But when I try to run a PyInstaller built application, I get this error:
>
> No document available for {'mime': 'application/x-maproom-project-zip',
> 'loader':  0x7f9669ce6e10>, 'uri': 'template://default_project.maproom'}
>
> And the app won't start.
>
> This has worked just fine on numerous previous OS-X versions.
>
> I'm not sure what version of PyInstaller was used, but it was built in May
> 2019.
>
> I have the source code, but the developer that built it is no longer with
> us, so it'll take me a bit to get up to speed, and I don't even know where
> to start! Is this a PyInstaller issue? or a code issue, or ???
>
> Hints:
>
> The application is called MapRoom (maproom) it works with "projects" that
> are essentially a zip file with all the info required in it.
>
> I think, on startup, it tries to load an empty default project, presumably
> "default_project.maproom"
>
> So I think that's where the app startup code is barfing, not having the
> mime type registered properly. But where / how am I supposed to do that?
>
> Or maybe it's not a mime type registration issue, but simply that the
> template can't be found -- so a path issue in the App bundle??
>
> Anyway, I'll be digging into this deeper in the source code, but if anyone
> has seen anything like this, any hints would be appreciated!
>
> Thanks,
>
> -CHB
>
>
> --
>
> Christopher Barker, Ph.D.
> Oceanographer
>
> Emergency Response Division
> NOAA/NOS/OR(206) 526-6959   voice
> 7600 Sand Point Way NE   (206) 526-6329   fax
> Seattle, WA  98115   (206) 526-6317   main reception
>
> chris.bar...@noaa.gov
>


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/CALGmxEK31BxL9%3D79NccNVHTTHhsQPcdz9gpN9U52zMcQg2SPog%40mail.gmail.com.


[PyInstaller] Error with mimetype on OS-X 11 (Big Sur)

2021-12-17 Thread 'Chris Barker' via PyInstaller
I've just got a new mac with OS-X 11.6 (still Intel).

But when I try to run a PyInstaller built application, I get this error:

No document available for {'mime': 'application/x-maproom-project-zip',
'loader': , 'uri': 'template://default_project.maproom'}

And the app won't start.

This has worked just fine on numerous previous OS-X versions.

I'm not sure what version of PyInstaller was used, but it was built in May
2019.

I have the source code, but the developer that built it is no longer with
us, so it'll take me a bit to get up to speed, and I don't even know where
to start! Is this a PyInstaller issue? or a code issue, or ???

Hints:

The application is called MapRoom (maproom) it works with "projects" that
are essentially a zip file with all the info required in it.

I think, on startup, it tries to load an empty default project, presumably
"default_project.maproom"

So I think that's where the app startup code is barfing, not having the
mime type registered properly. But where / how am I supposed to do that?

Or maybe it's not a mime type registration issue, but simply that the
template can't be found -- so a path issue in the App bundle??

Anyway, I'll be digging into this deeper in the source code, but if anyone
has seen anything like this, any hints would be appreciated!

Thanks,

-CHB


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/CALGmxEJB14GUJ4icoTAwL6vqE63LVwTOjk5RNHpTVHiv%3DAeCwA%40mail.gmail.com.


Re: [PyInstaller] Re: Application creating second instance of self

2023-09-26 Thread 'Chris Barker' via PyInstaller
On Tue, Sep 26, 2023 at 12:52 AM bwoodsend  wrote:

> That sounds like a red herring. It’s specifically 
> subprocess.run([sys.executable,
> ...]) that we’re interested in — any other command should run fine under
> PyInstaller.
>
indeed -- a search for "sys.executable" may find the culprit.

-CHB

-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/CALGmxEJ7L0MzFa6OKxjopLfDVQurcXeG%2BT%2BQMFFT3rZc%3D25pFQ%40mail.gmail.com.


Re: [PyInstaller] --add-data behavior?

2023-10-06 Thread 'Chris Barker' via PyInstaller
On Thu, Oct 5, 2023 at 8:13 AM bwoodsend  wrote:

> Ughh, I’ve seen that snippet of misinformation before on stackoverflow.
>
To be fair, "putting data files next to the executable" is a long-standing
tradition on Windows from way, way back -- though I don't think it's been
best practice for a very long time :-(

My guideline is that there should ideally never be the need to check the
frozen attribute :-)

-CHB

-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/CALGmxEJVwaTEeYzRYjHdeRVj_27QTCcrj52v9fi4y2hbaK1C%2BA%40mail.gmail.com.


Re: [PyInstaller] Django Pyinstaller

2022-08-31 Thread 'Chris Barker' via PyInstaller
On Tue, Aug 30, 2022 at 1:41 PM Eric Fahlgren 
wrote:

> On the other hand, you can add an (or modify the existing) argument parser
> to supply those defaults in mysite.py's main.  Neither of these requires
> that you do anything to your PyInstaller spec  (and I'm having a hard time
> seeing where you would do this at the PyInstaller phase of deployment).
>

I agree -- the trick is to provide PyInstaller with a startup script that
doesn't require any command line args. I'm not sure what startup script
you're using -- but you can either alter it to have the defaults you want,
or write a little wrapper that provides those defaults, and use that
wrapper as your main script for PyInstaller.

-CHB





>
> On Tue, Aug 30, 2022 at 12:31 AM Pierre  wrote:
>
>> Does anyone have  a .spec file or example of a django implementation of
>> pyinstaller? Currently I have to run:
>>
>> mysite.exe runserver localhost:8000 --noreload
>>
>> Where as I would like to be able to set that as the default behavior if a
>> user clicks the executable. Even better would be to be able to run migrate
>> before runserver. The client that will be receiving the file is not
>> savvy and I would like to simplify the package installation as much as
>> possible.
>>
>> Thank you!
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "PyInstaller" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to pyinstaller+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/pyinstaller/bda92104-09b8-4fb3-ae6f-7c172ddb3caen%40googlegroups.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "PyInstaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pyinstaller+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pyinstaller/CAP2Qz%2BUsHpHhBGAVe35a%2BLwpNB8yLjnXPa3jtpOMkHQ%3DSKkV%3Dg%40mail.gmail.com
> 
> .
>


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/CALGmxE%2B4rfwTCE7Z7Uk3iPDha00oem03JoXJLYzbfhUvLv9gMw%40mail.gmail.com.


Re: [PyInstaller] To convert a django project with multiple apps and pys using pyinstaller

2022-08-26 Thread 'Chris Barker' via PyInstaller
On Wed, Aug 24, 2022 at 11:19 PM Azeez Adeniyi 
wrote:

> Been battling hard with how to use pyinstaller to convert my django
> project to one executable that runs without the console. My project
> consists of apps


Do you have more than one app? that might be a bit tricky -- or might not
-- I think a Django app is essentially a Python package -- so you should be
able to bundle it up with PyInstaller just like any other app.

But Django needs a web server to run behind:

https://docs.djangoproject.com/en/3.2/howto/deployment/

I suggest that you use one of the Python servers, such as gunicorn:

https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/gunicorn/

The you'll need a python start up script that fires up gnuicorn. That start
up script will be the "Application" as far as PyInstaller is concerned.

Then you'll "just" need to make sure PYInstaller bundles up all the code
and data you need to run your app.

-CHB




> with the usual views.py, admin.py etc. I wonder how to bundle all these
> pys into one executable app so that users can just install the application
> and use without installing any dependencies
>
> Thanks in advance
>
> --
> You received this message because you are subscribed to the Google Groups
> "PyInstaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pyinstaller+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pyinstaller/f8d5a20e-5478-4235-bc6a-13bb3642e33an%40googlegroups.com
> 
> .
>


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/CALGmxEJKcH%3DfEgFH_S1JMpnRXntn1w6-NHUOYcX0zrC0_A1WhA%40mail.gmail.com.


Re: [PyInstaller] Running pyinstaller on code containing relative paths

2023-01-31 Thread 'Chris Barker' via PyInstaller
The solution here isn't PyInstaller specific -- it's about Python, paths,
relative paths, adn the current working dir.

A few notes:

Python respects the "current working directory" -- if you start a script
from the comamnd line, the cwd will be teh dir you started it in. If you
start it by point and clicking on a PyInstaller (or any other app), then
it's up to the app builder to make sure it' set to something sensible --
but what that is depends on the app, etc.

when you call open() with a relative path, like:

open("../version.txt")

Then it will look for it relative to the cwd, which is only sometimes what
you want.

Solution: Python has a __file__ dunder for modules, so if you want to find
a file relative to the *current module file", you do that by using file --
( I like pathlib, but that's not necessary )

from pathlib import Path

verfile = open(Path(__file__).parent.parent  / "version.txt")

(untested)

Design note:

I usually only use the above pattern in tests and the like -- in production
code, I would either:

- put your version info in a python file (I usually put it in __init__.py)
- have a place for data files that is configured at program start up, and
may be different depending on how the app is deployed.

But for one simple file, the above is fine, as long as you make sure the
file is copied / installed where it is needed.

HTH,
-CHB





On Sun, Jan 29, 2023 at 4:35 AM 'Jasper Harrison' via PyInstaller <
pyinstaller@googlegroups.com> wrote:

> Anthony,
>
> Our documentation covers how to solve this. Link below.
> https://pyinstaller.org/en/stable/runtime-information.html#using-file
>
> Jasper Harrison, aka Legorooj
> Core Developer on PyInstaller
> https://legorooj.net
>
>
>  Original Message 
> On 28 Jan 2023, 21:53, 'Anthony Nash' via PyInstaller <
> pyinstaller@googlegroups.com> wrote:
>
>
> Hi all,
>
> I have a large python codebase developed inside PyCharm. I want to use
> PyInstaller for obvious reasons; however, I'm struggling with relative
> paths for data files due to the project code file hierarchy.
>
> The file hierarchy was a usual top-down structure, i.e., the point of
> execution is within a file found in the project root folder, with the
> additional python files stored in a sensible folder, *(please pay
> particular attention to the version.txt file on the same level as the
> Main.py file)* e.g.,
> Project/
> --Main.py
> --version.txt
> --Engines/
> somefile.py
> --Controllers/
> somefile.py
> --Entities/
> somefile.py
>
> A year ago, I built a GUI front end whilst maintaining the console-based
> point of execution. The GUI point of execution is within MainGUI.py. But
> that file is not at the project root. It looks a bit like this:
> Project/
> --Main.py
> --version.txt
> --GUI/
> MainGUI.py
> --Engines/
> somefile.py
> --Controllers/
> somefile.py
> --Entities/
> somefile.py
>
> Inside MainGUI.py, I have the code to open the "../version.txt" file:
> with open("../version.txt") as file: version = file.readline().strip()
>
> I navigate to the Project/GUI folder in the PyCharm Terminal and
> execute pyinstaller MainGUI.py --onefile It seems to work until I try and
> execute the built MainGUI.exe. I'm given the error:
> Traceback (most recent call last): File "MainGUI.py", line 10, in 
> FileNotFoundError: [Errno 2] No such file or directory: '../version.txt'
> [17232] Failed to execute script 'MainGUI' due to unhandled exception!
>
> I could move the version.txt file to be on the same level as MainGUI.py,
> but this was a reduced example. There are lots of data files referenced
> using relative paths.
>
> I would be grateful for any assistance. Thank you.
>
> --
> You received this message because you are subscribed to the Google Groups
> "PyInstaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pyinstaller+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pyinstaller/5e84c822-3872-452c-bea9-7851d94a32e9n%40googlegroups.com
> 
> .
>
> --
> You received this message because you are subscribed to the Google Groups
> "PyInstaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pyinstaller+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pyinstaller/ND5hlBnt-z28OKzyFu38vYLTGA5zjS6AFYPn1Jfh3hOa6hUofLmykH1L3B3eDC7_J4xe8JxflvWjreta3y7dUjN2BT51DDppByQu6qmYMyY%3D%40protonmail.com
> 
> .
>
>

-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR

Re: [PyInstaller] I tried to make my library into an executable using pyinstaller, but pyinstaller can't seem to find my library.

2023-01-23 Thread 'Chris Barker' via PyInstaller
In order to be able to help, we need to know exactly what you did, and what
the result was.

How did you run PyInstaller?

What error messages are you getting?

With some more information, hopefully we can help you.

By the way:

PyPi is a system designed to distribute useful packages to other people,
please do not put your own package there unless it is useful to others.

-Chris


On Mon, Jan 23, 2023 at 2:15 AM 흠냐Storage <2qnrp...@gmail.com> wrote:

> First of all, please understand that I am not good at English, so I use
> Google Translate.
> To study the https protocol, I implemented the https protocol with Python,
> and uploaded my library to the pypi site to test if communication with the
> outside was possible and used pyinstaller to create an executable file for
> the client and server. However, pyinstaller could not find my library.
> printed an error message. If anyone knows a solution, please let me know
>
> --
> You received this message because you are subscribed to the Google Groups
> "PyInstaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pyinstaller+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pyinstaller/827ec0df-4500-49a9-88f2-875eae44a0fen%40googlegroups.com
> 
> .
>


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/CALGmxEKajxzOpKF_t63mVmC7m49a6J7Sr5oSrk0y8HSJpOyAoQ%40mail.gmail.com.


Re: [PyInstaller] application fails in no-console mode

2023-02-18 Thread 'Chris Barker' via PyInstaller
On Fri, Feb 17, 2023 at 1:59 AM Steve Barnes  wrote:

> BTW: Most python to executable converts set a FROZEN attribute but I have
> found that it is not 100% reliable hence the above.
>

Is that sys.FROZEN ?

Good to know for other things as well.

-CHB



*From:* 'Chris Barker' via PyInstaller 
> *Sent:* 16 February 2023 18:50
> *To:* pyinstaller@googlegroups.com
> *Subject:* Re: [PyInstaller] application fails in no-console mode
>
>
>
> NOTE: I don't remember the invocation, but there should be a way to check
> at runtime if the app is running as a stand-alone, and conditionally set up
> logging or whatever differently.
>
>
>
> -CHB
>
>
>
>
>
> On Thu, Feb 16, 2023 at 8:58 AM Steve Barnes 
> wrote:
>
> I have come across similar before. You probably have logger set to write
> to stdout &/or stderr, however, in the compiled application stdout, stderr
> = None, None hence the errors. The trick that I used was to check if they
> are currently None and if so either don’t initialise the logger or make
> sure that all logging is sent to a file.
>
>
>
> Hope that helps.
>
>
>
> Steve
>
>
>
> *From:* pyinstaller@googlegroups.com  *On
> Behalf Of *Glen Rubin
> *Sent:* 16 February 2023 14:54
> *To:* PyInstaller 
> *Subject:* [PyInstaller] application fails in no-console mode
>
>
>
> My 'compiled' application fails, but only on Windows when setting console
> option to False.
>
> At fail i get the error:
>
>
>
> Failed to execute script 'main' due to unhandled exception: maximum
> recursion depth exceeded
>
>
>
> with a very long traceback that looks like this:
>
>
>
> Traceback (most recent call last):
>   File "logging\__init__.py", line 1103, in emit
> AttributeError: 'NoneType' object has no attribute 'write'
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "logging\__init__.py", line 1103, in emit
> AttributeError: 'NoneType' object has no attribute 'write'
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "logging\__init__.py", line 1103, in emit
> AttributeError: 'NoneType' object has no attribute 'write'
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "logging\__init__.py", line 1103, in emit
> AttributeError: 'NoneType' object has no attribute 'write'
>
>
>
> This repeats a few thousand times and then prints:
>
>
> Traceback (most recent call last):
>   File "logging\__init__.py", line 1103, in emit
> AttributeError: 'NoneType' object has no attribute 'write'
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "kivy\logger.py", line 248, in emit
>   File "kivy\logger.py", line 222, in _configure
>   File "logging\__init__.py", line 1477, in info
>   File "logging\__init__.py", line 1624, in _log
>   File "logging\__init__.py", line 1634, in handle
>   File "logging\__init__.py", line 1696, in callHandlers
>   File "logging\__init__.py", line 968, in handle
>   File "logging\__init__.py", line 1108, in emit
>   File "logging\__init__.py", line 1021, in handleError
>   File "kivy\logger.py", line 338, in write
>   File "logging\__init__.py", line 1489, in warning
>   File "logging\__init__.py", line 1624, in _log
>   File "logging\__init__.py", line 1634, in handle
>   File "logging\__init__.py", line 1696, in callHandlers
>   File "logging\__init__.py", line 968, in handle
>   File "logging\__init__.py", line 1108, in emit
>   File "logging\__init__.py", line 1021, in handleError
>   File "kivy\logger.py", line 338, in write
>   File "logging\__init__.py", line 1489, in warning
>   File "logging\__init__.py", line 1624, in _log
>   File "logging\__init__.py", line 1634, in handle
>   File "logging\__init__.py", line 1696, in callHandlers
>   File "logging\__init__.py", line 968, in handle
>   File "logging\__init__.py", line 1108, in emit
>   File "logging\__init__.py", line 1021, in handleError
>   File "kivy\logger.py", line 338, in write
>   File "logging\__init__.py", line 1489, in warning
>   File "logging\__init__.py", line 1624, in _log
>   File "logging\__init__.py", line 1634, in handle
>   

Re: [PyInstaller] application fails in no-console mode

2023-02-17 Thread 'Chris Barker' via PyInstaller
NOTE: I don't remember the invocation, but there should be a way to check
at runtime if the app is running as a stand-alone, and conditionally set up
logging or whatever differently.

-CHB


On Thu, Feb 16, 2023 at 8:58 AM Steve Barnes  wrote:

> I have come across similar before. You probably have logger set to write
> to stdout &/or stderr, however, in the compiled application stdout, stderr
> = None, None hence the errors. The trick that I used was to check if they
> are currently None and if so either don’t initialise the logger or make
> sure that all logging is sent to a file.
>
>
>
> Hope that helps.
>
>
>
> Steve
>
>
>
> *From:* pyinstaller@googlegroups.com  *On
> Behalf Of *Glen Rubin
> *Sent:* 16 February 2023 14:54
> *To:* PyInstaller 
> *Subject:* [PyInstaller] application fails in no-console mode
>
>
>
> My 'compiled' application fails, but only on Windows when setting console
> option to False.
>
> At fail i get the error:
>
>
>
> Failed to execute script 'main' due to unhandled exception: maximum
> recursion depth exceeded
>
>
>
> with a very long traceback that looks like this:
>
>
>
> Traceback (most recent call last):
>   File "logging\__init__.py", line 1103, in emit
> AttributeError: 'NoneType' object has no attribute 'write'
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "logging\__init__.py", line 1103, in emit
> AttributeError: 'NoneType' object has no attribute 'write'
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "logging\__init__.py", line 1103, in emit
> AttributeError: 'NoneType' object has no attribute 'write'
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "logging\__init__.py", line 1103, in emit
> AttributeError: 'NoneType' object has no attribute 'write'
>
>
>
> This repeats a few thousand times and then prints:
>
>
> Traceback (most recent call last):
>   File "logging\__init__.py", line 1103, in emit
> AttributeError: 'NoneType' object has no attribute 'write'
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "kivy\logger.py", line 248, in emit
>   File "kivy\logger.py", line 222, in _configure
>   File "logging\__init__.py", line 1477, in info
>   File "logging\__init__.py", line 1624, in _log
>   File "logging\__init__.py", line 1634, in handle
>   File "logging\__init__.py", line 1696, in callHandlers
>   File "logging\__init__.py", line 968, in handle
>   File "logging\__init__.py", line 1108, in emit
>   File "logging\__init__.py", line 1021, in handleError
>   File "kivy\logger.py", line 338, in write
>   File "logging\__init__.py", line 1489, in warning
>   File "logging\__init__.py", line 1624, in _log
>   File "logging\__init__.py", line 1634, in handle
>   File "logging\__init__.py", line 1696, in callHandlers
>   File "logging\__init__.py", line 968, in handle
>   File "logging\__init__.py", line 1108, in emit
>   File "logging\__init__.py", line 1021, in handleError
>   File "kivy\logger.py", line 338, in write
>   File "logging\__init__.py", line 1489, in warning
>   File "logging\__init__.py", line 1624, in _log
>   File "logging\__init__.py", line 1634, in handle
>   File "logging\__init__.py", line 1696, in callHandlers
>   File "logging\__init__.py", line 968, in handle
>   File "logging\__init__.py", line 1108, in emit
>   File "logging\__init__.py", line 1021, in handleError
>   File "kivy\logger.py", line 338, in write
>   File "logging\__init__.py", line 1489, in warning
>   File "logging\__init__.py", line 1624, in _log
>   File "logging\__init__.py", line 1634, in handle
>   File "logging\__init__.py", line 1696, in callHandlers
>   File "logging\__init__.py", line 968, in handle
>   File "logging\__init__.py", line 1108, in emit
>   File "logging\__init__.py", line 1021, in handleError
>   File "kivy\logger.py", line 338, in write
>   File "logging\__init__.py", line 1489, in warning ...
>
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "PyInstaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pyinstaller+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pyinstaller/dfcf25c5-9da5-4802-88e4-fc72a2d8586en%40googlegroups.com
> 
> .
>
> --
> 

Re: [PyInstaller] 'pathlib' obsolete backport of a standard library package and incompatible with PyInstaller

2023-07-03 Thread 'Chris Barker' via PyInstaller
First of all, I would try cleaning up your conda environment.

Mixing pip and conda installs can get ugly.

You want to start from scratch, and always try to install a package from
conda first, before you install with pip.

And conda-forge can be very helpful.

NOTE: I’d try making a conda environment just for this app — keep tho gs
clean.

Second: the oaib back port should only be avaiad for old versions of Python
(pre 3.5??) — recent versions have pain built in, so you should not have a
patron package installed at all.

 Not sure how it got there, but a clean conda install may take care of all
this for you.

Good luck.


Finally, I’ve had some issues with using PyInstakker by with some conda
packages - it’s been a while, but you may have issues with dynamic
libraries.

-CHB


On Sun, Jul 2, 2023 at 3:30 AM Dionysis Boukouvalas 
wrote:

> Hello!
>
> I'm working on a Windows 64 system. I'm running python on Jupyter notebook
> through Anaconda. I succesfully transformed that .ipynb file to a .py one.
>
> I also successfully installed PyInstaller by running “pip install
> pyinstaller” in the Anaconda prompt.
>
> When I entered “pyinstaller game.py” I got the error message: "The
> 'pathlib' package is an obsolete backport of a standard library package and
> is incompatible with PyInstaller."
>
> When I checked the pathlib version with “pip install --upgrade pathlib” I
> got the message “Requirement already satisfied”. Anaconda and PyInstaller
> are also up to date.
>
> Chat GPT suggested that “the issue you're encountering with PyInstaller is
> likely not related to the version of the 'pathlib' package itself. It could
> be a compatibility problem between PyInstaller and another package or
> dependency in your Python program.”
>
> What can I do?
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "PyInstaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pyinstaller+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pyinstaller/db77f4b4-aa49-4b06-82ad-56f7889debdbn%40googlegroups.com
> 
> .
>
-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/CALGmxEK0QCt7ffqScOO7DLuc6TnLJv8bGC6FdY93_%2BkAm9dekw%40mail.gmail.com.


Re: [PyInstaller] pyw file runs fine, but after converting to exe getting "Unhandled exception in script" error

2023-08-01 Thread 'Chris Barker' via PyInstaller
key point -- this has nothing to do with PyInstaller -- it's an issue with
your Python code -- perhaps it came up with a different input than you had
tested on (testing things is hard!

On Sun, Jul 30, 2023 at 1:27 AM Steve Barnes  wrote:

> This problem can occur when the contents of row[folder_header] is of type
> float rather than string – e.g. if the value at that location is 1.0 then
> you will be trying to string join “some_path” and 1.0 which will not work.
> You should be able to resolve this by changing line 64 to read:
>
> target_folder_path = os.path.join(organized_folder_path,
> str(target_folder_path))
>

However -- is the numeric value actually supposed to be a file / folder
name? Or is that another bug?

-CHB




> Hope that helps.
>
>
>
> Steve
>
>
>
> *From:* pyinstaller@googlegroups.com  *On
> Behalf Of *Adi F.
> *Sent:* Friday, July 28, 2023 3:42 PM
> *To:* PyInstaller 
> *Subject:* [PyInstaller] pyw file runs fine, but after converting to exe
> getting "Unhandled exception in script" error
>
>
>
> Hi.
>
>
>
> I have a script in Python that organizes files into folders based on a
> file and folder list in an Excel file.
>
>
>
> Full disclosure: My Python and coding skills are pretty basic and I did
> get help from ChatGPT when creating this script
>
>
>
> The script is working fine and I get no errors when I run the python file
> (pyw).
>
> Now, I want this script to be accessible to anyone, regardless of whether
> they have Python installed or not, and regardless of Python version, so I'm
> encapsulating the script in an .exe file using PyInstaller.
>
> When running the .exe created by PyInstaller - the script functions
> correctly and the results are as intended, but I get the following error
> message:
>
>
>
>
>
>
>
>
>
>
>
>
>
> *Unhandled exception in script Failed to exectue script
> 'files_to_folders_per_excel_v2.2' due to unhandled exception: join()
> argument must be str, bytes, or os.PathLike object, not 'float' Traceback
> (most recent call last): File "files_to_folders_per_excel_v2.2.pyw", line
> 64, in  File "ntpath.py", line 143, in join File "genericpath.py",
> line 152, in _check_arg_types TypeError: join() argument must be str,
> bytes, or os.PathLike object, not 'float'*
>
>
>
> Here's the Python code in github:
>
>
> https://github.com/zevelj/files-to-folders/blob/main/files_to_folders_per_excel_v2.1.pyw
>
>
>
> If anyone has any ideas how I can make the exe file run without any error
> messages, please let me know. Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "PyInstaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pyinstaller+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pyinstaller/f9c01e30-df36-4ca7-a429-ee9097bc5639n%40googlegroups.com
> 
> .
>
> --
> You received this message because you are subscribed to the Google Groups
> "PyInstaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pyinstaller+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pyinstaller/DU0P194MB1819696B5FCCE1BB7AD8AEB79B04A%40DU0P194MB1819.EURP194.PROD.OUTLOOK.COM
> 
> .
>


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/CALGmxELKe5YqierFpwmy7fcM94Qae-fp5jYRLnONH8bX2%2B_yRw%40mail.gmail.com.


Re: [PyInstaller] Trojan detected in 5.13?

2023-08-02 Thread 'Chris Barker' via PyInstaller
On Tue, Aug 1, 2023 at 9:23 AM 'Jasper Harrison' via PyInstaller <
pyinstaller@googlegroups.com> wrote:

> This is almost certainly a Trojan,


To be clear, this is almost certainly a false positive, due to someone
having used PyInstaller to distribute a Trojan.


> as unfortunately many amateur malware authors write Python-based malware
> which they package & release with PyInstaller. As there is a consistent
> binary signature across all PyInstaller executables it results in a lot of
> false positives.
>

So the virus scanner knows that the PyInstaller Wheel looks a LOT like a
known Trojan.

So the wheel is probably safe, but unfortunately, an application built with
it may get flagged as well :-(

Have I got that right?

-CHB


> Jasper Harrison, aka Legorooj
> Core Developer on PyInstaller
> https://legorooj.net
>
>
>
>
>
>
>  Original Message 
> On 1 Aug 2023, 15:23, Dominik Niedenzu < dominik.niede...@gmail.com>
> wrote:
>
>
> Hi Guys,
>
>
> first let me thank you for your great work - I am a big fan of pyinstaller!
>
> Some minutes ago, I downloaded and scanned:
>
> pyinstaller-5.13.0-py3-none-win_amd64.whl
>
> and got:
>
> (Jiangmin) --> "Trojan.PSW.Multi.me ".
>
> Does anybody know whether this is a known false positive (or might this be
> a serious threat)?
>
>
> Thanks in advance and cheers,
> Dominik
>
> --
> You received this message because you are subscribed to the Google Groups
> "PyInstaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pyinstaller+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pyinstaller/1598c3d2-986f-4854-a065-0cb3d3872f03n%40googlegroups.com
> 
> .
>
> --
> You received this message because you are subscribed to the Google Groups
> "PyInstaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pyinstaller+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pyinstaller/XWzYUTjtNxoxwZ7ULJMO_S1zV_v9NYb8zw6vO00o2GGoRTAJywuZh5fLz137sLRtTdpVHSHviQXzIBkcIMlA3gdQsI3cY8Wa0zCtebJTQGo%3D%40protonmail.com
> 
> .
>
>

-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/CALGmxEL9ZOFcJU%3Dzq%2Bf0X4E6CCmNObCrtNJzK7AJ0UOetLG7ig%40mail.gmail.com.


Re: [PyInstaller] Mac app bounces in system dock, closes, and then re-opens

2023-05-09 Thread 'Chris Barker' via PyInstaller
I have no idea, but some debugging hints:

1) how are you running it from the terminal? If you aren't alreadyk, try:

open TheApp.app

Then you *may* get the failure, and if so, hopefully some output on the
console.

2) Open the Console App:

/System/Applications/Utilities/Console.app

Then try to start your app -- hopefully you'll see some eros reported that
might give you a hint.

Good Luck -- got to love how Apple hides stuff from the user :-(

-CHB




On Mon, May 8, 2023 at 10:39 AM Paul Fishback 
wrote:

> I have a simple app built from a python script, heatplotter.py, which
> utilizes
> PyQt and pyqtgraph.
>
> I'm able to run pyinstaller on my .spec file and create a functioning app.
> It runs fine from the terminal.
>
> However, when I click on the .app icon, the icon bounces in the system
> tray, then closes, and, after about 15 seconds, re-opens. I've never had
> this happen before. Of course, this annoying, and I'd like to prevent it
> from happening.
>
> Any guesses as to the reason? Here's my .spec file:
>
> # -*- mode: python ; coding: utf-8 -*-
>
> import os.path
> block_cipher = None
>
> data=collect_data_files('PyQt5')
>
> a = Analysis(
> ['heatplotter.py'],
> pathex=[],
> binaries=[],
> datas=data,
> hiddenimports=['pyqtgraph'],
> hookspath=[],
> hooksconfig={},
> runtime_hooks=[],
> excludes=['PySide6'],
> win_no_prefer_redirects=False,
> win_private_assemblies=False,
> cipher=block_cipher,
> noarchive=False,
> )
> pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
>
> exe = EXE(
> pyz,
> a.scripts,
> a.binaries,
> a.zipfiles,
> a.datas,
> [],
> name='MyApplication',
> debug=False,
> bootloader_ignore_signals=False,
> strip=False,
> upx=True,
> upx_exclude=[],
> runtime_tmpdir=None,
> console=False,
> disable_windowed_traceback=False,
> argv_emulation=False,
> target_arch=None,
> codesign_identity=None,
> entitlements_file=None,
> )
> app = BUNDLE(
> exe,
> name='MyApplication.app',
> icon=None,
> bundle_identifier=None,
> )
>
> --
> You received this message because you are subscribed to the Google Groups
> "PyInstaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pyinstaller+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pyinstaller/68616ce5-30c3-47fb-a4b1-76675d3374ffn%40googlegroups.com
> 
> .
>


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/CALGmxEJuLDnWp%3DL1mW0sfH1XGqGLMewpJVqNLccppqyERpXNOA%40mail.gmail.com.


Re: [PyInstaller] Understanding PyInstaller

2024-01-05 Thread 'Chris Barker' via PyInstaller
On Fri, Jan 5, 2024 at 9:34 AM Tony Cappellini  wrote:

> >>But what does the second line of PyInstaller’s build log say?
> 483 INFO: PyInstaller: 6.3.0
> 483 INFO: Python: 3.11.2
>

That looks right then.

I'm no expert, but it seems something is going fundamentally wrong here. My
suggestion:

- make a VERY simple little script with minimal imports -- maybe without
imp if you think that's a particular issue. Maybe pull an example from
the docs.

- try to build it with PyInstaller

- if it doesn't work, then post EVERYTHING you did here, including the
build log.

If it does work, then slowly add stuff to make it more complicated.

NOTE: I suspect the `imp` issue is a red herring -- unless it the only
module that PyInstaller is having trouble with -- which I don't think is
the case.

nevertheless, imp is deprecated -- now would be a good time to update that
code :-)

HTH,
-CHB





> >>To PyInstaller, there’s no way of telling what modules are standard lib
> or 3rd party or your own code.
> The path to the python interpreter should make that easy
>
> >>That reinforces my thinking that pyinstaller is not installed into that
> Python 3.11 environment that you think it is.
> There is only 1 python interpreter on this system, and there are no
> virtual environments
>
>
> On Fri, Jan 5, 2024 at 3:36 AM bwoodsend  wrote:
>
>> Python 3.11.2 (tags/v3.11.2:878ead1, Feb 7 2023, 16:38:35) [MSC v.1934 64
>> bit (AMD64)] on win32
>>
>> But what does the second line of PyInstaller’s build log say?
>>
>> The simple fact that pyinstaller is complaining about stdlib modules is
>> just odd.
>>
>> To PyInstaller, there’s no way of telling what modules are standard lib
>> or 3rd party or your own code.
>>
>> There is an import statement for that module at the top of the file.
>>
>> Then PyInstaller will know that it needs that module and can’t find it.
>> That reinforces my thinking that pyinstaller is not installed into that
>> Python 3.11 environment that you think it is.
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "PyInstaller" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/pyinstaller/Uo-ss_svKXc/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> pyinstaller+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/pyinstaller/bf9c6a84-b767-4cb1-8b39-b380029bb10fn%40googlegroups.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "PyInstaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pyinstaller+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pyinstaller/CABRXM4kKam-3XMP7%3DjdWzYJ_sYNW0%2B%2B-RW7cCfuBYOKdWQZcDA%40mail.gmail.com
> 
> .
>


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/CALGmxEKUCvyLkk%3DP8p23nUZMUU6UzchMobxttVgptxpTK%3D_t7Q%40mail.gmail.com.


Re: [PyInstaller] Re: Unable to create .exe with 'import gooey' and 'import openpyxl' in my py script.

2024-01-08 Thread 'Chris Barker' via PyInstaller
you've fallen into a all too common trap -- more than one Pythn
installed in your system.

decide which one you what to use, and ideall uninstall the other so you
don't have this issue again :-) -- otherwise:

figure out how to run:
python
and
pip

so that they are using the same Python.

then install PYINstllerin into the Python you want.

make sure your app runs with that Python.

Run PyInstaller again.

In short: make sure EVERYTHING you are doing is with the same Python
install.

-HTH,
-CHB

C:\Users\kip\Downloads\csv2xcl>pyinstaller -F build.spec
>> 450 INFO: PyInstaller: 6.3.0
>> 451 INFO: Python: 3.12.1
>>
>
There's your hint -- PyInstaller is using 3.12

-CHB


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/CALGmxE%2BkcKCfnV47GphJtvFAgdmNRBmSCCjEAJY9Xyzivktc9w%40mail.gmail.com.


Re: [PyInstaller] no suitable image found libpython3.8.dylib

2024-01-26 Thread 'Chris Barker' via PyInstaller
On Fri, Jan 26, 2024 at 10:23 AM bruno D  wrote:

> i am on an  2,4 GHz Intel Core i9 8 core .


with both OS versions? so that's not it.


> i think about a mismatch between install python-dev (with shared framework
> option ) with brew and install python 8.3.7 with pyenv
>

That would do it -- I suspect brew Python is using recent versions of
system libs, whereas python.org Python is built against older versions, on
purpose. That's kind of the point with brew. Also, brew Python may depend
on other brew-supplied libs -- PyInstaller may not know to include those.

-CHB


>
>
> Le vendredi 26 janvier 2024 à 18:09:16 UTC+1, Chris Barker a écrit :
>
>> Not sure if this has anything to do with it, but the Mac has the
>> additional complication of the new M processors -- so you need to make sure
>> you are building a app with the right processor -- I think the recent
>> Python.,org builds have both built it, but you'll need to make sure.
>>
>> Sorry -- I haven't actually tested anything on an M processor yet, so
>> can't offer any hints.
>>
>> -CHB
>>
>>
>> On Fri, Jan 26, 2024 at 7:48 AM elli...@cox.net  wrote:
>>
>>> On MacOS you want to build the app on the oldest OS you are willing to
>>> support.Backward compatibility is a crap shoot.
>>> --
>>> *From:* pyins...@googlegroups.com  on behalf
>>> of bruno D 
>>> *Sent:* Friday, January 26, 2024 4:33 AM
>>> *To:* PyInstaller 
>>> *Subject:* [PyInstaller] no suitable image found libpython3.8.dylib
>>>
>>> hi,
>>> i am getting crazy with pyinstaller, i build my .dmg on monterey with
>>> python 3.8.13 and launch my .dmg on mavericks,
>>> i have this error : no suitable image found libpython3.8.dylib
>>>
>>> could you help to fix my issue ?
>>>
>>> Best regards
>>> Bruno
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "PyInstaller" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to pyinstaller...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/pyinstaller/ddf06102-7029-413c-9e4f-a6171aa6d4c5n%40googlegroups.com
>>> 
>>> .
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "PyInstaller" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to pyinstaller...@googlegroups.com.
>>>
>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/pyinstaller/SA1PR03MB646775720D83329FAF780370FD792%40SA1PR03MB6467.namprd03.prod.outlook.com
>>> 
>>> .
>>>
>>
>>
>> --
>>
>> Christopher Barker, Ph.D.
>> Oceanographer
>>
>> Emergency Response Division
>> NOAA/NOS/OR(206) 526-6959   voice
>> 7600 Sand Point Way NE   (206) 526-6329   fax
>> Seattle, WA  98115   (206) 526-6317   main reception
>>
>> chris@noaa.gov
>>
> --
> You received this message because you are subscribed to the Google Groups
> "PyInstaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pyinstaller+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pyinstaller/5d9a02e2-d28f-416c-9832-698b5329b03bn%40googlegroups.com
> 
> .
>


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/CALGmxEJv3Fo0ayqEkXQdmgvB27r7S7R%2B7uwZtRPAy8ZJ9qba%2BA%40mail.gmail.com.


Re: [PyInstaller] no suitable image found libpython3.8.dylib

2024-01-26 Thread 'Chris Barker' via PyInstaller
Not sure if this has anything to do with it, but the Mac has the additional
complication of the new M processors -- so you need to make sure you are
building a app with the right processor -- I think the recent Python.,org
builds have both built it, but you'll need to make sure.

Sorry -- I haven't actually tested anything on an M processor yet, so can't
offer any hints.

-CHB


On Fri, Jan 26, 2024 at 7:48 AM ellio...@cox.net  wrote:

> On MacOS you want to build the app on the oldest OS you are willing to
> support.Backward compatibility is a crap shoot.
> --
> *From:* pyinstaller@googlegroups.com  on
> behalf of bruno D 
> *Sent:* Friday, January 26, 2024 4:33 AM
> *To:* PyInstaller 
> *Subject:* [PyInstaller] no suitable image found libpython3.8.dylib
>
> hi,
> i am getting crazy with pyinstaller, i build my .dmg on monterey with
> python 3.8.13 and launch my .dmg on mavericks,
> i have this error : no suitable image found libpython3.8.dylib
>
> could you help to fix my issue ?
>
> Best regards
> Bruno
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "PyInstaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pyinstaller+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pyinstaller/ddf06102-7029-413c-9e4f-a6171aa6d4c5n%40googlegroups.com
> 
> .
>
> --
> You received this message because you are subscribed to the Google Groups
> "PyInstaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pyinstaller+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pyinstaller/SA1PR03MB646775720D83329FAF780370FD792%40SA1PR03MB6467.namprd03.prod.outlook.com
> 
> .
>


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/CALGmxEJxfsxtUb43PGD5A-Yfpq9bEy%3DWq9QFBqFBRovw9ndcpw%40mail.gmail.com.