How to install pynbody on MacOS - python

I am trying to install the pynbody package for python.
I run pip3 install pynbody, but the command fails.
It says:
ERROR: Could not build wheels for pynbody which use PEP 517 and cannot be installed directly
Before it gives the error:
error: Command "/usr/local/bin/gcc-10 -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/private/var/folders/5q/xc22bbms0qjdgmpsv2188ydh0000gn/T/pip-build-env-q66c57aj/overlay/lib/python3.9/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c pynbody/gravity/_gravity.c -o build/temp.macosx-10.9-x86_64-3.9/pynbody/gravity/_gravity.o -fopenmp" failed with exit status 1
I have MacOS 11.0.1 and python 3.9.0 and pip 20.2.4.
I can install other packages via pip such as numpy.
How can I install pynbody on MacOS?
(The same procedure worked on ubuntu.)
The Xcode developer tools are installed.

Related

Unable to install sklearn on macOS

Hi i've trie to install sklearn on macOS but i'm getting an error :
error: Command "gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DUSE_VENDOR_BLAS=1 -Iscipy/sparse/linalg/dsolve/SuperLU/SRC -I/private/var/folders/8x/7jm2njhs7wb7vny_wchsj_q80000gn/T/pip-build-env-95_yvt7g/overlay/lib/python3.9/site-packages/numpy/core/include -c scipy/sparse/linalg/dsolve/SuperLU/SRC/clacon2.c -o build/temp.macosx-10.9-x86_64-3.9/scipy/sparse/linalg/dsolve/SuperLU/SRC/clacon2.o -MMD -MF build/temp.macosx-10.9-x86_64-3.9/scipy/sparse/linalg/dsolve/SuperLU/SRC/clacon2.o.d" failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for scipy
Failed to build scipy
ERROR: Could not build wheels for scipy which use PEP 517 and cannot be installed directly
I'm using python 3.9 and pip 20.2.4 .
According to your error, there is some problem in scipy
Solution
try removing Scipy and again Reinstalling Scipy
references
Scipy Documentation
recent releases
Scipy Pypi

'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

install pyaudio with macOs Sierra

I upgraded my Mac to macOS Sierra and I had to start a new account. Right now I am trying to establish my environment. I ran into a problem installing pyaudio. The procedure I used is first use homebrew and install port audio.
brew install portaudio
It installs with no errors.
I proceed to install pyaudio using pip
pip install pyaudio
I receive the following error message.
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -DMACOSX=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/_portaudiomodule.c -o build/temp.macosx-10.12-intel-2.7/src/_portaudiomodule.o
src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found
#include "portaudio.h"
^
1 error generated.
error: command 'cc' failed with exit status 1
portaudio.h is available in /usr/local/Cellar/portaudio/19.20140130/include
I am unfamiliar with pip and don't know how to pass the path to the complier.
Any help will be greatly appreciated.
thanks
Rod
Thanks for the suggestion. I tried it but it did not work.
It seems pip is not finding both include files and libraries when attempting to install in macOS Sierra
I did some digging into how to pass paths with pip and I successfully installed pyaudio using the following command.
sudo python3 -B -u -m pip -v install --no-warn-script-location --no-cache-dir --global-option=build_ext --global-option="-I$(brew --prefix portaudio)/include" --global-option="-L$(brew --prefix portaudio)/lib" pyaudio
Please try the command below.
sudo CPATH="$CPATH:/usr/local/include" LIBRARY_PATH="$LIBRARY_PATH:/usr/local/lib" pip install pyaudio
You can add the directory to your CPATH. Try:
CPATH="$CPATH:/usr/local/Cellar/portaudio/19.20140130/include"
pip install pyaudio

aspell-python installation error

I am trying to install aspell-python package for spell correction.
Facing problem while installing the package.
Error :
python setup.py install
running install
running build
running build_ext
building 'aspell' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c aspell.c -o build/temp.linux-i686-2.7/aspell.o
aspell.c:53:20: fatal error: aspell.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
GCC is already install version gcc (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2
libaspell15 is already install
Need to install sudo apt-get install libaspell-dev

Error installing basemap on mac

I followed these steps to install the GEOS libraries (source ). I successfully installed the GEOS library. My problem is in the following step:
cd back to the top level basemap directory (basemap-X.Y.Z) and
run the usual 'python setup.py install'. Check your installation
by running "from mpl_toolkits.basemap import Basemap" at the python
prompt.
When I run the setup.py file I get the following error:
distutils.errors.CompileError: Command "gcc-4.2 -fno-strict-aliasing -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Isrc -c nad2bin.c -o nad2bin.o" failed with exit status 127
Im working with a Mac with OS version 10.9.2.
I have installed the gcc compiler through the command line tools package in Xcode.
My gcc compiler info:
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix

Categories