Installing python tables on mac with m1 chip - python

I am trying to use tables in python3 on a new mac mini with the M1 chip.
I am getting multiple errors when running HDF5_DIR=/opt/homebrew/Cellar/hdf5/1.12.0_1 pip3 install tables
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/wf/6qtzk3b11fxfpw2r195w68v40000gn/T/pip-install-vok5ylwx/tables_cf9b90e841c543338af0578c772dd962/setup.py'"'"'; __file__='"'"'/private/var/folders/wf/6qtzk3b11fxfpw2r195w68v40000gn/T/pip-install-vok5ylwx/tables_cf9b90e841c543338af0578c772dd962/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/wf/6qtzk3b11fxfpw2r195w68v40000gn/T/pip-wheel-_1y0kbny
cwd: /private/var/folders/wf/6qtzk3b11fxfpw2r195w68v40000gn/T/pip-install-vok5ylwx/tables_cf9b90e841c543338af0578c772dd962/
Complete output (293 lines):
* Using Python 3.9.1 (v3.9.1:1e5d33e9b9, Dec 7 2020, 12:10:52)
* USE_PKGCONFIG: False
* Found HDF5 headers at ``/opt/homebrew/Cellar/hdf5/1.12.0_1/include``, library at ``/opt/homebrew/Cellar/hdf5/1.12.0_1/lib``.
.. WARNING:: Could not find the HDF5 runtime.
The HDF5 shared library was *not* found in the default library
paths. In case of runtime problems, please remember to install it.
/var/folders/wf/6qtzk3b11fxfpw2r195w68v40000gn/T/lzo_version_date5uv_p4uz.c:2:5: error: implicit declaration of function 'lzo_version_date' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
lzo_version_date();
^
1 error generated.
* Could not find LZO 2 headers and library; disabling support for it.
/var/folders/wf/6qtzk3b11fxfpw2r195w68v40000gn/T/lzo_version_datewh6xukqc.c:2:5: error: implicit declaration of function 'lzo_version_date' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
lzo_version_date();
^
1 error generated.
* Could not find LZO 1 headers and library; disabling support for it.
/var/folders/wf/6qtzk3b11fxfpw2r195w68v40000gn/T/BZ2_bzlibVersion0fv_km8c.c:2:5: error: implicit declaration of function 'BZ2_bzlibVersion' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
BZ2_bzlibVersion();
^
1 error generated.
* Could not find bzip2 headers and library; disabling support for it.
/var/folders/wf/6qtzk3b11fxfpw2r195w68v40000gn/T/blosc_list_compressorsqqaoy5ob.c:2:5: error: implicit declaration of function 'blosc_list_compressors' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
blosc_list_compressors();
^
1 error generated.
* Could not find blosc headers and library; using internal sources.
SSE2 detected and enabled
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py:274: UserWarning: Unknown distribution option: 'extra_require'
warnings.warn(msg)
I installed blosc and tried to install python-lzo via pip install python-lzo but get
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/wf/6qtzk3b11fxfpw2r195w68v40000gn/T/pip-install-7vr_mnqv/python-lzo_a324aed1764741928cf19a18f366c948/setup.py'"'"'; __file__='"'"'/private/var/folders/wf/6qtzk3b11fxfpw2r195w68v40000gn/T/pip-install-7vr_mnqv/python-lzo_a324aed1764741928cf19a18f366c948/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/wf/6qtzk3b11fxfpw2r195w68v40000gn/T/pip-wheel-c1_ztyik
cwd: /private/var/folders/wf/6qtzk3b11fxfpw2r195w68v40000gn/T/pip-install-7vr_mnqv/python-lzo_a324aed1764741928cf19a18f366c948/
Complete output (12 lines):
running bdist_wheel
running build
running build_ext
building 'lzo' extension
creating build
creating build/temp.macosx-10.9-x86_64-3.9
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/usr/include/lzo -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c lzomodule.c -o build/temp.macosx-10.9-x86_64-3.9/lzomodule.o
lzomodule.c:35:10: fatal error: 'lzo/lzo1x.h' file not found
#include <lzo/lzo1x.h>
^~~~~~~~~~~~~
1 error generated.
error: command '/usr/bin/gcc' failed with exit code 1
----------------------------------------
ERROR: Failed building wheel for python-lzo
Bonus points if you can help me understand why tables was never an issue on python2 (admittedly on a Windows machine, but I am getting all similar errors there too on python3)

