Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package for mac/windows #102

Closed
3 tasks done
ShootingStarDragon opened this issue Mar 24, 2023 · 27 comments · Fixed by #98
Closed
3 tasks done

package for mac/windows #102

ShootingStarDragon opened this issue Mar 24, 2023 · 27 comments · Fixed by #98

Comments

@ShootingStarDragon
Copy link
Owner

ShootingStarDragon commented Mar 24, 2023

before uploading, make sure:

  • clean up code and comments
  • examples work (worked in vs code, cleared)
  • compiled exe work (for both mac and windows, rebuild everything)
@ShootingStarDragon ShootingStarDragon changed the title package for mac package for mac/windows Mar 24, 2023
@ShootingStarDragon
Copy link
Owner Author

it worked: pyenv install 3.8
basically run this guy's commands: https://stackoverflow.com/questions/69511006/cant-install-pyenv-3-8-5-on-macos-big-sur-with-m1-chip
I didn't finish but I did install brew86
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

alias brew86="arch -x86_64 /usr/local/bin/brew"'
install libs for pyenv

brew86 install openssl readline sqlite3 xz zlib
it errored out saying mac already provided similar libs

then I tried pyenv install 3.8 and it picked the right version for me, now it's building for me

@ShootingStarDragon
Copy link
Owner Author

WARNING: The scripts pip3 and pip3.8 are installed in '/Users/raidraptorultimatefalcon/.pyenv/versions/3.8.16/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-22.0.4 setuptools-56.0.0

@ShootingStarDragon
Copy link
Owner Author

pyenv/pyenv#1768

@ShootingStarDragon
Copy link
Owner Author

plan: install homebrew, update homebrew, install pyenv, update pyenv, then install reqs for pip as in above links?
brew install openssl readline sqlite3 xz zlib

@ShootingStarDragon
Copy link
Owner Author

went to python 3.8.16, still need to think about how to install mediapipe somehow...

@ShootingStarDragon
Copy link
Owner Author

pyenv/pyenv#1768

@ShootingStarDragon
Copy link
Owner Author

@ShootingStarDragon
Copy link
Owner Author

@ShootingStarDragon
Copy link
Owner Author

new plan, follow the link above and only use 86 64 stuff:
pyenv: /usr/local/Cellar/pyenv/2.3.16

@ShootingStarDragon
Copy link
Owner Author

/usr/local/Cellar/pyenv/2.3.16/bin/pyenv

@ShootingStarDragon
Copy link
Owner Author

@ShootingStarDragon
Copy link
Owner Author

ShootingStarDragon commented Mar 25, 2023

let's try with 86 poetry:
==> Caveats
zsh completions have been installed to:
/usr/local/share/zsh/site-functions
==> Summary
🍺 /usr/local/Cellar/poetry/1.4.1: 2,313 files, 27.7MB
==> Running brew cleanup poetry...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see man brew).
==> Caveats
==> poetry
zsh completions have been installed to:
/usr/local/share/zsh/site-functions

/usr/local/cellar/pyenv/2.3.16/bin/pyenv
/usr/local/Cellar/poetry/1.4.1/bin/poetry
/usr/local/Cellar/python@3.11/3.11.2_1/bin/python3.11

@ShootingStarDragon
Copy link
Owner Author

@ShootingStarDragon
Copy link
Owner Author

raidraptorultimatefalcon@Roberts-Air ~ % source .zshrc
raidraptorultimatefalcon@Roberts-Air ~ % cd coding
raidraptorultimatefalcon@Roberts-Air coding % ls -a
. .. FastCVApp KivySchool gitinfo
raidraptorultimatefalcon@Roberts-Air coding % cd fastcvapp
raidraptorultimatefalcon@Roberts-Air fastcvapp % brew reinstall --build-from-source sdl2 sdl2_image sdl2_ttf sdl2_mixer
Error: The following flag:
--build-from-source
requires building tools, but none are installed.
Install the Command Line Tools:
xcode-select --install
Alternatively, remove the flag to attempt bottle installation.

raidraptorultimatefalcon@Roberts-Air fastcvapp % brew xcode-select --install
Error: Unknown command: xcode-select
raidraptorultimatefalcon@Roberts-Air fastcvapp % brew xcode-select --install

@ShootingStarDragon
Copy link
Owner Author

@ShootingStarDragon
Copy link
Owner Author

use pathex in pyinstaller

@ShootingStarDragon
Copy link
Owner Author

@ShootingStarDragon
Copy link
Owner Author

mac has smth weird going on. i think it uses the cwd for everything, so to build, you build from basedir and run the spec file whereas windows u go to examples dir and build it

@ShootingStarDragon
Copy link
Owner Author

python -m PyInstaller --onefile --name BacksubMAC --add-data "FastCVApp.py:." examples/example_backgroundsubtraction.py

@ShootingStarDragon
Copy link
Owner Author

https://stackoverflow.com/a/54845170
os.path.sep.join(sys.argv[0].split(os.path.sep)[:-1])

@ShootingStarDragon
Copy link
Owner Author

https://stackoverflow.com/questions/62451711/pyinstaller-icon-option-doesnt-work-on-mac

--osx-bundle-identifier 'YOUR_IDENTIFIER'

@ShootingStarDragon
Copy link
Owner Author

ShootingStarDragon commented Mar 28, 2023

so packaging to mac works, just need to say that you need to add the file directly. the problem i had is my target was down 1 level and I couldn't figure out how to add it no1 on windows/mac, no2 to work from both running from examples file and from exe no3 with log/no log

@ShootingStarDragon
Copy link
Owner Author

pyinstaller/pyinstaller#3275
try doing windowed in spec file

@ShootingStarDragon ShootingStarDragon linked a pull request Mar 29, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant