OpenSUSE Leap 42.1, python 2.7.9, pip 8.1.2
I wanna install Tushare, but the terminal told me there was no lxml. Then I use sudo zypper in libxml2 first,but when I want to install "lxml" with lxml-3.6.1.tar.gz downloaded from the official website. It returns:
compilation terminated.
Compile failed: command 'gcc' failed with exit status 1
cc -I/usr/include/libxml2 -c /tmp/xmlXPathInitVXdVTQ.c -o tmp/xmlXPathInitVXdVTQ.o
/tmp/xmlXPathInitVXdVTQ.c:1:26: fatal error: libxml/xpath.h: no such files or directory
#include "libxml/xpath.h"
^
compilation terminated.
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
error: command 'gcc' failed with exit status 1
I've installed 'gcc' before. Then How can I deal with this problem?
And How should I find the keys to such problems in the future?
Thanks a lot
You need to install the development library, most likely called libxml2-dev or libxml2-devel in order to compile against the required header (.h) files.
Related
I've been trying to use the speech recognition library in a PyCharm virtual environment on Mac, but I need to install PyAudio for it to work.
When I try to install it it gives me this error (this is only the end of the error)
src/pyaudio/device_api.c:9:10: fatal error: 'portaudio.h' file not found
#include "portaudio.h"
^~~~~~~~~~~~~
1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
----------------------------------------
ERROR: Failed building wheel for pyaudio
Failed to build pyaudio
ERROR: Could not build wheels for pyaudio which use PEP 517 and cannot be installed directly
The tutorials I have watched have told me to use homebrew but I don't want to install it.
Is there any method to install it without homebrew?
I'm trying to install Flask-SimpleLDAP on a Windows machine so I can use Active Directory for authentication for a Dash app I have created.
I'm following this article - https://towardsdatascience.com/a-simple-way-to-integrate-dash-with-ldap-4d5d059ee3a6
The install is failing when it tries to build the wheel for "python-ldap", with the errors:
Building wheel for python-ldap (setup.py) ... error
ERROR: Command errored out with exit status 1:
C:\Users\canderson\AppData\Local\Temp\pip-install-zixltin3\python-ldap\Modules\common.h(15): fatal error C1083: Cannot open include file: 'lber.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Failed building wheel for python-ldap
I tried installing with both pip and pip3 with the same result, using the commands:
pip3 install flask-simpleldap
pip install flask-simpleldap
As a workaround I tried installing python3-ldap which installed no problem though it didn't help with the install of Flask-SimpleLDAP as the original (python-ldp) package is bundled into the install.
Do any of you know of a workaround for this or if there is another more freidnly version of Flask-SimpleLDAP available?
I have a 'requirements.txt' file and I pip install it. And continue to get these errors:
Cryptography_cffi_a269d620xd5c405b7.c:217:10: fatal error: 'openssl/aes.h' file not found
#include <openssl/aes.h>
^
1 error generated.
error: command 'clang' failed with exit status 1
And this error:
fatal error: 'libxml/xmlversion.h' file not found
#include "libxml/xmlversion.h"
^
1 error generated.
error: command 'clang' failed with exit status 1
after trying https://github.com/pyca/cryptography/issues/2350
I did two things to fix this.
brew link --force openssl
and
xcode-select --install
Now, unfortunately, we can't brew link --force openssl. So you can also set environment variables like below:
export LD_LIBRARY_PATH=/usr/local/opt/openssl/lib:$LD_LIBRARY_PATH
export CPATH=/usr/local/opt/openssl/include:$LD_LIBRARY_PATH
And do pip install.
If I pip install cffi, I get this:
building '_cffi_backend' extension
c:\mingw\bin\gcc.exe -mdll -O -Wall -Ic/libffi_msvc -IC:\python27\include -IC:\python27\PC -c c/_cffi_backend.c -o build\temp.win32-2.7\Release\c\_cffi_backend.o
...
(lots of warnings)
...
c/libffi_msvc\win32.c: In function 'ffi_call_x86':
c/libffi_msvc\win32.c:48:2: error: '_asm' undeclared (first use in this function)
c/libffi_msvc\win32.c:48:2: note: each undeclared identifier is reported only once for each function it appears in
c/libffi_msvc\win32.c:48:7: error: expected ';' before '{' token
c/libffi_msvc\win32.c:162:1: warning: control reaches end of non-void function [-Wreturn-type]
error: command 'gcc' failed with exit status 1
This is using MinGW obviously.
I also tried installing from the wheel here:
pip install https://pypi.python.org/packages/cp27/c/cffi/cffi-0.8.6-cp27-none-win32.whl#md5=aedc78351af65c4f514df0f2812473eb
I get the following strange error:
Downloading/unpacking https://pypi.python.org/packages/cp27/c/cffi/cffi-0.8.6-cp27-none-win32.whl
Downloading cffi-0.8.6-cp27-none-win32.whl (77kB): 77kB downloaded
Running setup.py egg_info for package from https://pypi.python.org/packages/cp27/c/cffi/cffi-0.8.6-cp27-none-win32.whl
Traceback (most recent call last):
File "<string>", line 16, in <module>
IOError: [Errno 2] No such file or directory: 'c:\\users\\me\\appdata\\local\\temp\\pip-nkx4aq-build\\setup.py'
And in fact when I look in that (temp) pip-nkx4aq-build directory, I see that there is no setup.py there.
So, my question simply is, why would this fail, and what do I need to do to install cffi on Windows?
It is known not to work, contributions welcome:
https://bitbucket.org/cffi/cffi/issue/159/python-setuppy-install-fails-with-mingw
You can download the cffi binary package and install, link address below:
http://www.lfd.uci.edu/~gohlke/pythonlibs/
Two steps -
run this command - sudo apt-get install libffi-dev (on Ubuntu and Debian)
pip install cffi
After installing xcode I executed pip install Pillow and the last code strings say:
In file included from _imagingtk.c:19:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/tk.h:78:11: fatal error: 'X11/Xlib.h' file not found
In file included from Tk/tkImaging.c:52:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/tk.h:78:11: fatal error: 'X11/Xlib.h' file not found
# include <X11/Xlib.h>
^
1 error generated.
1 error generated.
Building using 4 processes
cc -bundle -undefined dynamic_lookup -arch x86_64 -arch i386 -Wl,-F. build/temp.macosx-10.9-intel-2.7/_imagingtk.o build/temp.macosx-10.9-intel-2.7/Tk/tkImaging.o -L/System/Library/Frameworks/Python.framework/Versions/2.7/lib -L/usr/X11/lib -L/usr/lib -o build/lib.macosx-10.9-intel-2.7/PIL/_imagingtk.so -framework Tcl -framework Tk
clang: error: no such file or directory: 'build/temp.macosx-10.9-intel-2.7/_imagingtk.o'
clang: error: no such file or directory: 'build/temp.macosx-10.9-intel-2.7/Tk/tkImaging.o'
error: command 'cc' failed with exit status 1
----------------------------------------
Command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build/Pillow/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-YMhwsU-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip-build/Pillow
Storing complete log in /var/root/Library/Logs/pip.log
The actual problem is that Xcode's Command Line Tools is missing. To fix it, just run
xcode-select --install
on your terminal. A dialog will pop up, accept and Xcode's CLT will be installed.
See it here.
Did you uninstall PIL first?
Try:
pip uninstall pil
pip uninstall pillow
brew install libtiff libjpeg webp little-cms2
pip install pillow
See https://pillow.readthedocs.io/en/stable/installation.html for more information.
PIL is deprecated, use Pillow instead.
To install Pillow:
pip install Pillow
Install XQuartz.
X (or X11) is a (the default) *nix window system, which some *nix software that can be compiled on a Mac relies upon.
The problem appears to be that PIL and Pillow appear to assume you want Tk(inter), which in turns relies on X. If you don't want fancy dialog stuff for your image processing, there should be a way to turn that off, though that may require a manual installation.
Alternatively, perhaps this answer may be of use; but that still requires X to be installed, and just fixes a bad link.
Installing SDK headers worked for me
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
For more information see https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes#3035624