ronaldoussoren / py2app

py2app is a Python setuptools command which will allow you to make standalone Mac OS X application bundles and plugins from Python scripts.
Other
342 stars 36 forks source link

App created with py2app works perfectly until I send it to another machine #450

Open KarolWojtyla333 opened 2 years ago

KarolWojtyla333 commented 2 years ago

As a disclaimer, I'm new to MacOS so anything done with a Mac is a little finicky for me. As far as I can tell, I've created my app correctly. It works as designed on the machine that I created the app with, whether from the dist folder or from terminal, but the moment that I try and send the .app file or a zip of the dist folder with the .app file inside, the app breaks. I've tried sending it through mediafire as well as through google drive, but either way I end up with an error. The errors show as follows:

"SampleApp" is damaged and can't be opened. You should move it to the Trash.

Or I get, with the Finder icon:

The application "SampleApp.app" can't be opened.

I'm very curious as to what the root of the problem is. Perhaps it's the way I'm sending it? I simply upload the working version to mediafire/google drive and then share the link to another machine or even myself and once I download it and try to run it, I get one of the errors I mentioned before. I should mention that the kind of error is specific to the source it's downloaded from. I believe that when the app is downloaded from google drive, I get the first error, and from mediafire I get the second. It's also possible I just did something weird that resulted in the different errors, but essentially the app breaks after being sent. Please let me know if there's any other information/screenshots/etc. to help clarify my problem.

glyph commented 2 years ago

