Reputation: 772
I am currently using a mac version 11.6.1 with Big Sur on it. I have the latest version of python (3.9) on it, however I need to use 3.6 for a project at work. I attempted to use pyenv to install this version but ran into a number of issues with pyenv. So, I next went to https://www.python.org/downloads/release/python-3615/ and downloaded this version. In my terminal I ran the following commands.
$ cd Downloads
$ cd python-3.6.15
$ ./configure
$ make
Here I ran into this error.
./Modules/getpath.c:528:49: warning: incompatible pointer types passing 'unsigned long *' to parameter of type 'uint32_t *' (aka 'unsigned int *') [-Wincompatible-pointer-types]
else if(0 == _NSGetExecutablePath(execpath, &nsexeclength) && execpath[0] == SEP) {
^~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach-o/dyld.h:98:54: note: passing argument to parameter 'bufsize' here
extern int _NSGetExecutablePath(char* buf, uint32_t* bufsize) __OSX_AVAILABLE_STARTING(__MAC_10_2, __IPHONE_2_0);
^
1 warning generated.
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -I. -I./Include -DPy_BUILD_CORE -c ./Modules/posixmodule.c -o Modules/posixmodule.o
./Modules/posixmodule.c:8210:15: error: implicit declaration of function 'sendfile' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
ret = sendfile(in, out, offset, &sbytes, &sf, flags);
^
./Modules/posixmodule.c:10432:5: warning: code will never be executed [-Wunreachable-code]
Py_FatalError("abort() called from Python code didn't abort!");
^~~~~~~~~~~~~
1 warning and 1 error generated.
make: *** [Modules/posixmodule.o] Error 1
I am banging my head against the wall here with the errors from pyenv and now this. My attempt here was to run a virtual environment with virtualenv and point it at the 3.6 version of python, however, as you can see I can't seem to install python correctly. Any assistance here would be appreciated.
Since I was asked about the error with pyenv I'll include that here too.
BUILD FAILED (OS X 11.6.1 using python-build 2.2.0-5-g54889eb8)
Inspect or clean up the working tree at /var/folders/77/93y4tp5x557ff0h_3f76bh5c0000gn/T/python-build.20211104075648.30324
Results logged to /var/folders/77/93y4tp5x557ff0h_3f76bh5c0000gn/T/python-build.20211104075648.30324.log
Last 10 log lines:
checking for --with-cxx-main=<compiler>... no
checking for clang++... no
configure:
By default, distutils will build C++ extension modules with "clang++".
If this is not intended, then set CXX on the configure command line.
checking for the platform triplet based on compiler characteristics... darwin
configure: error: internal configure error for the platform triplet, please file a bug report
make: *** No targets specified and no makefile found. Stop.
Upvotes: 0
Views: 3300
Reputation: 21
with penv try this:
# get latest pyenv version
brew unlink pyenv
brew install pyenv --HEAD
CFLAGS=-Wno-implicit-function-declaration pyenv install 3.6.15
Upvotes: 2