Installing aspell for python 3 on MacOS X - python

I am trying to install aspell for Python 3 (on MacOS X 10.11), and have encountered an issue (the same one) using both pip and the manual installer (by cloning the git repo). I have already installed aspell using MacPorts (sudo port install aspell) as well as the english dictionary (sudo port install aspell-dict-en).
The error is obvious (aspell.h cannot be found), however I have no idea how to fix it.
Any help would be greatly appreciated.
$ sudo python3 setup.3.py build
running build
running build_ext
building 'aspell' extension
/usr/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -pipe -Os -I/opt/local/Library/Frameworks/Python.framework/Versions/3.5/include/python3.5m -c aspell.c -o build/temp.macosx-10.11-x86_64-3.5/aspell.o
aspell.c:53:10: fatal error: 'aspell.h' file not found
#include <aspell.h>
^
1 error generated.
error: command '/usr/bin/clang' failed with exit status 1

Asked the same question on the project's GitHub page. Original can be found here. Copied here for convenience.
In case anybody encounters the same issue, I had installed aspell using MacPorts (sudo port install aspell) and had to include the dir '/opt/local/include', which is where the header file for aspell (aspell.h) was located.
Hence, my setup.3.py looks like this:
module = Extension('aspell',
libraries = ['aspell'],
library_dirs = ['/usr/local/lib/'],
include_dirs = ['/opt/local/include'],
sources = ['aspell.c']
)

Related

Compiling Python3 Project on Macbook. 'stdio.h' file not found error

I was trying to compile Python3 locust tests using bazel but was getting an error during compile. This was the main part of the error:
Compiling with an SDK that doesn't seem to exist: /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk
Please check your Xcode installation
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -g0 -Iext -I/usr/local/opt/python#3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c ext/_parser.c -o build/temp.macosx-11-x86_64-3.9/ext/_parser.o
clang: warning: no such sysroot directory: '/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk' [-Wmissing-sysroot]
In file included from ext/_parser.c:2:
/usr/local/opt/python#3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/Python.h:25:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
I'm compiling on a Macbook Pro (Intel) on Big Sur version 11.6.7.
My solution feels super hacky, and I'll accept another answer if there's a more canonical solution. However, this seems to unblock me.
...
The error noted that the folder /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk was missing. I checked the folder and found that it was indeed missing.
✗ ls /Library/Developer/CommandLineTools/SDKs/
MacOSX.sdk MacOSX10.15.sdk MacOSX11.1.sdk
I did, however, see that the folder MacOSX11.1.sdk existed. So I made a symbolic link to that folder with the name requested in my build...
cd /Library/Developer/CommandLineTools/SDKs/
sudo ln -s MacOSX11.1.sdk MacOSX11.sdk

Unable to execute 'gcc-8': No such file or directory error: command 'gcc-8' failed with exit status 1. PySIT package installation