These steps works for me.
Install Homebrew for Mac M1 (arm64 version)
Then install packages
brew install hdf5 c-blosc lzo bzip2
Check installation path
brew info -q hdf5 c-blosc lzo bzip2|grep '/opt/homebrew'
/opt/homebrew/Cellar/hdf5/1.12.0_3 (268 files, 19.4MB) *
/opt/homebrew/Cellar/c-blosc/1.21.0 (10 files, 1.5MB) *
/opt/homebrew/Cellar/lzo/2.10 (31 files, 580.4KB) *
/opt/homebrew/Cellar/bzip2/1.0.8 (26 files, 531.5KB)
...
Download and unarchive PyTables(PyTables-3.6.1 for me)
Compile
cd PyTables-3.6.1
python setup.py build --hdf5=/opt/homebrew/Cellar/hdf5/1.12.0_3 --use-pkgconfig=FALSE --blosc=/opt/homebrew/Cellar/c-blosc/1.21.0 --lzo=/opt/homebrew/Cellar/lzo/2.10 --bzip2=/opt/homebrew/Cellar/bzip2/1.0.8
Install
python setup.py install --hdf5=/opt/homebrew/Cellar/hdf5/1.12.0_3
UPDATE(2021-11-15): conda works now
conda install pytables

The tables module can be easily installed using Miniforge (which can be easily installed using pyenv or following their installation instructions):
https://github.com/conda-forge/miniforge
Once Miniforge is installed you can install tables on your M1 Mac using:
conda install pytables

You may try this link
https://github.com/PyTables/PyTables/issues/219#issuecomment-24117053
After many searches, I was able to install tables by setting the HDF5_DIR and
pip install git+https://github.com/PyTables/PyTables.git#master#egg=tables

Related

How to use pocketsphinx with AnacondaPrompt

