Pyenv BUILD FAILED while Integrate Spark (Scala) and Jupyter Notebook - python-3.x

Does anyone know how to solve this problem?
pyenv build fails. Trying to integrate spark scala with jupyter notbook as described hereenter link description here
➜ ~ pyenv install 3.8.2
python-build: use openssl#1.1 from homebrew
python-build: use readline from homebrew
Downloading Python-3.8.2.tar.xz...
-> https://www.python.org/ftp/python/3.8.2/Python-3.8.2.tar.xz
Installing Python-3.8.2...
python-build: use readline from homebrew
python-build: use zlib from xcode sdk
^D
BUILD FAILED (OS X 11.2.1 using python-build 20180424)
Inspect or clean up the working tree at /var/folders/_v/qvsxvlw51rxb43z929hyv45w0000gn/T/python-build.20210222233923.72853
Results logged to /var/folders/_v/qvsxvlw51rxb43z929hyv45w0000gn/T/python-build.20210222233923.72853.log
Last 10 log lines:
extern int _NSGetExecutablePath(char* buf, uint32_t* bufsize) __OSX_AVAILABLE_STARTING(__MAC_10_2, __IPHONE_2_0);
^
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -I./Include/internal -I. -I./Include -I/usr/local/opt/readline/include -I/usr/local/opt/readline/include -I/Users/quais/.pyenv/versions/3.8.2/include -I/usr/local/opt/readline/include -I/usr/local/opt/readline/include -I/Users/quais/.pyenv/versions/3.8.2/include -DPy_BUILD_CORE_BUILTIN -DPy_BUILD_CORE_BUILTIN -I./Include/internal -c ./Modules/posixmodule.c -o Modules/posixmodule.o
./Modules/posixmodule.c:9197:15: error: implicit declaration of function 'sendfile' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
ret = sendfile(in, out, offset, &sbytes, &sf, flags);
^
1 error generated.
make: *** [Modules/posixmodule.o] Error 1
make: *** Waiting for unfinished jobs....
1 warning generated.
➜ ~
Saving session...completed.
Deleting expired sessions...none found.
[Process completed]

I could solve this by getting an older version the environment. Apparently the latest version is not supported even if i have the 12+ version of Xcode
pyenv install 3.7.9

Related

Troubleshoot gcc installation

