On Thu 25 Feb 2016 at 22:50:23 (+0100), Floris van Manen wrote: > the thing is that some of the scripts in the bin folder have python set to > #!/usr/bin/python > I merely copied it to other scripts to get them going for the time. > > I do agree that it would be more convenient to have the scripts use the > python version which is included in the Lilypond.app distro. > Not sure how to set that working from a shell script however. > e.g. if you run that python, there is no working environment either… > > $ /Applications/LilyPond.app/Contents/MacOS/python > Could not find platform independent libraries <prefix> > Could not find platform dependent libraries <exec_prefix> > Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] > 'import site' failed; use -v for traceback > Python 2.6.6 (r266:84374, Aug 31 2010, 11:00:51) > [GCC 4.0.1 (Apple Inc. build 5493)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > >>> import os > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > ImportError: No module named os > >>>
That suggests that there is something wrong with your installed lilypond. The stand-alone development version I have downloaded (because Debian/stable only runs 2.18.2) is installed in my home directory, and its python runs ok: $ ~/lilypond/usr/bin/python Python 2.4.5 (#1, Apr 5 2015, 12:40:45) [GCC 4.9.2] on linux3 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> $ ~/lilypond/usr/bin/python ~/lilypond/usr/bin/convert-ly --version 2.19.36 $ As you can see, the python version is pretty ancient compared with: $ python Python 2.7.9 (default, Mar 1 2015, 18:22:53) [GCC 4.9.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> $ I take it the scripts you've been altering are just those in that tree, in which case, I'd try downloading another copy in case it's corrupted. (You could try comparing downloads; I don't know if the packages have any checkable checksum.) Then reinstall it. I have noticed that, for example, os.pyc is in a zip archive LilyPond.app/Contents/Resources/lib/python2.6/site-packages.zip Maybe that didn't get unzipped properly. Can you see a file LilyPond.app/Contents/Resources/lib/python2.6/os.pyc ? > > On 25 Feb 2016, at 22:32, David Wright <[email protected]> wrote: > > That would indicate that, as far as the system is concerned, python > > is (a link to) python2. Good, your system (unless it's archlinux) > > probably isn't broken. You've only broken your part of it. > > > > If you work through other people's scripts changing #!/usr/bin/env python > > to #!/usr/bin/python you are storing up more and more problems in the > > future. If you really want to stick with a PATH default of python3, > > then look at each script you feel the need to change. If it's > > written in python2, you can fairly safely changed the shebang to > > #!/usr/bin/env python2 > > which should run the correct version. The possible dangers if these > > are system scripts are that the file's timestamp is changed as are the > > contents. This could interfere with how their upgrade scripts function > > if they depend on these. Cheers, David. _______________________________________________ lilypond-user mailing list [email protected] https://lists.gnu.org/mailman/listinfo/lilypond-user