I installed pcketsphinx on Anaconda using conda-forge in this way.
conda install -c conda-forge pocketsphinx
And then I got the following message
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
PackagesNotFoundError: The following packages are not available from current channels:
- pocketsphinx
Current channels:
- https://conda.anaconda.org/conda-forge/win-64
- https://conda.anaconda.org/conda-forge/noarch
- https://repo.anaconda.com/pkgs/main/win-64
- https://repo.anaconda.com/pkgs/main/noarch
- https://repo.anaconda.com/pkgs/r/win-64
- https://repo.anaconda.com/pkgs/r/noarch
- https://repo.anaconda.com/pkgs/msys2/win-64
- https://repo.anaconda.com/pkgs/msys2/noarch
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.
Why does it say "The following packages are not available from current channels:"?
How do I make pocketsphinx available to me?
I also tried pip install, but got an error.
pip install pocketsphinx
ERROR: Command errored out with exit status 1:
command: 'C:\Users\taichi\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\taichi\\AppData\\Local\\Temp\\pip-install-ha8v9dja\\pocketsphinx\\setup.py'"'"'; __file__='"'"'C:\\Users\\taichi\\AppData\\Local\\Temp\\pip-install-ha8v9dja\\pocketsphinx\\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 'C:\Users\taichi\AppData\Local\Temp\pip-wheel-2isplwue' --python-tag cp37
cwd: C:\Users\taichi\AppData\Local\Temp\pip-install-ha8v9dja\pocketsphinx\
Complete output (6 lines):
running bdist_wheel
running build_ext
building 'sphinxbase._sphinxbase' extension
swigging deps/sphinxbase/swig/sphinxbase.i to deps/sphinxbase/swig/sphinxbase_wrap.c
swig.exe -python -modern -threads -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/win32 -Ideps/sphinxbase/swig -outdir sphinxbase -o deps/sphinxbase/swig/sphinxbase_wrap.c deps/sphinxbase/swig/sphinxbase.i
error: command 'swig.exe' failed: No such file or directory
----------------------------------------
ERROR: Failed building wheel for pocketsphinx
Running setup.py clean for pocketsphinx
Failed to build pocketsphinx
Installing collected packages: pocketsphinx
Running setup.py install for pocketsphinx ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\taichi\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\taichi\\AppData\\Local\\Temp\\pip-install-ha8v9dja\\pocketsphinx\\setup.py'"'"'; __file__='"'"'C:\\Users\\taichi\\AppData\\Local\\Temp\\pip-install-ha8v9dja\\pocketsphinx\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\taichi\AppData\Local\Temp\pip-record-8osso05j\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\taichi\AppData\Local\Temp\pip-install-ha8v9dja\pocketsphinx\
Complete output (6 lines):
running install
running build_ext
building 'sphinxbase._sphinxbase' extension
swigging deps/sphinxbase/swig/sphinxbase.i to deps/sphinxbase/swig/sphinxbase_wrap.c
swig.exe -python -modern -threads -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/win32 -Ideps/sphinxbase/swig -outdir sphinxbase -o deps/sphinxbase/swig/sphinxbase_wrap.c deps/sphinxbase/swig/sphinxbase.i
error: command 'swig.exe' failed: No such file or directory
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\taichi\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\taichi\\AppData\\Local\\Temp\\pip-install-ha8v9dja\\pocketsphinx\\setup.py'"'"'; __file__='"'"'C:\\Users\\taichi\\AppData\\Local\\Temp\\pip-install-ha8v9dja\\pocketsphinx\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\taichi\AppData\Local\Temp\pip-record-8osso05j\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
I'm using Anaconda3 and Python 3.7.4 and Windows 10 64bit.
I came across what looks like the same problem and was able to solve it with the following steps. Hopefully this will help you and others, at least to get started. Consider the following general points:
Anaconda/Miniconda had a version of gcc that was picked up as the default compiler and, it seems, was interfering. Make sure gcc is picking up the desired compiler. To see what compilers you have, start up a terminal window, type gcc+TAB (gcc followed by a tab). This should show all the versions you have on your system. Type gcc --version to see which version is the default. And which gcc to find out where it is located, e.g. /Users/PatrickT/miniconda/bin/gcc
You want to ensure that your system's PATH can find your compiler. This may be done by adding an export command to your bash profile. On Catalina, apparently, the bash profile information would be placed in .zshrc. To find this file, type COMMAND+SHIFT+E to make invisible files visible and look in your home directory (/Users/PatrickT in my case). For instance, add a line like export PATH="/usr/local/gcc-10/bin:$PATH". The path is of course dependent on your system.
To make sure miniconda was not interfering, I took it off the PATH altogether. I also installed the latest version of xcode from the apple binaries. Once I had an updated version of the gcc compiler found by my system, I was able to install pocketsphinx as well as other programs that I was having problems with, like kaldi or zlib.
Getting miniconda to work again without interfering with gcc is a problem I haven't solved. As soon as I put miniconda back on the PATH, the default gcc reverted to the miniconda version. To be continued...
You can:
pip install pipwin
and
pipwin install pocketsphinx
I was having the same issue and got into this site:
https://cppsecrets.com/users/11429798104105115104101107117115104119971049754494864103109971051084699111109/python-pocketsphinx-installation-on-windows.php

sdl.h error when installing pygame on Mac?