@KarolWojtyla333 How are you creating the zip file? Are you doing it in a way that preserves symlinks (i.e. the -y option if you're using the command line)? I mention this in my blog post here: https://glyph.twistedmatrix.com/2018/01/shipping-pygame-mac-app.html#step-5-archive-it

KarolWojtyla333 commented 2 years ago

@glyph I'm trying this out now. Should I run through all the steps of the blog post, or is it only important to work with step 5 and onwards if I simply want a specific handful of others to have access to the app?

KarolWojtyla333 commented 2 years ago

@glyph I'm trying this out now. Should I run through all the steps of the blog post, or is it only important to work with step 5 and onwards if I simply want a specific handful of others to have access to the app?

Only doing step 5, with either method, results in the same error.

glyph commented 2 years ago

If you want no errors you do have to do all the steps except those specific to pygame. But the error you're seeing indicates something else wrong, I think. Can you paste a screenshot here of the exact error dialog you're getting?

KarolWojtyla333 commented 2 years ago

@glyph Here's the exact error I get. Snapchat-1419130959

glyph commented 2 years ago

Does it only break after you upload & download or does it break after you zip & unzip, even if you don't upload it first?

(I'd also be curious to look at the bundle, if you have the source, or your download, available somewhere)

KarolWojtyla333 commented 2 years ago

@glyph I'll test to see if it breaks even if I just zip/unzip later today. I can privately share with you the .zip from a google drive if you'd like to send me a suitable email.

glyph commented 2 years ago

@KarolWojtyla333 You can email glyph@twistedmatrix.com .

ronaldoussoren commented 2 years ago

One other thing you can do to test is to try to open the app from the terminal (run "PathDrawDemo.app/Contents/MacOS/PathDrawDemo") to see if this shows relevant errors.

That may not help here though, IIRC the system can show this unhelpful error message when signature validation doesn't work, and that may not be triggered when launching the app from the terminal. One thing to test in that regard:

Note that removing the extended attribute would be a workaround.

alfwatt commented 2 years ago

@KarolWojtyla333 I've been working through using py2app to package a couple of Tk based apps, I suspect you are building on one architecture (M1 or Intel) and deploying onto a different one. Here's what's working for me:

This puts a universal2 (M1 + Intel) set of Python binaries and libraries on your system. You can verify your install with:

file `which python3`

Make sure you PATH points to the newly installed python3 framework bin (/Library/Frameworks/Python.framework/Versions/3.10/bin currently but you'll need the latest py2app (as of 24 may 2022) which you can get directly with

python3 -m pip install git+https://github.com/ronaldoussoren/py2app@v0.28.2

With a universal2 python and that updated py2app pip, You should be able to build the app with py2app and get a universal2 binary, you can verify that with:

file dist/SampleApp.app/Contents/MacOS/SampleApp
...
dist/SampleApp.app/Contents/MacOS/SampleApp: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64
- Mach-O 64-bit executable x86_64] [arm64:Mach-O 64-bit executable arm64
- Mach-O 64-bit executable arm64]
dist/SampleApp.app/Contents/MacOS/SampleApp (for architecture x86_64):  Mach-O 64-bit executable x86_64
dist/SampleApp.app/Contents/MacOS/SampleApp (for architecture arm64):   Mach-O 64-bit executable arm64

Note that you'll have quarantine bits as noted above if you download the app onto another Mac. To work around that you can Right Click on SampleApp.app and choose Open which will present a "Are you sure?" dialog. To remove that step you'll need to sign and notarize the application.

KarolWojtyla333 commented 2 years ago

Does it only break after you upload & download or does it break after you zip & unzip, even if you don't upload it first?

(I'd also be curious to look at the bundle, if you have the source, or your download, available somewhere)

Just confirmed, it still works after zipping without sending it. It only breaks after being sent. Additionally, I shared the .zip with you on Google Drive.

KarolWojtyla333 commented 2 years ago

One other thing you can do to test is to try to open the app from the terminal (run "PathDrawDemo.app/Contents/MacOS/PathDrawDemo") to see if this shows relevant errors.

That may not help here though, IIRC the system can show this unhelpful error message when signature validation doesn't work, and that may not be triggered when launching the app from the terminal. One thing to test in that regard:

  • Check if there's a quarantine attribute on the app: xattr PathDrawDemo.app, look for com.apple.quarantine
  • If that attribute is there remove it: xattr -d com.apple.quarantine PathDrawDemo.app

Note that removing the extended attribute would be a workaround.

Running that first command works perfectly fine with no thrown errors, and the xattr line returns nothing, as shown below:

Screen Shot 2022-05-23 at 9 28 13 PM
KarolWojtyla333 commented 2 years ago

@KarolWojtyla333 I've been working through using py2app to package a couple of Tk based apps, I suspect you are building on one architecture (M1 or Intel) and deploying onto a different one. Here's what's working for me:

This puts a universal2 (M1 + Intel) set of Python binaries and libraries on your system. You can verify your install with:

file `which python3`

Make sure you PATH points to the newly installed python3 framework bin (/Library/Frameworks/Python.framework/Versions/3.10/bin currently but you'll need my branch of py2app for python 3.9(ish?) and later).

python3 -m pip install git+https://github.com/alfwatt/py2app@aw-importlib-update

With a universal2 python and that updated py2app pip, You should be able to build the app with py2app and get a universal2 binary, you can verify that with:

file dist/SampleApp.app/Contents/MacOS/SampleApp
...
dist/SampleApp.app/Contents/MacOS/SampleApp: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64
- Mach-O 64-bit executable x86_64] [arm64:Mach-O 64-bit executable arm64
- Mach-O 64-bit executable arm64]
dist/SampleApp.app/Contents/MacOS/SampleApp (for architecture x86_64):    Mach-O 64-bit executable x86_64
dist/SampleApp.app/Contents/MacOS/SampleApp (for architecture arm64): Mach-O 64-bit executable arm64

Note that you'll have quarantine bits as noted above if you download the app onto another Mac. To work around that you can Right Click on SampleApp.app and choose Open which will present a "Are you sure?" dialog. To remove that step you'll need to sign and notarize the application.

@alfwatt I just went through those steps, though I didn't quite check if I had the latest python3 since I started a fresh python3 setup about 4 days ago, so hopefully there wasn't some update to it.

Here's just a snippet I took of the app being finished which aligns with the quarantine bits you mentioned.

Screen Shot 2022-05-23 at 9 38 42 PM

Whenever I send this app to someone though, they can use the work around and hit open, the following error is thrown: Screenshot_20220523-223346_Snapchat

I apologize for the resolution and such, this is on someone else's machine.

glyph commented 2 years ago

I think more than one odd thing is going on here, but maybe they're related.

For one thing, there is a code signature (an ad-hoc one, maybe?) that is just broken, not even untrusted:

$ codesign -d --verify --verbose=4 ~/Downloads/PatDrawDemo.app
--prepared:/Users/glyph/Downloads/PatDrawDemo.app/Contents/MacOS/python
--validated:/Users/glyph/Downloads/PatDrawDemo.app/Contents/MacOS/python
--prepared:/Users/glyph/Downloads/PatDrawDemo.app/Contents/Frameworks/libtcl8.6.dylib
--prepared:/Users/glyph/Downloads/PatDrawDemo.app/Contents/Frameworks/libssl.1.1.dylib
--validated:/Users/glyph/Downloads/PatDrawDemo.app/Contents/Frameworks/libtcl8.6.dylib
--validated:/Users/glyph/Downloads/PatDrawDemo.app/Contents/Frameworks/libssl.1.1.dylib
--prepared:/Users/glyph/Downloads/PatDrawDemo.app/Contents/Frameworks/libtk8.6.dylib
--validated:/Users/glyph/Downloads/PatDrawDemo.app/Contents/Frameworks/libtk8.6.dylib
--prepared:/Users/glyph/Downloads/PatDrawDemo.app/Contents/Frameworks/libcrypto.1.1.dylib
--validated:/Users/glyph/Downloads/PatDrawDemo.app/Contents/Frameworks/libcrypto.1.1.dylib
--prepared:/Users/glyph/Downloads/PatDrawDemo.app/Contents/Frameworks/Python.framework/Versions/Current/.
--validated:/Users/glyph/Downloads/PatDrawDemo.app/Contents/Frameworks/Python.framework/Versions/Current/.
/Users/glyph/Downloads/PatDrawDemo.app: a sealed resource is missing or invalid
file added: /Users/glyph/Downloads/PatDrawDemo.app/Contents/Resources/PatDrawFig1.png

It's an ad-hoc signature, but there's still something broken with respect to the bundle itself.

Weirdly I can't even convince it to be properly signed even if I sign it (and every library and sub-executable) with my own valid developer certificate, which suggests something is wrong with the shape of the bundle itself.

If I kill the quarantine attribute entirely, I get a traceback about missing shared libraries for the wand library, which is maybe a related problem as well?

I'm not quite sure what to do to debug it from here, except to ask exactly what steps you took to produce the bundle?

KarolWojtyla333 commented 2 years ago

@glyph Do you mean from the beginning of app creation? Like the code itself? Or just the use of py2app and everything else past the script? I'm pretty new to all of this, I've only ever really used IDE's with compilers like PyCharm. I should also mention, that "Launch Error" message that I showed one of my previous comments only occurs on other's machines. On my machine, I can actually open the app after downloading it from the google drive, but I had someone else run it and that error was thrown. I would say it's the different machines cause mine's a 2018 Mac and theirs is a 2021 I think, but that was already addressed with the solution that @alfwatt mentioned, right?

glyph commented 2 years ago

I'm mostly curious about how you invoked py2app and what your setup.py looks like. (And whether you invoked codesign at any point?)

KarolWojtyla333 commented 2 years ago

I'm mostly curious about how you invoked py2app and what your setup.py looks like. (And whether you invoked codesign at any point?)

I'm not sure what 'codesign' is, but as for the py2app configuration, I followed the following screenshots: image image

My setup.py looks like this:

Screen Shot 2022-05-24 at 3 14 44 AM

Let me know if you need anything else.

ronaldoussoren commented 2 years ago

I haven't read all updates yet.

But... Please make sure you use either a release, or the v0.28-branch. The code in the master branch is less stable at the moment because I'm slowly cleaning up old code now that I've dropped support for python 2.7.

ronaldoussoren commented 2 years ago

If I kill the quarantine attribute entirely, I get a traceback about missing shared libraries for the wand library, which is maybe a related problem as well?

I'm pretty sure that the missing library is part of the problem with code signing.

alfwatt commented 2 years ago

@KarolWojtyla333 looks like you at least got the next error, I've fixed those import errors by making sure the library in question is installed via pip, and by adding them explicitly to the setup.py (I do this when I generate the setup.py):

    py2applet --includes=wand --make-setup PatDrawDemo.py
glyph commented 2 years ago

If I kill the quarantine attribute entirely, I get a traceback about missing shared libraries for the wand library, which is maybe a related problem as well?

I'm pretty sure that the missing library is part of the problem with code signing.

One of the problems with the code signing is the added PatDrawFig1.png file, but I can't find anywhere that the missing library shows up as an error. I can't find anything that links to it with otool, and I can't understand why re-signing it with a developer ID certificate doesn't work. Is dlopen()-ing a file outside the bundle something that can cause this type of code-signing error dialog? I was going to say "I'd expect to see a traceback" but I guess if the kernel is killing it due to a codesigning violation of some kind, it would not have the opportunity to report an error before dying…

The thing that bugs me is that I can get it to say the designated requirement is satisfied with codesign -v but it still won't launch.

(I'm really just trying to build a mental model of how to debug something like this.)

alfwatt commented 2 years ago

@ronaldoussoren updated my comment above for posterity and closed out https://github.com/ronaldoussoren/py2app/pull/449

alfwatt commented 2 years ago

@glyph re: "One of the problems with the code signing is the added PatDrawFig1.png file"

Is that file included before or after the app is signed? If it's listed as an argument to setup.py it should be included before signing, I've got a png in my project which is included the same way.

PY_INCLUDES    := tkinter,PySimpleGUI,os,time,requests,getpass
APP_SCRIPT     := Example.py
APP_FILES      := Example.png Example.json Example.etc

setup.py:
    py2applet --includes=$(PY_INCLUDES) --make-setup $(APP_SCRIPT) $(APP_FILES)
KarolWojtyla333 commented 2 years ago

I haven't read all updates yet.

But... Please make sure you use either a release, or the v0.28-branch. The code in the master branch is less stable at the moment because I'm slowly cleaning up old code now that I've dropped support for python 2.7.

How can I check my version of py2app? I used the pip3 install -U py2app line to install py2app.

KarolWojtyla333 commented 2 years ago

@glyph and @alfwatt The 'PatDrawFig1.png' file is created through my app itself, if that answers any questions. It isn't a graphic needed for the GUI or anything like that for the app itself. Is it possible that because I'm telling it to save the image and then open it into the native image viewer of the machine that these problems are occurring? This is being handled within my script here:

Screen Shot 2022-05-24 at 3 26 12 PM
glyph commented 2 years ago

@KarolWojtyla333 I think you've got at least one other problem here, but you should never write to any files within your app bundle; this will always break codesigning and cause the app to fail to launch. (If you're lucky it will just crash your application immediately with an access error, but as you can see it's often possible to accidentally write in there)

KarolWojtyla333 commented 2 years ago

@glyph I see. The open_image is a function I created which utilizes the machine's native image viewer with the argument being the image name. It's kind of integral to the app though. But you're saying this is only part of the problem which I'll probably just run into when I try and actually execute the function of the app if I do get the app to actually open?

KarolWojtyla333 commented 2 years ago

I wanted a clean setup of my app so I went through all the processes again, including the way to get py2app with universal 2, with -iMac dist % python3 -m pip install git+https://github.com/ronaldoussoren/py2app@v0.28.2, but I ran into the following error:


Using legacy 'setup.py install' for py2app, since package 'wheel' is not installed.
Installing collected packages: py2app
  Attempting uninstall: py2app
    Found existing installation: py2app 0.29
    Uninstalling py2app-0.29:
      Successfully uninstalled py2app-0.29
  Running setup.py install for py2app ... error
  error: subprocess-exited-with-error

  × Running setup.py install for py2app did not run successfully.
  │ exit code: 1
  ╰─> [28 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/j4/bmfrjgln7hx80zxj61lqj8480000gn/T/pip-req-build-d09wkmr2/setup.py", line 284, in <module>
          setup(
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/__init__.py", line 153, in setup
          return distutils.core.setup(**attrs)
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/core.py", line 108, in setup
          _setup_distribution = dist = klass(attrs)
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/dist.py", line 453, in __init__
          _Distribution.__init__(
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 292, in __init__
          self.finalize_options()
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/dist.py", line 830, in finalize_options
          for ep in sorted(loaded, key=by_order):
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/dist.py", line 829, in <lambda>
          loaded = map(lambda e: e.load(), filtered)
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pkg_resources/__init__.py", line 2450, in load
          return self.resolve()
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pkg_resources/__init__.py", line 2456, in resolve
          module = __import__(self.module_name, fromlist=['__name__'], level=0)
        File "/private/var/folders/j4/bmfrjgln7hx80zxj61lqj8480000gn/T/pip-req-build-d09wkmr2/py2app/__init__.py", line 35, in <module>
          __version__ = pkg_resources.require("py2app")[0].version
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pkg_resources/__init__.py", line 886, in require
          needed = self.resolve(parse_requirements(requirements))
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pkg_resources/__init__.py", line 772, in resolve
          raise DistributionNotFound(req, requirers)
      pkg_resources.DistributionNotFound: The 'py2app' distribution was not found and is required by the application
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  WARNING: No metadata found in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages
  Rolling back uninstall of py2app
  Moving to /Library/Frameworks/Python.framework/Versions/3.10/bin/py2applet
   from /private/var/folders/j4/bmfrjgln7hx80zxj61lqj8480000gn/T/pip-uninstall-65d8qh2e/py2applet
  Moving to /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/py2app-0.29.dist-info/
   from /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/~y2app-0.29.dist-info
  Moving to /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/py2app/
   from /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/~y2app
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> py2app

note: This is an issue with the package mentioned above, not pip.```

In addition to this, if I ignore this and just make the app anyways, then I get back to the original error saying "'PatDrawDemo.app' is damaged..." It also seems to suggest I have py2app version .29 rather than .28 @ronaldoussoren 
glyph commented 2 years ago

@KarolWojtyla333 If you are shipping the image along with the app and you want to edit it, you just need to pick a location to save it to that isn't inside the app bundle. If you're using Tkinter for your UI, you could use https://docs.python.org/3.10/library/dialog.html#tkinter.filedialog.SaveFileDialog to ask the user where to put it?

glyph commented 2 years ago

@KarolWojtyla333 It would be a lot easier for all of us to help debug this if we could see your source code. I realize you may need to keep the actual application you're working on private, but perhaps you could start off by just trying to produce an absolutely minimal "hello world" application and see if you can get that to work with right-click->"Open" (since it won't be properly codesigned for distribution, but that explicit workaround should launch it fine if its ad-hoc signature isn't broken).

If you can get a minimal application that doesn't do anything but pop up a single window to work, then we can work forward, adding the things your actual app is doing until we encounter the thing that's breaking…

glyph commented 2 years ago

It's also generally more helpful to paste textual logs inside ``` blocks in github comments so that we can more easily copy/paste bits of it rather than screenshots, and to see what command you were running when you got an error rather than just the output of the error itself.

Ideally you could share a repository and put the commands you're running into a shell script in it, so we could run the same script and see if we get the same output.

KarolWojtyla333 commented 2 years ago

@KarolWojtyla333 If you are shipping the image along with the app and you want to edit it, you just need to pick a location to save it to that isn't inside the app bundle. If you're using Tkinter for your UI, you could use https://docs.python.org/3.10/library/dialog.html#tkinter.filedialog.SaveFileDialog to ask the user where to put it?

The image isn't shipped at all, the script just makes a canvas with wand and then saves that as an image which is then opened in the native image viewer. I don't have a specified path for the image to save to, but the image saved ends up in HD/Users/User

It's also generally more helpful to paste textual logs inside ``` blocks in github comments so that we can more easily copy/paste bits of it rather than screenshots, and to see what command you were running when you got an error rather than just the output of the error itself.

Ideally you could share a repository and put the commands you're running into a shell script in it, so we could run the same script and see if we get the same output.

I'll edit that comment with what you asked, and I'll also try to get a minimal app to work.

glyph commented 2 years ago

I'll edit that comment with what you asked, and I'll also try to get a minimal app to work.

Thanks a bunch. I really hope that you do not suffer in vain here, and we can get some documentation in place that makes this process less painful for future users :)

glyph commented 2 years ago

(Also, the way code blocks work is that you want to have ``` on a line by itself, then your code, then ``` on a line by itself again to end it; that makes it look

like this,
with multiple lines

rather than like this, with multiple lines )

KarolWojtyla333 commented 2 years ago

I'll edit that comment with what you asked, and I'll also try to get a minimal app to work.

Thanks a bunch. I really hope that you do not suffer in vain here, and we can get some documentation in place that makes this process less painful for future users :)

I've edited it, however I'm still pretty new to GitHub as well as most of the stuff I'm dealing with here, so I'm not sure how to set up a repository as you asked. How can I reset it all so I can start from scratch (as in from the beginning of python installation and all of that, if I need to go back that far) and go through each command I run in the terminal?

(Also, the way code blocks work is that you want to have ``` on a line by itself, then your code, then ``` on a line by itself again to end it; that makes it look

like this,
with multiple lines

rather than like this, with multiple lines )

Thanks for this, also... I was confused on that.

glyph commented 2 years ago

I've edited it, however I'm still pretty new to GitHub as well as most of the stuff I'm dealing with here, so I'm not sure how to set up a repository as you asked.

Go to https://github.com/new , make a new repository, be sure it's set to "public", (I'll refer to it as your-new-repo but you can call it whatever you like), then git clone https://github.com/KarolWojtyla333/your-new-repo, cd your-new-repo, save the code for your minimal app in there, git commit -a -m "here's some code", then git push and send over the link.

How can I reset it all so I can start from scratch (as in from the beginning of python installation and all of that, if I need to go back that far) and go through each command I run in the terminal?

The python installation & virtual environment are not part of your code, and we can go through the steps to recreate those as appropriate. If we have your code and you still have an issue, then we can possibly narrow down the problem to the way you installed python or py2app and give you instructions for redoing that in a way that works.

KarolWojtyla333 commented 2 years ago

@glyph I followed the steps, but maybe I did something wrong still while following along, so here's what I get when I try that.

iMac ~ % git clone https://github.com/KarolWojtyla333/Debugging-py2app-project.git
Cloning into 'Debugging-py2app-project'...
cwarning: You appear to have cloned an empty repository.
iMac ~ % cd Debugging-py2app-project
iMac Debugging-py2app-project % git commit -a -m print("HelloWorld")
zsh: unknown file attribute: H
iMac Debugging-py2app-project % git commit -a -m "print("HelloWorld")"
On branch main

Initial commit

nothing to commit (create/copy files and use "git add" to track)
iMac Debugging-py2app-project % git push
error: src refspec refs/heads/main does not match any
error: failed to push some refs to 'https://github.com/KarolWojtyla333/Debugging-py2app-project.git'
iMac Debugging-py2app-project % 

Additionally, I sent the simple app to another machine and it does the same thing that it does on my machine, which is it runs without error. Granted, nothing really happens since the app is just print("Hello World"), but there's no error when you run it, at the very least.

glyph commented 2 years ago

@KarolWojtyla333 Try git add . and then git commit -m 'hello world' before git push.

KarolWojtyla333 commented 2 years ago

@KarolWojtyla333 Try git add . and then git commit -m 'hello world' before git push.


iMac Debugging-py2app-project % git add .
iMac Debugging-py2app-project % git commit -m 'hello world'
On branch main
Your branch is based on 'origin/main', but the upstream is gone.
(use "git branch --unset-upstream" to fixup)

nothing to commit, working tree clean```

I get this now.

glyph commented 2 years ago

Erm. git push -u origin main ?

glyph commented 2 years ago

I see that you have pushed an empty file, so presumably something worked? As you update the code, git add ., git commit -m 'message', git push should update the repository.

glyph commented 2 years ago

(It will be interesting to add things one at a time, ideally one per commit, until it stops working on another machine...)

KarolWojtyla333 commented 2 years ago

@glyph I tried doing as you said and it doesn't seem to like my credentials for GitHub. I'm really confused.

iMac Debugging-py2app-project % git add .
iMac Debugging-py2app-project % git commit -m 'hello world'
On branch main
Your branch is based on 'origin/main', but the upstream is gone.
  (use "git branch --unset-upstream" to fixup)

nothing to commit, working tree clean
iMac Debugging-py2app-project % git push -u origin main
Username for 'https://github.com': KarolWojtyla333
Password for 'https://KarolWojtyla333@github.com': 
remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
fatal: Authentication failed for 'https://github.com/KarolWojtyla333/Debugging-py2app-project.git/'
iMac Debugging-py2app-project % 
KarolWojtyla333 commented 2 years ago

I see that you have pushed an empty file, so presumably something worked? As you update the code, git add ., git commit -m 'message', git push should update the repository.

Oh, sorry, I manually created that empty file on GitHub rather than through terminal.

KarolWojtyla333 commented 2 years ago

@glyph I also just manually made another file of the terminal lines I input to get the "App is damaged" error after someone else downloads the app.

ronaldoussoren commented 2 years ago

I haven't read all updates yet. But... Please make sure you use either a release, or the v0.28-branch. The code in the master branch is less stable at the moment because I'm slowly cleaning up old code now that I've dropped support for python 2.7.

How can I check my version of py2app? I used the pip3 install -U py2app line to install py2app.

Then you're using the correct version of py2app. One of the updates by @KarolWojtyla333 showed output from py2app that's not from a released version but from the master branch where I'm cleaning up the code base.

KarolWojtyla333 commented 2 years ago

@ronaldoussoren @glyph @alfwatt This is just a bump. I'm still having the same issue. Any more ideas, by any chance?

glyph commented 2 years ago

I'd love to circle back on this but I have COVID right now, so perhaps bump again in 2 weeks?

KarolWojtyla333 commented 2 years ago

I'd love to circle back on this but I have COVID right now, so perhaps bump again in 2 weeks? Sounds good to me. Hope you feel better quickly.

glyph commented 2 years ago

Sounds good to me. Hope you feel better quickly.

Thanks.