I am trying to install a package called PySIT to be run with Python, and have followed the instructions on this install page (https://pysit.readthedocs.io/en/latest/install.html) using pip on my terminal to install PySIT.
I am using macOS Catalina for this, and have Anaconda installed on my computer.
This is the output I get on my terminal when I run the command: python setup.py install
gcc-8 -fno-strict-aliasing -I/Users/KBrindha/anaconda2/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/KBrindha/anaconda2/lib/python2.7/site-packages/numpy/core/include -Ipysit/solvers/fd_tools -I/Users/KBrindha/anaconda2/include/python2.7 -c pysit/solvers/constant_density_acoustic/time/scalar/solvers_wrap.cxx -o build/temp.macosx-10.6-x86_64-2.7/pysit/solvers/constant_density_acoustic/time/scalar/solvers_wrap.o -O3 -fopenmp -ffast-math
unable to execute 'gcc-8': No such file or directory
error: command 'gcc-8' failed with exit status 1
Any help on how to bypass this issue or install gcc-8 would be appreciated.
For further information, I have Xcode and Xcode Command Line Tools installed in my computer.
I also have "just" gcc (not gcc-8) installed at /usr/bin/gcc.
The authors inserted fixed names for compilers right into their setup.py. This is a bug and I recommend to report it.
Meanwhile you can clone the repository or download source code, extract it, edit setup.py and remove or replace these fixed names. Then build with the command pip install .

Error when installing mpi4py on Ubuntu instance

I'm trying to install mpi4py on my Ubuntu 18.04 instance. I have python3.6.5 installed.
First I try sudo apt-get build-dep python-mpi4py and I get:
Reading package lists... Done E: You must put some 'source' URIs in
your sources.list
I then try to install simply with pip install mpi4py. I get a long error message and I include some of the most important parts below:
checking for library 'lmpe' ...
/home/ubuntu/anaconda3/envs/tensorflow_p36/bin/mpicc -pthread -B /home/ubuntu/anaconda3/envs/tensorflow_p36/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -c _configtest.c -o _configtest.o
--------------------------------------------------------------------------
The Open MPI wrapper compiler was unable to find the specified compiler
x86_64-conda_cos6-linux-gnu-cc in your PATH.
Note that this compiler was either specified at configure time or in
one of several possible environment variables.
--------------------------------------------------------------------------
failure.
This failure occurs for most libraries. I include just one of the many, and
warning: build_clib: command '/home/ubuntu/anaconda3/envs/tensorflow_p36/bin/mpicc' failed with exit status 1
warning: build_clib: building optional library "vt-mpi" failed
checking for library 'vt-hyb' ...
/home/ubuntu/anaconda3/envs/tensorflow_p36/bin/mpicc -pthread -B /home/ubuntu/anaconda3/envs/tensorflow_p36/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -c _configtest.c -o _configtest.o
--------------------------------------------------------------------------
The Open MPI wrapper compiler was unable to find the specified compiler
x86_64-conda_cos6-linux-gnu-cc in your PATH.
Note that this compiler was either specified at configure time or in
one of several possible environment variables.
Running which mpcc gives:
(tensorflow_p36) ubuntu#ip-172-31-35-200:~$ which mpicc
/home/ubuntu/anaconda3/envs/tensorflow_p36/bin/mpicc
How can I add the specified compiler x86_64-conda_cos6-linux-gnu-cc to my PATH in order to resolve this error?
Simply run:
conda install -c anaconda mpi4py as shown here.
Also, a helpful comment by Lidandro Dalcin:
I guess you are missing the mpich-mpicc package, this one is a
metapackage that depends in the right compiler. Why are you installing
mpi4py with pip? Maybe all you need is to conda install mpi4py
(available in the conda-forge channel) ?

'sdkddkver.h' file not found in pip install MetaTrader5

It happens when i tried to use command "pip install MetaTrader5" on Python 3. I'm using Mac OS. Is there compability issue here?. Because when i tried that pip install command. it throws error :
building 'MetaTrader5.C' extension
creating build/temp.macosx-10.13-x86_64-3.7
creating build/temp.macosx-10.13-x86_64-3.7/src
creating build/temp.macosx-10.13-x86_64-3.7/src/Interprocess
creating build/temp.macosx-10.13-x86_64-3.7/src/Connector
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -DUNICODE -Isrc -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/Users/galihlarasprakoso/Projects/Python/MetaTraderBot/venv/include -I/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/MetaTrader.cpp -o build/temp.macosx-10.13-x86_64-3.7/src/MetaTrader.o
In file included from src/MetaTrader.cpp:6:
src/stdafx.h:16:10: fatal error: 'sdkddkver.h' file not found
#include <sdkddkver.h>
^~~~~~~~~~~~~
1 error generated.
error: command 'clang' failed with exit status 1
----------------------------------------
I believe you're working with a linux machine. Seems to me like the package was built specifically for windows environment.
Related:
SDKDDKVer.h missing, but WinSDK installed? (c++ header issues)
https://github.com/AudioNet/node-core-audio/issues/4

Pybluez installation in Linux

I am trying to install PyBluez-0.18 on my Linux Mint 15 machine, but got an error message during the installation process. I tried searching online to see if others might have encountered this problem, but I could not find any.
I list the command I tried to execute, along with the error message I received. Could someone tell me what I am doing wrong, and what I need to do to reso
tri108354#prtgc004-Latitude-E6320 ~/Downloads/PyBluez-0.18 $ python setup.py install
running install
running build
running build_py
running build_ext
building 'bluetooth._bluetooth' extension
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/tri108354/anaconda/include/python2.7 -c bluez/btmodule.c -o build/temp.linux-i686-2.7/bluez/btmodule.o
In file included from bluez/btmodule.c:20:0:
bluez/btmodule.h:5:33: fatal error: bluetooth/bluetooth.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
You need to install libbluetooth-dev package for compiling your code
sudo apt-get install libbluetooth-dev
That should install the bluetooth header files.

Categories