Cannot install accumulation-tree - python

Why do I always get this error when I try to install accumulation-tree? I need this for optbinning. A similar package would also be a solution.
ERROR: Command errored out with exit status 1:
command: /Users/elisaderoo/opt/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/yc/59hh1mg16c90lpnfsfvwcnf80000gn/T/pip-install-29thp5kc/accumulation-tree/setup.py'"'"'; __file__='"'"'/private/var/folders/yc/59hh1mg16c90lpnfsfvwcnf80000gn/T/pip-install-29thp5kc/accumulation-tree/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/yc/59hh1mg16c90lpnfsfvwcnf80000gn/T/pip-wheel-4djg7a0d
cwd: /private/var/folders/yc/59hh1mg16c90lpnfsfvwcnf80000gn/T/pip-install-29thp5kc/accumulation-tree/
Complete output (19 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.8
creating build/lib.macosx-10.9-x86_64-3.8/accumulation_tree
copying accumulation_tree/treeslice.py -> build/lib.macosx-10.9-x86_64-3.8/accumulation_tree
copying accumulation_tree/__init__.py -> build/lib.macosx-10.9-x86_64-3.8/accumulation_tree
copying accumulation_tree/abctree.py -> build/lib.macosx-10.9-x86_64-3.8/accumulation_tree
running build_ext
cythoning accumulation_tree/accumulation_tree.pyx to accumulation_tree/accumulation_tree.c
/Users/elisaderoo/opt/anaconda3/lib/python3.8/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /private/var/folders/yc/59hh1mg16c90lpnfsfvwcnf80000gn/T/pip-install-29thp5kc/accumulation-tree/accumulation_tree/accumulation_tree.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
building 'accumulation_tree.accumulation_tree' extension
creating build/temp.macosx-10.9-x86_64-3.8
creating build/temp.macosx-10.9-x86_64-3.8/accumulation_tree
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/elisaderoo/opt/anaconda3/include -arch x86_64 -I/Users/elisaderoo/opt/anaconda3/include -arch x86_64 -I/Users/elisaderoo/opt/anaconda3/include/python3.8 -c accumulation_tree/accumulation_tree.c -o build/temp.macosx-10.9-x86_64- 3.8/accumulation_tree/accumulation_tree.o
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for accumulation-tree

This error might be due to not having Cython installed. Alternatively, you can clone the repository from GitHub, remove the dependency tdigest from the list of install_requires in setup.py, and install from the source using python setup.py install.

Try running (in a terminal window)
xcode-select –install
(and clicking through dialog)
If that doesn't work try:
sudo xcode-select --reset
Several links show this problem in other contexts (e.g.)
https://developer.apple.com/forums/thread/673827
Fatal Error (invalid active developer path ) After Upgrading R / R Studio

you may not have installed gfortran
first try to install it
sudo apt install gfortran

Related

PyAudio installation always fails on Mac

Firstly, I tried
pip install pyaudio
But that didn't work... I found that I need PortAudio, so installed it with brew:
brew install portaudio
That worked and then I restarted my Mac.
But pip install pyaudio still doesn't work and I get the below error message:
ERROR: Command errored out with exit status 1:
command: /Applications/Xcode.app/Contents/Developer/usr/bin/python3 -u -c
'import sys, setuptools, tokenize; sys.argv[0] =
'"'"'/private/var/folders/12/44t6pktj77xbqmyp7x368tdr0000gn/T/pip-install-gvxfbjmp/pyaudio/setup.py'"'"';
file='"'"'/private/var/folders/12/44t6pktj77xbqmyp7x368tdr0000gn/T/pip-install-gvxfbjmp/pyaudio/setup.py'"'"';f=getattr(tokenize,
'"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"',
'"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))'
bdist_wheel -d
/private/var/folders/12/44t6pktj77xbqmyp7x368tdr0000gn/T/pip-wheel-gvmpobvy
cwd: /private/var/folders/12/44t6pktj77xbqmyp7x368tdr0000gn/T/pip-install-gvxfbjmp/pyaudio/
Complete output (16 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.14-x86_64-3.7
copying src/pyaudio.py -> build/lib.macosx-10.14-x86_64-3.7
running build_ext
building '_portaudio' extension
creating build/temp.macosx-10.14-x86_64-3.7
creating build/temp.macosx-10.14-x86_64-3.7/src
xcrun -sdk macosx clang -arch x86_64 -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders
-iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/Headers
-DMACOSX=1 -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/include/python3.7m
-c src/_portaudiomodule.c -o build/temp.macosx-10.14-x86_64-3.7/src/_portaudiomodule.o
src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found
#include "portaudio.h"
^~~~~~~~~~~~~
1 error generated.
error: command 'xcrun' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for pyaudio
I also tried pip3 install pyaudio without any luck.
BTW I am just doing this because I want to use the Python Speech Recognition API and I think pyaudio is necessary... is it?
Very likely you need to specify the directory path where the compiler can find the source programs like portaudio.h.
Under assumption that the headers are in /usr/local/include directory, try to run the below command in the Terminal:
pip install --global-option='build_ext' --global-option='-I/usr/local/include' --global-option='-L/usr/local/lib' pyaudio
your problem is that with the Xcode command-line. Reinstall using this
xcode-select --install
after xcode is fixed the command('xcrun') should be able to run so just reuse
pip3 install pyaudio
you may need to upgrade pip
python3 -m pip install --upgrade pip
-- Successfully installed pip-21.2.4
and/or invoke pip3
pip3 install ...

Running setup.py install for regex ... error is driving me crazy

I am begging for help! I cannot get anything to work in anaconda anymore and I am trying to resolve it since days. I get the following error when I try to install several packages:
Building wheel for regex (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /opt/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/wc/1pgwt_g16sn0026xr90vh_x80000gn/T/pip-install-6dc2clpx/regex/setup.py'"'"'; __file__='"'"'/private/var/folders/wc/1pgwt_g16sn0026xr90vh_x80000gn/T/pip-install-6dc2clpx/regex/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/wc/1pgwt_g16sn0026xr90vh_x80000gn/T/pip-wheel-r01lufl5
cwd: /private/var/folders/wc/1pgwt_g16sn0026xr90vh_x80000gn/T/pip-install-6dc2clpx/regex/
Complete output (17 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.7
creating build/lib.macosx-10.9-x86_64-3.7/regex
copying regex_3/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/regex
copying regex_3/regex.py -> build/lib.macosx-10.9-x86_64-3.7/regex
copying regex_3/_regex_core.py -> build/lib.macosx-10.9-x86_64-3.7/regex
copying regex_3/test_regex.py -> build/lib.macosx-10.9-x86_64-3.7/regex
running build_ext
building 'regex._regex' extension
creating build/temp.macosx-10.9-x86_64-3.7
creating build/temp.macosx-10.9-x86_64-3.7/regex_3
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/opt/anaconda3/include -arch x86_64 -I/opt/anaconda3/include -arch x86_64 -I/opt/anaconda3/include/python3.7m -c regex_3/_regex.c -o build/temp.macosx-10.9-x86_64-3.7/regex_3/_regex.o
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for regex
I tried everything. I uninstalled anaconda, I tried pip install regex NOTHING works. I am desperate. I cannot work since days. Please help me.
Make sure regex version is up to date in requirements.txt. For me it works when I set regex==2022.3.2.

MACOS python package installation problem

I'm trying to install "supplychainpy" package for python but i get a gcc error. "error: command 'gcc' failed with exit status 1"
Yes, I have installed the xcode devtools xcode-select --install
Yes, I'm sure gcc is present gcc --version
Yes, my pip is up to date pip install --upgrade pip
Yes, I have gcc installed (with brew install gcc).
Yes i have anaconda package installed with all the dependancies.
This does not help. This is the output i get:
running build_ext
building 'supplychainpy.simulations.sim_summary' extension
creating build/temp.macosx-10.7-x86_64-3.7
creating build/temp.macosx-10.7-x86_64-3.7/supplychainpy
creating build/temp.macosx-10.7-x86_64-3.7/supplychainpy/simulations
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda3/include -arch x86_64 -I/anaconda3/include -arch x86_64 -I/anaconda3/include/python3.7m -c supplychainpy/simulations/sim_summary.c -o build/temp.macosx-10.7-x86_64-3.7/supplychainpy/simulations/sim_summary.o
supplychainpy/simulations/sim_summary.c:6785:34: warning: variable '__pyx_v_f' is uninitialized when used here [-Wuninitialized]
__pyx_t_1 = PyFloat_FromDouble(__pyx_v_f); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error)
^~~~~~~~~
supplychainpy/simulations/sim_summary.c:6771:18: note: initialize the variable '__pyx_v_f' to silence this warning
float __pyx_v_f;
^
= 0.0
supplychainpy/simulations/sim_summary.c:8290:65: error: too many arguments to function call, expected 3, have 4
return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/stddef.h:105:16: note: expanded from macro 'NULL'
# define NULL ((void*)0)
^~~~~~~~~~
1 warning and 1 error generated.
error: command 'gcc' failed with exit status 1
Failed building wheel for supplychainpy
Running setup.py clean for supplychainpy
Failed to build supplychainpy
Installing collected packages: supplychainpy
Running setup.py install for supplychainpy ... error
Complete output from command /anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/m2/c5429khn3pj5581m817y69qc0000gn/T/pip-install-nrjs0muv/supplychainpy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/m2/c5429khn3pj5581m817y69qc0000gn/T/pip-record-md9iewfc/install-record.txt --single-version-externally-managed --compile:
The problem may be the gcc compiler config. You can download the compiled .whl
file from https://pypi.org/project/supplychainpy/#files. Note that *-macosx_10_6_x86_64.whl files are for macosx.

installing pyaudio on mac

I am trying to install pyaudio on my system.
System Specification: macOS Mojava
Version: 10.14.2 (18C54)
Error that I am getting is this:
Collecting pyaudio
Using cached https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz
Building wheels for collected packages: pyaudio
Running setup.py bdist_wheel for pyaudio ... error
Complete output from command /Users/dsnanaware/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/r7/64j7w40s1fn8bmdkblq1pbym0000gn/T/pip-install-yro3wf2m/pyaudio/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /private/var/folders/r7/64j7w40s1fn8bmdkblq1pbym0000gn/T/pip-wheel-3d4sruhv --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.7-x86_64-3.6
copying src/pyaudio.py -> build/lib.macosx-10.7-x86_64-3.6
running build_ext
building '_portaudio' extension
creating build/temp.macosx-10.7-x86_64-3.6
creating build/temp.macosx-10.7-x86_64-3.6/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/dsnanaware/anaconda3/include -arch x86_64 -I/Users/dsnanaware/anaconda3/include -arch x86_64 -DMACOSX=1 -I/Users/dsnanaware/anaconda3/include/python3.6m -c src/_portaudiomodule.c -o build/temp.macosx-10.7-x86_64-3.6/src/_portaudiomodule.o
src/_portaudiomodule.c:27:19: fatal error: stdio.h: No such file or directory
#include <stdio.h>
^
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Failed building wheel for pyaudio
Running setup.py clean for pyaudio
Failed to build pyaudio
Installing collected packages: pyaudio
Running setup.py install for pyaudio ... error
Complete output from command /Users/dsnanaware/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/r7/64j7w40s1fn8bmdkblq1pbym0000gn/T/pip-install-yro3wf2m/pyaudio/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/r7/64j7w40s1fn8bmdkblq1pbym0000gn/T/pip-record-4xqsbegf/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.7-x86_64-3.6
copying src/pyaudio.py -> build/lib.macosx-10.7-x86_64-3.6
running build_ext
building '_portaudio' extension
creating build/temp.macosx-10.7-x86_64-3.6
creating build/temp.macosx-10.7-x86_64-3.6/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/dsnanaware/anaconda3/include -arch x86_64 -I/Users/dsnanaware/anaconda3/include -arch x86_64 -DMACOSX=1 -I/Users/dsnanaware/anaconda3/include/python3.6m -c src/_portaudiomodule.c -o build/temp.macosx-10.7-x86_64-3.6/src/_portaudiomodule.o
src/_portaudiomodule.c:27:19: fatal error: stdio.h: No such file or directory
#include <stdio.h>
^
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/Users/dsnanaware/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/r7/64j7w40s1fn8bmdkblq1pbym0000gn/T/pip-install-yro3wf2m/pyaudio/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/r7/64j7w40s1fn8bmdkblq1pbym0000gn/T/pip-record-4xqsbegf/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/r7/64j7w40s1fn8bmdkblq1pbym0000gn/T/pip-install-yro3wf2m/pyaudio/
Method that I have tried to fix this:
brew install portaudio
pip install pyaudio
But even after trying this I am getting the same error.
Can anyone help me with this error??
Thank You !!
Solution:
brew update
brew install portaudio
brew link --overwrite portaudio
pip install pyaudio
https://medium.com/#moon_is_beautiful/when-cant-install-pyaudio-with-pip-190973840dbf
For me, it worked following this Gist
https://gist.github.com/jiaaro/9767512210a1d80a8a0d
Install portaudio using homebrew (or method of your choice)
brew install portaudio
create $HOME/.pydistutils.cfg using the include and lib directories of your portaudio install:
[build_ext]
include_dirs=/Users/jrobert1271/homebrew/Cellar/portaudio/19.20140130/include/
library_dirs=/Users/jrobert1271/homebrew/Cellar/portaudio/19.20140130/lib/
Then in your virtualenv:
pip install --global-option='build_ext' --global-option='-I/usr/local/include' --global-option='-L/usr/local/lib' pyaudio

Installing pyaudio with pip in a virtualenv

I'm trying to install pyaudio with pip:
pip install pyaudio
In a virtualenv but I'm getting an error:
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Entire output:
Collecting pyaudio
Using cached PyAudio-0.2.9.tar.gz
Building wheels for collected packages: pyaudio
Running setup.py bdist_wheel for pyaudio ... error
Complete output from command /home/mertyildiran/Downloads/VirtualEnvironment/vir1/Cerebrum/ENV/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-GCltlv/pyaudio/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpyR6J73pip-wheel- --python-tag cp27:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying src/pyaudio.py -> build/lib.linux-x86_64-2.7
running build_ext
building '_portaudio' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c src/_portaudiomodule.c -o build/temp.linux-x86_64-2.7/src/_portaudiomodule.o
src/_portaudiomodule.c:29:23: fatal error: portaudio.h: No such file or directory
#include "portaudio.h"
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Failed building wheel for pyaudio
Running setup.py clean for pyaudio
Failed to build pyaudio
Installing collected packages: pyaudio
Running setup.py install for pyaudio ... error
Complete output from command /home/mertyildiran/Downloads/VirtualEnvironment/vir1/Cerebrum/ENV/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-GCltlv/pyaudio/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-icMIUV-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/mertyildiran/Downloads/VirtualEnvironment/vir1/Cerebrum/ENV/include/site/python2.7/pyaudio:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying src/pyaudio.py -> build/lib.linux-x86_64-2.7
running build_ext
building '_portaudio' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c src/_portaudiomodule.c -o build/temp.linux-x86_64-2.7/src/_portaudiomodule.o
src/_portaudiomodule.c:29:23: fatal error: portaudio.h: No such file or directory
#include "portaudio.h"
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/home/mertyildiran/Downloads/VirtualEnvironment/vir1/Cerebrum/ENV/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-GCltlv/pyaudio/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-icMIUV-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/mertyildiran/Downloads/VirtualEnvironment/vir1/Cerebrum/ENV/include/site/python2.7/pyaudio" failed with error code 1 in /tmp/pip-build-GCltlv/pyaudio
What am I doing wrong? I'm new in virtualenvs.
*I'm able to install other packages. I'm facing with an error only for pyaudio package.
By the way I'm in the environment:
(ENV) mertyildiran#Corsair:~/Downloads/VirtualEnvironment/vir1/MyProject$
This worked for me, I had the same problem:
if you want to install PyAudio inside a virtualenv, install the PortAudio development headers from APT, then PyAudio:
sudo apt-get install portaudio19-dev
pip install --allow-unverified=pyaudio pyaudio
https://pyspotify.mopidy.com/en/latest/api/sink/
Some packages require the support of non-Python software, such as shared libraries. These cannot be installed via pip (they're not Python packages!). You generally install these on the host using your host's package manager (apt-get or yum or dnf, etc...), or you use something like Docker to encapsulate both the dependencies and your application.
In your case, pyaudio requires a number of libraries, including at least portaudio. You will need to install the appropriate development packages on your system, as suggested in the comments on your question.
Following steps worked for me :) Please go through and try
1 sudo apt-get install libasound-dev
2 sudo apt-get install portaudio19-dev
3 pip install pyaudio --user
OR (--user dont work then try python3-pyaudio)
sudo apt-get install python3-pyaudio
In new Python 3.0 pyaudio can install in windows use following command:
pip3 install pyaudio.
If you want to install pyaudio in virtual environment in windows
first you need to download PyAudio-0.2.11-cp37-cp37m-win_amd64.whl this file in [https://www.lfd.uci.edu/~gohlke/pythonlibs/] here and then open command prompt and go to the path where your downloaded file located and type pip install PyAudio-0.2.11-cp37-cp37m-win_amd64.whl

Categories

Resources