I have the following setup:
I don't have root priviliges, so I usually build my stuff from source to $HOME/.local
System is Debian 3.16.84-1
I wanted to update my gcc installation.
there's version 4.9.2 installed systemwide, and I installed version 8.4.0 some years ago for local user.
Now I try to install the current version 11.2.0
My first try was to do it with version 8.4.0
the following error occurs when running make:
if [ x"-fpic" != x ]; then \
gcc -c -DHAVE_CONFIG_H -g -I. -I../.././libiberty/../include -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -pedantic -D_GNU_SOURCE -fpic ../.././libiberty/floatformat.c -o
pic/floatformat.o; \
else true; fi
*** Error in `/home/user/.local/libexec/gcc/x86_64-pc-linux-gnu/8.4.0/cc1': free(): invalid next size (fast): 0x0000000002a19c70 ***
../.././libiberty/floatformat.c: In function ‘floatformat_to_double’:
../.././libiberty/floatformat.c:547:2: internal compiler error: Aborted
dto = ldexp (1.0, exponent);
^~~
using 8.9.2 I get a similar error:
if [ x"-fpic" != x ]; then \
gcc -c -DHAVE_CONFIG_H -g -I. -I../.././libiberty/../include -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -pedantic -D_GNU_SOURCE -fpic ../.././libiberty/floatformat.c -o pic/floatformat.o; \
else true; fi
*** Error in `/usr/lib/gcc/x86_64-linux-gnu/4.9/cc1': free(): invalid next size (fast): 0x0000000003626810 ***
*** Error in `/usr/lib/gcc/x86_64-linux-gnu/4.9/cc1': malloc(): memory corruption: 0x0000000003626850 ***
gcc: internal compiler error: Aborted (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.9/README.Bugs> for instructions.
Makefile:804: recipe for target 'floatformat.o' failed
I have the feeling there's a more general underlying problem somewhere but I have no idea how to troubleshoot.
I can post full logs if needed.

YouCompleteMe (ycm), Failed to build regex module

I am trying to install the ycmd plugin for vim (after having ran git submodule update --init --recursive) and I am running into: Failed to build regex module.
After running ./install.py in the "YouCompleteMe" folder, here are the upstream lines that lead to the stated error:
[100%] Linking CXX shared library /home/users/jeremy/.vim/bundle/YouCompleteMe/third_party/ycmd/ycm_core.so
[100%] Built target ycm_core
running build
running build_py
creating /home/users/jeremy/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/regex-build
creating /home/users/jeremy/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/regex-build/regex
copying regex_3/__init__.py -> /home/users/jeremy/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/regex-build/regex
copying regex_3/regex.py -> /home/users/jeremy/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/regex-build/regex
copying regex_3/_regex_core.py -> /home/users/jeremy/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/regex-build/regex
copying regex_3/test_regex.py -> /home/users/jeremy/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/regex-build/regex
running build_ext
building 'regex._regex' extension
creating /home/users/jeremy/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/regex-build/3
creating /home/users/jeremy/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/regex-build/3/temp.linux-x86_64-3.7
creating /home/users/jeremy/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/regex-build/3/temp.linux-x86_64-3.7/regex_3
gcc -pthread -B /home/users/jeremy/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/users/jeremy/anaconda3/include/python3.7m -c regex_3/_regex.c -o /home/users/jeremy/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/regex-build/3/temp.linux-x86_64-3.7/regex_3/_regex.o
gcc -pthread -B /home/users/jeremy/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/users/jeremy/anaconda3/include/python3.7m -c regex_3/_regex_unicode.c -o /home/users/jeremy/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/regex-build/3/temp.linux-x86_64-3.7/regex_3/_regex_unicode.o
gcc -pthread -shared -B /home/users/jeremy/anaconda3/compiler_compat -L/home/users/jeremy/anaconda3/lib -Wl,-rpath=/home/users/jeremy/anaconda3/lib -Wl,--no-as-needed -Wl,--sysroot=/ /home/users/jeremy/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/regex-build/3/temp.linux-x86_64-3.7/regex_3/_regex.o /home/users/jeremy/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/regex-build/3/temp.linux-x86_64-3.7/regex_3/_regex_unicode.o -o /home/users/jeremy/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/regex-build/regex/_regex.cpython-37m-x86_64-linux-gnu.so
/home/users/jeremy/anaconda3/compiler_compat/ld: /home/users/jeremy/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/regex-build/3/temp.linux-x86_64-3.7/regex_3/_regex.o: unable to initialize decompress status for section .debug_info
/home/users/jeremy/anaconda3/compiler_compat/ld: /home/users/jeremy/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/regex-build/3/temp.linux-x86_64-3.7/regex_3/_regex.o: unable to initialize decompress status for section .debug_info
/home/users/jeremy/anaconda3/compiler_compat/ld: /home/users/jeremy/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/regex-build/3/temp.linux-x86_64-3.7/regex_3/_regex.o: unable to initialize decompress status for section .debug_info
/home/users/jeremy/anaconda3/compiler_compat/ld: /home/users/jeremy/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/regex-build/3/temp.linux-x86_64-3.7/regex_3/_regex.o: unable to initialize decompress status for section .debug_info
/home/users/jeremy/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/regex-build/3/temp.linux-x86_64-3.7/regex_3/_regex.o: file not recognized: file format not recognized
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
Failed to build regex module.
It seems like the /anaconda3/compiler_compat/ld executable is not compatible with the YouCompleteMe/third_party/ycmd/third_party/regex-build/3/temp.linux-x86_64-3.7/regex_3/_regex.o file.
Does someone have an idea of what's going on or what I could try out ?
you can use coc.nvim to do code complement, it works so good and is easy to use.
i tried to build YCM so many times several years before, and in the end, i gave up.
I've found the problem from someone hitting the same kind of issue while trying to compile PyTorch :
"The whole problem lies in the fact that Anaconda distribution comes with its own ld linker that is located in /opt/anaconda/compiler_compat/ and it overshadows system ld residing at /usr/bin.
To fix my error I ran python setup.py clean and then I temporarily renamed Anaconda's ld linker to ld-old to make it invisible during PyTorch installation. Removing -B option from the installation stage could fix it too."
So renaming my anaconda ld linker for the ycm compilation fixed my issue. (I renamed it back afterwards)

Error while installing scikit-learn 19.1 with python 3.8

I am trying to install scikit-learn 19.1 due to some project requirements and it's producing the following error:
1 warning and 15 errors generated.
error: Command "g++ -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c sklearn/cluster/_dbscan_inner.cpp -o build/temp.macosx-10.9-x86_64-3.8/sklearn/cluster/_dbscan_inner.o -MMD -MF build/temp.macosx-10.9-x86_64-3.8/sklearn/cluster/_dbscan_inner.o.d" failed with exit status 1
Python 3.8 is not officially supported by NumPy or scikit-learn yet. We strongly suggest you stick with python 3.7 for now, until you see a 3.8 designation in the "Programming Language" section of the PyPI numpy page (probably several weeks) or until an Anaconda release with Python 3.8 is available (probably several months)
So it looks like it might be the underlying dependencies just not working with 3.8 yet. I actually had a similar issue with another package last week. You will probably have luck if you get a 3.7.5 install. Make sure you get the right platform (x86 for 32-bit, x64 for 64 bit) and make sure you check the box to add it to your path.

gcc cannot find standard libraries on mac (when installing python packages from requirements)

I am having an issue due to my gcc missing standard libraries.
copying blpapi/schema.py -> build/lib.macosx-10.7-x86_64-3.7/blpapi
running build_ext
building 'blpapi._internals' extension
creating build/temp.macosx-10.7-x86_64-3.7
creating build/temp.macosx-10.7-x86_64-3.7/blpapi
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda3/envs/invtools/include -arch x86_64 -I/anaconda3/envs/invtools/include -arch x86_64 -I/usr/local/lib/blpapi_cpp_3.8.1.1/include -I/anaconda3/envs/invtools/include/python3.7m -c blpapi/internals_wrap.cxx -o build/temp.macosx-10.7-x86_64-3.7/blpapi/internals_wrap.o
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
blpapi/internals_wrap.cxx:3101:10: fatal error: 'stdexcept' file not found
#include <stdexcept>
^~~~~~~~~~~
1 warning and 1 error generated.
error: command 'gcc' failed with exit status 1
I had a different issue initially. It was something about cannot find type uint8_t. And someone suggested to delete files in: /usr/local/include/. And that causes the above now. It is because there are no standard libraries now. I installed this /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg and now I have standard lib in /usr/include. Which I copied to /usr/local/indclude/ to no avail. brew link gcc tells me:
Warning: Already linked: /usr/local/Cellar/gcc/8.2.0
To relink: brew unlink gcc && brew link gcc
How do I resolve this issue?

How to build Python 3.4.2 from source in cygwin?

According to the README in the Python 3.4.2 source package compilation on Cygwin should be as easy as this:
./configure
make
make test
sudo make install
However, the make command fails after a while giving me this output (i have gcc 3.4.4):
$ make
gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Werror=declaration-after-statement -I. -IInclude -I./Include -DPy_BUILD_CORE -c ./Modules/signalmodule.c -o Modules/signalmodule.o
...
./Modules/signalmodule.c: In function ‘fill_siginfo’:
./Modules/signalmodule.c:744:5: error: ‘siginfo_t’ has no member named ‘si_band’
Makefile:1645: recipe for target `Modules/signalmodule.o' failed
make: *** [Modules/signalmodule.o] Error 1
I guess there are some dependencies that I need to compile?
Python does not compile out of the box without additional patches.
I was able to compile Python 3.4.2 on cygwin with the following 2 patches:
http://bugs.python.org/file34693/cygwin_si_band.patch
http://bugs.python.org/file28934/0001-CYGWIN-issue13756-Python-make-fail-on-cygwin.patch

Resources