I have a build phase that calls some python scripts.
This has been working fine for well over 2 years, but after recently updating to Xcode 13.3 it now fails.
the error I started receiving is:
/Users/me/Library/Developer/Xcode/DerivedData/MyApp-fsowouspdsdjjzfmlfafizjbkcae/Build/Intermediates.noindex/ArchiveIntermediates/MyApp/IntermediateBuildFilesPath/MyApp.build/Release-iphoneos/MyApp.build/Script-9002D8C42166BC850081D43D.sh: line 6: python: command not found
Command PhaseScriptExecution failed with a nonzero exit code
At a glance, it looks like xcode is attempting to run the script on the simulator instead of running in the local project directory.
python --version:
Python 3.8.3
I am wondering if there is some new configuration that I am unaware of for new xcode versions?
EDIT:
when i run the the lines in the script in my terminal, they run just fine.
You have installed Python 3 somehow (brew, perhaps), and it is in your PATH. That is why, when you say python, it is found.
But that same Python is not in Xcode's PATH! And it never has been. You've never noticed this, and you've never needed to notice it, because Xcode has always used the system Python, which was located in /SystemLibraryFrameworks. You and Xcode were probably using different Python versions (the system version stopped at 2.7), but this didn't matter.
But now (Monterey 12.3), it isn't. There is now no Python in Xcode's PATH. Thus, when your script says python plain and simple, it isn't found. You can fix this by using a complete path in your scripts that specifies where your Python is. You can find this out by saying which python.
So, Xcode seems to bundles its' own versions of python and python 3. It does not use the system version, so changes to Monteray 12.3 would not affect this.
Since that is the case, the correct solution is changing python to python3 since it looks like an Xcode update dropped python2.7 to parallel the OS dropping it later. I had to also update my python file to ensure compatibility.
Related
I am attempting to install Julia on my Samsung Series 7 laptop, which has OS Windows 7 64-bit. Instructions on how to do this are located at https://github.com/JuliaLang/julia/blob/master/README.windows.md, under the section "Compiling with MinGW/MSYS2".
Step 4-ii says to run the following command in MSYS2:
contrib/windows/get_toolchain.sh 64
When I run this command, I get the following error:
error: this script requires having 7z installed
I have no idea how to get around this. I already had 7zip installed on my computer, but I reinstalled it and am still having the issue. Later, the build step (step 4-iv in the link), which says to run the following command in MSYS2
make -j 4
also fails, giving me the error
bash: make: command not found
I suspect this is because of the earlier failure in step 4-ii, though I can't be sure.
My question: How do I get around these issues to get a good working version of Julia?
Incidentally, the immediate reason I am trying to do this is because I want to do the Julia tutorial located at https://www.youtube.com/watch?v=vWkgEddb4-A&feature=youtu.be&list=PLP8iPy9hna6T0dEHtj0GZymvT6ODIJWj0. I tried to just download the regular Julia installation located at http://julialang.org/downloads/ to do this, but it became apparent as I started going through the tutorial that that a more substantial Julia build was required, and I think this is the one that I need.
Thank you for any help.
Did anyone manage to build the latest stable version from PortAudio (v19 20140130) on OS-X 10.9 - MAC Maverick?I am new both to MAC and to PortAudio, but did follow all instructions and received many errors during the build, some of them very basic (for example - file 'assert.h' was not found). My assumption is that MAC SDK version might be different from what PortAudio was expecting.I am actually interested in the output binaries of the build - both x86 and x64, so if these could be downloaded from somewhere this also could be a solution.Many thanks for any tip, PazO
Problem resolvedBackground:In order to build PortAudio on MAC you need to run two commands: configure and make. This procedure is fully described here.The first command - configure - suppose to build your Makefile file, enabling the next command - make- to work correctly.One of the tasks of configure is to discover what MacOS-SDK version is installed on your system and what is the full path to it.The problem:The problem was that the configure script did not find the correct version of MacOS-SDK that is insalled on my Maverick system and thus made the next command - make - to fail.The fix:In the configure.in file there is a section that tries to discover what is the
version and location of the MacOS SDK that is installed on the local system.
Once discovered it will put the correct values into the local script variables
mac_version_min and mac_sysroot.Since this code was not working correctly I replaced it with the next two 'hard-coded'
lines:mac_version_min="-mmacosx-version-min=10.8"mac_sysroot="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk"After this all was building correctly.PazO
When I run svnversion from the command line, I see version "3978" which is correct.
However, when I run this in a build script in Xcode 4.6.3 from the same directory I see "exported".
Why is this and how can I resolve this?
(My client and server are on SVN 1.7. According to the redbook, this can happen when svnversion is invoked on a directory that is not a working copy but this perhaps doesn't seem to be the case here.)
Digging into Xcode 4.6.3's package contents, in Contents/Developer/usr/bin the version of svn bundled with Xcode is 1.6.18, while the system version is 1.7.10. This seems to explain the mismatch.
Symlinking to /opt/local/bin/svn* in Contents/Developer/usr/bin resolved this for me.
I've been using the vim-latex suite on my mac (10.7.?) for months with no problem. Over the weekend, I upgraded the OS to 10.8.2, and now my tex files fail to compile. The compile command
\ll
produces no errors within vim, but no pdf-file gets produced. If I drop to the command line in a terminal, the following command
latex document.tex
produces
-bash: latex: command not found
Similarly, for pdflatex. I'm not sure if this is a path error, or if latex for 10.8.2 needs to be reinstalled. I'm not sure how to proceed in either case.
I had the same problem and typing:
export PATH=/usr/texbin:$PATH
seems to work fine in a shell. Although it no longer works if I open a new shell, this is a faster solution to re-downloading and re-installing the huge MacTeX program.
This happened to me after upgrading to OS X El Capitan. I found the latex executables in /usr/local/texlive/2014/bin/x86_64-darwin. So, I just added this to my .bashrc
export PATH="$PATH:/usr/local/texlive/2014/bin/x86_64-darwin"
No need to reinstall.
On OS X, the standard way for third party installers to add a directory to the path is to put a file under /etc/paths.d. TeXLive does this as part of the installation, but the OS upgrade probably blew it away.
You should be able to just create a new file under that directory containing just one line, the path the directory containing the TeX executables.
When setting the path via #petew's answer, /usr/local/texlive/2014/bin/x86_64-darwin may not be the correct version. On my system /usr/local/texlive/2021/bin/universal-darwin was what was needed. Make sure to check your texlive binaries to see what file you downloaded.
Using the Python templates for Xcode, I have a simple project running on one machine and failing on two others, for different reasons. The failure I solved is that even though main.m has:
Py_SetProgramName("/usr/bin/python");
The actual running Python as seen from main.py with this:
import sys
print sys.version
is different. And the problem was that this other Python didn't have objc installed. So the question is: short of cleaning up my machine, how can I direct Xcode to use the system Python?
Edit:
This is a problem that seems like it is trivial, but it isn't. It seems so because when I specify Mac OS X 10.5 as the Base SDK, Xcode links against that Python.framework, as I can see by double-clicking the icon in Linked Frameworks in the Xcode project.
Each Version in Python.framework has a key/value pair in its Info.plist: CFBundleExecutableName/Python. Luckily (for the forensics) this Python in the Version 2.5 framework launches 2.6.1! Yet by printing sys.version (from main.py) or by snooping on the loader (by doing export DYLD_PRINT_LIBRARIES=1), I can see that the PyObjC App actually launches Python 2.5.4.
The line above with Py_SetProgramName.. is irrelevant---it can be commented out and everything works fine.
So what it looks like is that Python.framework controls which Python is launched, it doesn't do this in the way I expected, and it might be controlled through an initialization routine that is opaque, since it's controlled by Apple. It seems the best way to "control" the situation is to change the Base SDK.
Sorry to answer my own question but I was just confused. This part is an error
Python in the Version 2.5 framework launches 2.6.1
caused by my not realizing that what's going on here (from the Version/2.6 directory)
> ./Python
-bash: ./Python: cannot execute binary file
> Python
Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)
is that we're searching my $PATH and launching /opt/local/bin/python.
Apologies for the confusion.
To summarize, setting the SDK should get the desired Python to run as we can see by snooping on the loader:
> export DYLD_PRINT_LIBRARIES=1
> ~/Desktop/X/build/Debug/X.app/Contents/MacOS/X
dyld: loaded: /Users/telliott_admin/Desktop/X/build/Debug/X.app/Contents/MacOS/X
dyld: loaded: /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa
dyld: loaded: /System/Library/Frameworks/Python.framework/Versions/2.5/Python
..