My Mac updated recently and I noticed that readline functionality was missing in Python. I tried to reinstall it and got a cryptic error, which I cannot decode. I have already uninstalled and reinstalled XCode, and am at a loss.
The installation is a simple: pip install readline
and (part of) the error is:
Beginning configuration for readline-6.2 for i386-apple-darwin20.6.0
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking for C compiler default output file name...
configure: error: in `/private/var/folders/gv/vxf1pd9x3mxc320ld73kkjfw0000gp/T/pip-install-eih2gt76/readline_fb5900c159cc42958f966f55a49321bf/rl/readline-lib':
configure: error: C compiler cannot create executables
See `config.log' for more details.
...
5 warnings generated.
creating build/lib.macosx-10.9-x86_64-cpython-38
gcc -bundle -undefined dynamic_lookup -L/Users/david/opt/miniconda3/lib -L/Users/david/opt/miniconda3/lib build/temp.macosx-10.9-x86_64-cpython-38/Modules/3.x/readline.o readline/libreadline.a readline/libhistory.a -lncurses -o build/lib.macosx-10.9-x86_64-cpython-38/readline.cpython-38-darwin.so -arch i386 -arch x86_64
clang: error: no such file or directory: 'readline/libreadline.a'
clang: error: no such file or directory: 'readline/libhistory.a'
error: command '/usr/bin/gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> readline
The answer for me was reinstalling a package called ncurses, which had become corrupt. Hopefully this helps someone else.
Related
I am trying to install wordcloud.
I tried it installing through the interpreter. The error is long, but the last part of the error is:-
wordcloud/query_integral_image.c:196:12: fatal error: 'longintrepr.h' file not found
#include "longintrepr.h"
^~~~~~~~~~~~~~~
1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> wordcloud
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
and suggestions are:-
Troubleshooting steps:-
1. Try reading PyCharm guide on troubleshooting package installation.
2. Try installing this package by running the following commands in the terminal:-
source /Users/apple/PycharmProjects/pythonProject4/venv/bin/activate pip install wordcloud
When I try installing it using the above command on the terminal, it shows error (last part of the error):-
running build_ext
creating build/temp.macosx-10.9-universal2-3.11
creating build/temp.macosx-10.9-universal2-3.11/wordcloud
clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -I/Users/apple/PycharmProjects /pythonProject4/venv/include -I/Library/Frameworks/Python.framework/Versions/3.11/include /python3.11 -c wordcloud/query_integral_image.c -o build/temp.macosx-10.9-universal2-3.11 /wordcloud/query_integral_image.o
wordcloud/query_integral_image.c:196:12: fatal error: 'longintrepr.h' file not found
#include "longintrepr.h"
^~~~~~~~~~~~~~~
1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> wordcloud
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
(venv) Apples-MacBook-Air:~ apple$
How to install it ?
I am trying to install qutip on a Mac (Catalina 10.15.6). I am using:
Python 3.8.3
Anaconda 4.8.4
I create a virtual environment with the command conda create -n qutip python=3.8 anaconda. Here's the error message:
g++ -bundle -undefined dynamic_lookup -
L/usr/local/anaconda3/envs/qutip/lib -arch x86_64 -L/usr/local/anaconda3/envs/qutip/lib -arch x86_64 /usr/local/opt/readline/include -arch x86_64 build/temp.macosx-10.9-x86_64-3.7/qutip/cy/spmatfuncs.o build/temp.macosx-10.9-x86_64-3.7/qutip/cy/src/zspmv.o -o build/lib.macosx-10.9-x86_64-3.7/qutip/cy/spmatfuncs.cpython-37m-darwin.so -mmacosx-version-min=10.9
ld: can't map file, errno=22 file '/usr/local/opt/readline/include' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'g++' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for qutip
Failed to build qutip
ERROR: Could not build wheels for qutip which use PEP 517 and cannot be installed directly
I looked around and I don't see anything recent for this. I tried to install qutip from source and I got the same error. Does anyone have any thoughts? Thank you.
How can I build Python with Clang on Mac OS X? Mavericks already comes with Python 2.7 installed. The reason I'm asking is because I am having issues trying to install PyLucene and it's possibly because Python was compiled with something other than Clang, while JCC as part of PyLucene needs to be compiled with Clang.
i see your problem now. when building jcc,
clang++ -Wl,-x -dynamiclib -undefined dynamic_lookup build/temp.macosx-10.9-x86_64-2.7/jcc/sources/jcc.o build/temp.macosx-10.9-x86_64-2.7/jcc/sources/JCCEnv.o -o build/lib.macosx-10.9-x86_64-2.7/libjcc.dylib -L/Library/Java/JavaVirtualMachines/jdk1.7.0_40.jdk/Contents/Home/jre/lib -ljava -L/Library/Java/JavaVirtualMachines/jdk1.7.0_40.jdk/Contents/Home/jre/lib/server -ljvm -Wl,-rpath -Wl,/Library/Java/JavaVirtualMachines/jdk1.7.0_40.jdk/Contents/Home/jre/lib -Wl,-rpath -Wl,/Library/Java/JavaVirtualMachines/jdk1.7.0_40.jdk/Contents/Home/jre/lib/server -Wl,-S -install_name #rpath/libjcc.dylib -current_version 2.21 -compatibility_version 2.21
ld: internal error: atom not found in symbolIndex(__ZN7JNIEnv_13CallIntMethodEP8_jobjectP10_jmethodIDz) for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang++' failed with exit status 1
actually this is a known issue, and the solution is here
-x link flag causing link errors on Mac OSX 10.9 (bug?)
just run the above clang++ command without the "-x" in the same directory. and then run the "python setup.py build" again...
I am trying to install the python package biopython from source on my Macbook pro OSX 10.9.4,
I run python setup.py build in the terminal and receive this
running build
running build_py
running build_ext
building 'Bio.cpairwise2' extension
Compiling with an SDK that doesn't seem to exist: /Developer/SDKs/MacOSX10.6.sdk
Please check your Xcode installation
gcc -DNDEBUG -g -O3 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -Qunused-arguments -Qunused-arguments -I/Applications/Canopy.app/appdata/canopy-1.4.1.1975.macosx-x86_64/Canopy.app/Contents/include/python2.7 -c Bio/cpairwise2module.c -o build/temp.macosx-10.6-x86_64-2.7/Bio/cpairwise2module.o
clang: warning: no such sysroot directory: '/Developer/SDKs/MacOSX10.6.sdk'
In file included from Bio/cpairwise2module.c:12:
/Applications/Canopy.app/appdata/canopy-1.4.1.1975.macosx- x86_64/Canopy.app/Contents/include/python2.7/Python.h:33:10: fatal error:
'stdio.h' file not found
#include <stdio.h>
^
1 error generated.
error: command 'gcc' failed with exit status 1
I checked that Xcode should be properly installed and working
You should be using pip. Try:
pip install biopython
Uninstalled Canopy and everything worked like a charm...
Try installing the Biopython version available from the Canopy "Package Manager" > "Available Packages" > "Canopy Packages".
This way, I seem to have solved a similar problem while installing Pyensembl, that also installs Biopython.
I'm trying to install a python wrapper over constraint programming library Gecode called python-gecode
https://pypi.python.org/pypi/gecode-python/
No matter how I install it I get same error "No such file or directory". Here is setup script output:
running install
running build
running build_py
running build_ext
building 'gecode._gecode' extension
C:\MinGW32-xy\bin\gcc.exe -mno-cygwin -mdll -O -Wall -DDISJUNCTOR "-IC:\Program Files\Gecode\include" -IC:\Python27\include -IC:\Python27\PC -c _gecode.cc -o build\temp.win32-2.7\Release\_gecode.o
_gecode.cc:5:24: fatal error: 4.2.1: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1"
But the _gecode.cc is there in the folder. I don't really understand what's the problem. I tried installing with pip, easy_install, manual install and everytime I get this error.
Any ideas what's causing it?
Thanks!
Gecode-Python supports only up to version 4.0.0 of Gecode, so use that version instead of 4.2.1.