I'm trying to install pygame.
My envrionment is
macOS 10.14.6 Mohave
Python 3.7.4 (downloaded from python.org)
I'm following the instructions on the Pygame site, namely using
pip install pygame
However this is failing with a fatal error, which can be summarised as fatal error:SDL.h filenot found The full install output is shown below.
Running setup.py install for pygame ... error
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-mtm_fm2t/pygame/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-mtm_fm2t/pygame/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/tmp/pip-record-vrvsxslr/install-record.txt --single-version-externally-managed --compile
cwd: /private/tmp/pip-install-mtm_fm2t/pygame/
Complete output (219 lines):
running install
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/pygame
copying src_py/surfarray.py -> build/lib.macosx-10.9-x86_64-3.8/pygame
copying src_py/sysfont.py -> build/lib.macosx-10.9-x86_64-3.8/pygame
copying src_py/_camera_vidcapture.py -> build/lib.macosx-10.9-x86_64-3.8/pygame
...whole bunch of copying removed for brevity...
copying examples/pixelarray.py -> build/lib.macosx-10.9-x86_64-3.8/pygame/examples
copying examples/dropevent.py -> build/lib.macosx-10.9-x86_64-3.8/pygame/examples
running build_ext
building 'pygame.gfxdraw' extension
creating build/temp.macosx-10.9-x86_64-3.8
creating build/temp.macosx-10.9-x86_64-3.8/src_c
creating build/temp.macosx-10.9-x86_64-3.8/src_c/SDL_gfx
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DENABLE_NEWBUF=1 -I/NEED_INC_PATH_FIX -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c src_c/gfxdraw.c -o build/temp.macosx-10.9-x86_64-3.8/src_c/gfxdraw.o
In file included from src_c/gfxdraw.c:33:
In file included from src_c/pygame.h:32:
src_c/_pygame.h:216:10: fatal error: 'SDL.h' file not found
#include <SDL.h>
^~~~~~~
1 error generated.
---
For help with compilation see:
https://www.pygame.org/wiki/MacCompile
To contribute to pygame development see:
https://www.pygame.org/contribute.html
---
error: command 'gcc' failed with exit status 1
ERROR: Command errored out with exit status 1:
/Library/Frameworks/Python.framework/Versions/3.8/bin/python3 -u -c 'import sys,
setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-
mtm_fm2t/pygame/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-
mtm_fm2t/pygame/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/tmp/pip-record-vrvsxslr/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
The file SDL.h does exist when I search in finder, so i don't know why this install is failing.
I've tried the following to solve this but with no success.
installing with pip3 install pygame
installing with pip3 install pygame--2.0.0_dev4 option
And i've even tried downloading the SDL2 source and compiling.
They all fail (the SDL make fails chronically with errors around lzma.h
Has anyone got pygame running on macOS and Python 3.7.4 and can provide a list of detailed instructions and pre-requisites.
I just struggled with this same issue and was finally able to install pygame on a Mac with Mojave by using this command line:
pip3 install pygame --only-binary :all:
This will install a precompiled version of pygame and thus avoids the issue with missing header files (like SDL.h in your error message) which is occurring because pip is trying to compile pygame from source code that looks for these headers in /usr/include. With the latest updates to Mojave and Catalina, Apple no longer has a /usr/include directory. I did check the version of pygame installed with the --only-binary option and see it is a 2.0.0 dev version but so far it seems to work.
I was able to solve this issue by using easy_install pygame instead of pip. I suspect that it has something to do with python 3.8.
I struggled a lot in installing pygame on macOS Catalina. I tried creating the virtual env as well as many other options but Nothing worked for me. The default python is located in /usr/bin/python while the python3 that I installed is located in /Library/Frameworks/Python.framework/Versions/3.8/bin/python3 so instead of using pip install pygame i triedeasy_install-3.8 pygame and it worked for me and when I opened the bin folder in /Library/Frameworks/Python.framework/Versions/3.8 location it has an easy_install-3.8 file. I do not know much about it but I think it has something to do with the python3.8

pip install regex Fails to build on Anaconda python3.6.9 virtualenv

I'm using anaconda 64bits on a manjaro distribution. I created a python3.6 enviroment using conda create -n tensorflow python=3.6 anaconda.
I also installed pip install tensorflow-gpu==1.12 and conda install cudnnif that matters.
On my original python 3.7 outside of anaconda (/usr/bin/python3) it installs fine, but when I enter the virtualenv by conda activate tensorflow, and try to install by pip install regex==2017.4.5 it yelds an error.
Other versions of the package seem to be getting the same error, it is not version specific.
See the error message below:
Installing collected packages: regex [25/1582]
Running setup.py install for regex ... error
ERROR: Command errored out with exit status 1:
command: /opt/anaconda/anaconda3/envs/tensorflow/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-jcrdpn4y/regex/setup.py'"'"'; __file__='"'"'/tmp$
pip-install-jcrdpn4y/regex/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'e$
ec'"'"'))' install --record /tmp/pip-record-if4z1bod/install-record.txt --single-version-externally-managed --compile
cwd: /tmp/pip-install-jcrdpn4y/regex/
Complete output (56 lines):
/opt/anaconda/anaconda3/envs/tensorflow/lib/python3.6/site-packages/setuptools/dist.py:472: UserWarning: Normalizing '2017.04.05' to '2017.4.5'
normalized_version,
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
copying Python3/regex.py -> build/lib.linux-x86_64-3.6
copying Python3/_regex_core.py -> build/lib.linux-x86_64-3.6
copying Python3/test_regex.py -> build/lib.linux-x86_64-3.6
running build_ext
building '_regex' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/Python3
gcc -pthread -B /opt/anaconda/anaconda3/envs/tensorflow/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/opt/anaconda/anaconda3/e$
vs/tensorflow/include/python3.6m -c Python3/_regex.c -o build/temp.linux-x86_64-3.6/Python3/_regex.o
Python3/_regex.c: In function ‘do_best_fuzzy_match’:
Python3/_regex.c:16731:27: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
16731 | for (i = 0; i < best_list.count; i++) {
| ^
Python3/_regex.c:16765:77: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
16765 | if (state->total_errors < error_limit || i == 0 &&
| ~~~~~~~^~
16766 | offset == 0)
| ~~~~~~~~~~~
Python3/_regex.c: In function ‘do_match’:
Python3/_regex.c:16624:9: warning: ‘status’ may be used uninitialized in this function [-Wmaybe-uninitialized]
16624 | int status;
| ^~~~~~
Python3/_regex.c:16776:32: warning: ‘better’ may be used uninitialized in this function [-Wmaybe-uninitialized]
16776 | if (better) {
| ^
Python3/_regex.c:16763:34: note: ‘better’ was declared here
16763 | BOOL better;
| ^~~~~~
Python3/_regex.c:16772:76: warning: ‘best_match_pos’ may be used uninitialized in this function [-Wmaybe-uninitialized]
16772 | better = state->reverse ? state->match_pos >
| ~~~~~~~~~~~~~~~~~^
16773 | best_match_pos : state->match_pos <
| ~~~~~~~~~~~~~~
Python3/_regex.c:16717:24: note: ‘best_match_pos’ was declared here
16717 | Py_ssize_t best_match_pos;
| ^~~~~~~~~~~~~~
Python3/_regex.c: In function ‘pattern_subx’:
Python3/_regex.c:20715:20: warning: ‘kwargs’ may be used uninitialized in this function [-Wmaybe-uninitialized]
20715 | item = PyObject_Call(replacement, args, kwargs);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Python3/_regex.c:20715:20: warning: ‘args’ may be used uninitialized in this function [-Wmaybe-uninitialized]
gcc -pthread -B /opt/anaconda/anaconda3/envs/tensorflow/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/opt/anaconda/anaconda3/en
vs/tensorflow/include/python3.6m -c Python3/_regex_unicode.c -o build/temp.linux-x86_64-3.6/Python3/_regex_unicode.o
gcc -pthread -shared -B /opt/anaconda/anaconda3/envs/tensorflow/compiler_compat -L/opt/anaconda/anaconda3/envs/tensorflow/lib -Wl,-rpath=/opt/anaconda/anaconda3/envs/tensorflow/lib -Wl,--
no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.6/Python3/_regex.o build/temp.linux-x86_64-3.6/Python3/_regex_unicode.o -o build/lib.linux-x86_64-3.6/_regex.cpython-36m-x86_64-linux-gn
u.so
/opt/anaconda/anaconda3/envs/tensorflow/compiler_compat/ld: build/temp.linux-x86_64-3.6/Python3/_regex.o: unable to initialize decompress status for section .debug_info
/opt/anaconda/anaconda3/envs/tensorflow/compiler_compat/ld: build/temp.linux-x86_64-3.6/Python3/_regex.o: unable to initialize decompress status for section .debug_info
/opt/anaconda/anaconda3/envs/tensorflow/compiler_compat/ld: build/temp.linux-x86_64-3.6/Python3/_regex.o: unable to initialize decompress status for section .debug_info
/opt/anaconda/anaconda3/envs/tensorflow/compiler_compat/ld: build/temp.linux-x86_64-3.6/Python3/_regex.o: unable to initialize decompress status for section .debug_info
build/temp.linux-x86_64-3.6/Python3/_regex.o: file not recognized: file format not recognized
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /opt/anaconda/anaconda3/envs/tensorflow/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-jcrdpn4y/regex/s
etup.py'"'"'; __file__='"'"'/tmp/pip-install-jcrdpn4y/regex/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exe
c(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-if4z1bod/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
Some things I noticed above:
Upon building, the error message pointed out file not recognized: file format not recognized
Something called "ld" exited a fail status on the building process collect2: error: ld returned 1 exit status. I suppose this is just to signify that something went wrong while builind on /run/ or /usr/temp, but it may be helpful.
I don't actually believe it's a problem with gcc, since other packages install fine.
I also don't believe it to be an error of system-wide dependencies, because outside of the virtualenv everything works fine.
And please keep in mind: I am using a manjaro, arch distributions don't have -dev or -devel packages (e.g. python-devel) to install separatelly. Normally those come included with the original package (i.e. python or python3).
Thanks for any help :).
I've searched a little more on the topic, and it seems that my OS is very much involved. The problem seems to be in kernel toolkit level stuff, and a bit more upstream than I imagine. Waiting for someone to close the question. Will post on Super User stack exchange.
https://github.com/mne-tools/mne-python/issues/6071
https://bbs.archlinux.org/viewtopic.php?id=242682
Maybe you should try to using:
conda install regex
instead of pip.

Installing chatterbot but getting "ERROR: Could not build wheels for spacy which use PEP 517 and cannot be installed directly"

I'm trying to install chatterbot on macOS with
python3 -m pip install chatterbot
and every time I get the same error during the step "Installing build dependencies ... /"
ERROR: Failed building wheel for spacy
Running setup.py clean for spacy
Failed to build spacy
ERROR: Could not build wheels for spacy which use PEP 517 and cannot be installed directly
Can someone please help?
Installing collected packages: spacy, chatterbot
Running setup.py install for spacy ... error
ERROR: Complete output from command /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/ry/sht50z853vn58nwg6wbzt4l00000gn/T/pip-install-33629q9f/spacy/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/ry/sht50z853vn58nwg6wbzt4l00000gn/T/pip-record-z9jsui8q/install-record.txt --single-version-externally-managed --compile:
ERROR: running install
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/spacy
copying spacy/lemmatizer.py -> build/lib.macosx-10.9-x86_64-3.7/spacy
running build_ext
building 'spacy._align' extension
creating build/temp.macosx-10.9-x86_64-3.7
creating build/temp.macosx-10.9-x86_64-3.7/spacy
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I/private/var/folders/ry/sht50z853vn58nwg6wbzt4l00000gn/T/pip-install-33629q9f/spacy/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c spacy/_align.cpp -o build/temp.macosx-10.9-x86_64-3.7/spacy/_align.o -O2 -Wno-strict-prototypes -Wno-unused-function -stdlib=libc++
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: Command "/Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/ry/sht50z853vn58nwg6wbzt4l00000gn/T/pip-install-33629q9f/spacy/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/ry/sht50z853vn58nwg6wbzt4l00000gn/T/pip-record-z9jsui8q/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/ry/sht50z853vn58nwg6wbzt4l00000gn/T/pip-install-33629q9f/spacy/
You could try python3 -m pip install --no-binary spacy chatterbot, which should tell pip to not build the wheel
Alternately python3 -m pip install --no-use-pep517 chatterbot.
I had the same problem while installing kivy through command prompt.
If you use Pycharm then there is an easy way to avoid these problems.
Open Pycharm-->GoTo Files-->Settings-->Project-->Python Interpreter--> + sign-->then search for what you want to install. Check the version which works for you and install it.
If you get an error then try and install other versions of it. That would solve the issue.
Try installing the python-dev version.
For python3.7
sudo apt-get install python3.7-dev
For python3.6
sudo apt-get install python3.6-dev
In one of the scenarios where if you are using Anaconda, then you have to install using this command:
conda install -c conda-forge spacy, hope this helps !!
I had this issue with MacOS for a different package. I found this warning in the log:
WARNING: Building wheel for bottleneck failed: [Errno 13] Permission denied: '/Users/avi/Library/Caches/pip/wheels/87'
Then I gave my user access to the pip/wheels directory and then the installation worked.
Easy, try to run this:
pip install pep517
And then try to install again
python3 -m pip install chatterbot

Error updating pycups via pip

I'm running openSUSE Leap 42.1 and I just tried to update all the software in pip, using the following command:
for i in $(pip list|awk '{print $1}'); do pip install $i --upgrade;done
This hit a few errors, I had some missing devel dependencies, which I managed to fix, and most of the packages then updated fine, but one continues to fail, and I'm not sure why. The errors at this point became a bit cryptic and my google-fu was unable to find the answer. Can anyone advise why I'm getting this error, and whether there is a way to fix/work around?
Collecting pycups
Using cached pycups-1.9.73.tar.bz2
Installing collected packages: pycups
Found existing installation: pycups 1.9.72
DEPRECATION: Uninstalling a distutils installed project (pycups) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling pycups-1.9.72:
Successfully uninstalled pycups-1.9.72
Running setup.py install for pycups
Complete output from command /usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-vpyfl_ln/pycups/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-zukh_f21-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
building 'cups' extension
creating build
creating build/temp.linux-x86_64-3.4
gcc -pthread -Wno-unused-result -Werror=declaration-after-statement -DNDEBUG -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -DOPENSSL_LOAD_CONF -fPIC -DVERSION="1.9.73" -I/usr/include/python3.4m -c cupsmodule.c -o build/temp.linux-x86_64-3.4/cupsmodule.o
cupsmodule.c: In function ‘cups_connectDest’:
cupsmodule.c:720:3: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
int i;
^
cupsmodule.c:743:3: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
PyObject *largs = Py_BuildValue ("()");
^
cupsmodule.c: In function ‘PyInit_cups’:
cupsmodule.c:1018:3: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
struct module_state *st = GETSTATE(m);
^
cupsmodule.c:1026:3: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
PyObject *d = PyModule_GetDict (m);
^
cc1: some warnings being treated as errors
error: command 'gcc' failed with exit status 1
----------------------------------------
Rolling back uninstall of pycups
Command "/usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-vpyfl_ln/pycups/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-zukh_f21-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-vpyfl_ln/pycups
I'm using the following pip:
pip 7.1.2 from /usr/lib/python3.4/site-packages (python 3.4)
The problem is this compiler flag: -Werror=declaration-after-statement. You need to tell the compiler not to turn this warning into an error by setting the CFLAGS environment variable:
CFLAGS=-Wno-error=declaration-after-statement pip install -U pycups

Categories