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

pyenv issue with missing /bin/libpython.dylib #1

Closed
martin-martin opened this issue Mar 7, 2020 · 8 comments
Closed

pyenv issue with missing /bin/libpython.dylib #1

martin-martin opened this issue Mar 7, 2020 · 8 comments

Comments

@martin-martin
Copy link

Hello! Thanks a lot for your article 🙌 .

  • MacOS 10.15.3 (Catalina)
  • Python 3.8.0 (via pyenv)
  • pyenv 1.2.16

When attempting to create the standalone Pomodoro app from your repo with python setup.py py2app, I run into the following error:

----- py2app install output snipped off -----

copying file /Users/martin/project/path/venv/bin/python -> /Users/martin/project/path/dist/Pomodoro.app/Contents/MacOS/python
Traceback (most recent call last):
  File "setup.py", line 15, in <module>
    setup(
  File "/Users/martin/project/path/venv/lib/python3.8/site-packages/setuptools/__init__.py", line 145, in setup
    return distutils.core.setup(**attrs)
  File "/Users/martin/.pyenv/versions/3.8.0/lib/python3.8/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/Users/martin/.pyenv/versions/3.8.0/lib/python3.8/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/Users/martin/.pyenv/versions/3.8.0/lib/python3.8/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/Users/martin/project/path/venv/lib/python3.8/site-packages/py2app/build_app.py", line 907, in run
    self._run()
  File "/Users/martin/project/path/venv/lib/python3.8/site-packages/py2app/build_app.py", line 1125, in _run
    self.run_normal()
  File "/Users/martin/project/path/venv/lib/python3.8/site-packages/py2app/build_app.py", line 1238, in run_normal
    self.create_binaries(py_files, pkgdirs, extensions, loader_files)
  File "/Users/martin/project/path/venv/lib/python3.8/site-packages/py2app/build_app.py", line 1619, in create_binaries
    mm.mm.run_file(runtime)
  File "/Users/martin/project/path/venv/lib/python3.8/site-packages/macholib/MachOGraph.py", line 89, in run_file
    raise ValueError("%r does not exist" % (pathname,))
ValueError: '/Users/martin/.pyenv/versions/3.8.0/lib/libpython3.8.dylib' does not exist

Do you have any idea or experience whether pyenv could be the culprit here, or is it Catalina?

@visini
Copy link
Owner

visini commented Mar 7, 2020

Can you try rebuilding CPython with enabling framework support? By default of CPython (and pyenv), the python executable will be generated as static linked and libpython*.dylib will not be generated.

env PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install -v 3.8.0

See here: pyenv/pyenv#443 (comment)

@martin-martin
Copy link
Author

That worked (with installing 3.8.1, the .0 version maybe had some conflicts in knowing which one to select ¯_(ツ)_/¯

env PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install -v 3.8.1

However, now I'm running into the same issue I did with my little app:

Screenshot 2020-03-08 at 16 48 25

Did you manage to run yours on Catalina? I assume that the new security measures might have introduced a problem here.

@visini
Copy link
Owner

visini commented Mar 8, 2020

My rumps apps all work fine on Catalina. Could be related to macOS gatekeeper. Can you try disabling gatekeeper? sudo spctl --master-disable

@visini
Copy link
Owner

visini commented Mar 11, 2020

My rumps apps all work fine on Catalina. Could be related to macOS gatekeeper. Can you try disabling gatekeeper? sudo spctl --master-disable

Did this work?

@martin-martin
Copy link
Author

Hi @visini thanks for your answer. Just tried running the command before starting the app, and it didn't change anything. Also tried to re-build it after disabling the gatekeeper (for good measure), but still the same result.

@janik6n
Copy link

janik6n commented Apr 11, 2020

@martin-martin Please have a look of my solution to an issue, which might be similar to yours: ronaldoussoren/py2app#284

@martin-martin
Copy link
Author

@janikarh yes! Your solution did it for me! Thanks so much 🎉

@visini
Copy link
Owner

visini commented Apr 16, 2020

Thank you @janikarh !

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

No branches or pull requests

3 participants