Spacy can't be installed in virtualenv which is created with pypy - python

I created virtualenv(pypy as compiler).
Now when I tried to install Spacy using pip I get below error.
Failed to build spacy thinc
Installing collected packages: thinc, ujson, certifi, chardet, idna, urllib3, requests, regex, webencodings, html5lib, wcwidth, ftfy, spacy
Running setup.py install for thinc ... error
Complete output from command /Users/azar-4893/Python_Venv/falconpypy/bin/pypy -u -c "import setuptools, tokenize;__file__='/private/var/folders/y1/npxxtb7n3k5d2mb7_5pwsr1xr6pvqq/T/pip-build-F0nppE/thinc/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/y1/npxxtb7n3k5d2mb7_5pwsr1xr6pvqq/T/pip-Thl94z-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/azar-4893/Python_Venv/falconpypy/include/site/python2.7/thinc:
running install
running build
running build_py
running build_ext
building 'thinc.linalg' extension
gcc -pthread -arch x86_64 -DNDEBUG -O2 -fPIC -I/Users/azar-4893/Python_Venv/falconpypy/include -I/private/var/folders/y1/npxxtb7n3k5d2mb7_5pwsr1xr6pvqq/T/pip-build-F0nppE/thinc/include -I/Users/azar-4893/Python_Venv/falconpypy/include -c thinc/linalg.cpp -o build/temp.macosx-10.11-x86_64-2.7/thinc/linalg.o -O3 -Wno-strict-prototypes -Wno-unused-function
clang: error: no such file or directory: 'thinc/linalg.cpp'
clang: error: no input files
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/Users/azar-4893/Python_Venv/falconpypy/bin/pypy -u -c "import setuptools, tokenize;__file__='/private/var/folders/y1/npxxtb7n3k5d2mb7_5pwsr1xr6pvqq/T/pip-build-F0nppE/thinc/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/y1/npxxtb7n3k5d2mb7_5pwsr1xr6pvqq/T/pip-Thl94z-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/azar-4893/Python_Venv/falconpypy/include/site/python2.7/thinc" failed with error code 1 in /private/var/folders/y1/npxxtb7n3k5d2mb7_5pwsr1xr6pvqq/T/pip-build-F0nppE/thinc/
Is there a way to install spacy for pypy?

spacy uses a c-extensions module called thinc to do its heavy lifting in C. The latest PyPy cannot install thinc, there are multiple issues blocking its installation. Here is one on thinc, and this as yet unsupported call to PyFrozenSet_New in cytoolz

On MacOS, try this--
CFLAGS='-stdlib=libc++' pip install spacy==2.0.12 thinc==6.10.3 google-compute-engine https://github.com/huggingface/neuralcoref-models/releases/download/en_coref_md-3.0.0/en_coref_md-3.0.0.tar.gz

Related

Compiler problem installing cx_Oracle using pip on Solaris

I'm new to this stuff and any help would be awesome. I'm installing this through putty on an onprem server.
Collecting cx_Oracle==7.3
Downloading https://files.pythonhosted.org/packages/5e/e3/cfd4f413f8d47dd2aee09273d9bb3ee6aa7384e0a04e191d703c2199eb93/cx_Oracle-7.3.0.tar.gz (307kB)
100% |################################| 317kB 7.6MB/s
Installing collected packages: cx-Oracle
Running setup.py install for cx-Oracle ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-YAwTvN/cx-Oracle/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-nqdlEI/install-record.txt --single-version-externally-managed --compile --user --prefix=:
running install
running build
running build_ext
building 'cx_Oracle' extension
creating build
creating build/temp.solaris-2.11-sun4v.32bit-2.7
creating build/temp.solaris-2.11-sun4v.32bit-2.7/src
creating build/temp.solaris-2.11-sun4v.32bit-2.7/odpi
creating build/temp.solaris-2.11-sun4v.32bit-2.7/odpi/src
cc -DNDEBUG -KPIC -DPIC -DCXO_BUILD_VERSION=7.3.0 -Iodpi/include -Iodpi/src -I/usr/include/python2.7 -c src/cxoBuffer.c -o build/temp.solaris-2.11-sun4v.32bit-2.7/src/cxoBuffer.o
unable to execute 'cc': No such file or directory
error: command 'cc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-YAwTvN/cx-Oracle/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-nqdlEI/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-install-YAwTvN/cx-Oracle/
Previously I was able to install awscli without any issues.
I'm not sure why is this happening.

showing error while trying to install jupyter in ubuntu

Command : sudopip install jupyter
Error :
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-En0PFz/scandir/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-OVVJzg-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying scandir.py -> build/lib.linux-x86_64-2.7
running build_ext
building '_scandir' extension
creating build/temp.linux-x86_64-2.7
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c _scandir.c -o build/temp.linux-x86_64-2.7/_scandir.o
_scandir.c:14:20: fatal error: Python.h: No such file or directory
#include <Python.h>
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-En0PFz/scandir/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-OVVJzg-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-En0PFz/scandir/
First:
$ sudo apt-get install python-dev
and then:
$ sudo pip install jupyter

pycurl link error after upgrade from Yosemite to High Sierra

I just upgraded from Yosemite to High Sierra, which worked quite well, with the only exception that I have a bug in pycurl.
import pycurl
ImportError: No module named pycurl
so I did
pip uninstall pycurl
and
pip install --no-cache-dir --compile pycurl
but now it results in a clang error
clang -bundle -undefined dynamic_lookup build/temp.macosx-10.10-x86_64-2.7/src/docstrings.o build/temp.macosx-10.10-x86_64-2.7/src/easy.o build/temp.macosx-10.10-x86_64-2.7/src/module.o build/temp.macosx-10.10-x86_64-2.7/src/multi.o build/temp.macosx-10.10-x86_64-2.7/src/oscompat.o build/temp.macosx-10.10-x86_64-2.7/src/pythoncompat.o build/temp.macosx-10.10-x86_64-2.7/src/share.o build/temp.macosx-10.10-x86_64-2.7/src/stringcompat.o build/temp.macosx-10.10-x86_64-2.7/src/threadsupport.o -L/usr/local/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/sqlite/lib -lssl3 -lcurl -o build/lib.macosx-10.10-x86_64-2.7/pycurl.so
ld: library not found for -lssl3
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1
----------------------------------------
Command "/usr/local/opt/python/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/5h/h0hwdpps0cd_v2k_m652wwzm0000gq/T/pip-build-1rx5q1/pycurl/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/5h/h0hwdpps0cd_v2k_m652wwzm0000gq/T/pip-MkzYNt-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/5h/h0hwdpps0cd_v2k_m652wwzm0000gq/T/pip-build-1rx5q1/pycurl/
any idea what is going on here?
this fixed it...
export PYCURL_SSL_LIBRARY=openssl

Install big float on mac OS X

I am trying to install big float on OS X but i am encountering multiple issues.
I have installed amp without any problem, but when I have tried to install mpfr I got this error:
Warning: mpfr-3.1.5 already installed, it's just not linked.
What does this mean? (I am using Homebrew).
Then, obviously, if I try to install bigfloat it doesn't work and i get this error:
Collecting bigfloat
Downloading bigfloat-0.3.0.tar.gz (216kB)
100% |████████████████████████████████| 225kB 1.6MB/s
Installing collected packages: bigfloat
Running setup.py install for bigfloat ... error
Complete output from command /Users/name/anaconda2/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-VCyOBn/bigfloat/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" build_ext -I/usr/local/include -L/usr/local/lib install --record /tmp/pip-K9AHsP-record/install-record.txt --single-version-externally-managed --compile:
running build_ext
building 'mpfr' extension
creating build
creating build/temp.macosx-10.7-x86_64-2.7
gcc -fno-strict-aliasing -I/Users/name/anaconda2/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/include -I/Users/name/anaconda2/include/python2.7 -c mpfr.c -o build/temp.macosx-10.7-x86_64-2.7/mpfr.o
In file included from /usr/local/lib/gcc/x86_64-apple-darwin15.6.0/6.2.0/include-fixed/syslimits.h:7:0,
from /usr/local/lib/gcc/x86_64-apple-darwin15.6.0/6.2.0/include-fixed/limits.h:34,
from /Users/name/anaconda2/include/python2.7/Python.h:19,
from mpfr.c:16:
/usr/local/lib/gcc/x86_64-apple-darwin15.6.0/6.2.0/include-fixed/limits.h:168:61: fatal error: limits.h: No such file or directory
#include_next <limits.h> /* recurse down to the real one */
^
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/Users//anaconda2/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-VCyOBn/bigfloat/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" build_ext -I/usr/local/include -L/usr/local/lib install --record /tmp/pip-K9AHsP-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-VCyOBn/bigfloat/
You must install python-devel
In OS X try to uninstall and install again:
brew uninstall python
brew install python
Also according to this issue, Osx GCC (which is just a symlink to clang) doesn't ship with OpenMP support out of the box. You can install GCC with OpenMP.
brew install gcc --without-multilib

Installing hunspell package

I'm looking forward to install the hunspell package using pip, but it throws the following error:
Collecting hunspell
Using cached hunspell-0.4.1.tar.gz
Building wheels for collected packages: hunspell
Running setup.py bdist_wheel for hunspell ... error
Complete output from command /root/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-oyfpp3iy/hunspell/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 /tmp/tmphqvqt4lxpip-wheel- --python-tag cp34:
/root/anaconda3/lib/python3.4/distutils/extension.py:132: UserWarning: Unknown Extension options: 'compile_args', 'macros'
warnings.warn(msg)
running bdist_wheel
running build
running build_ext
building 'hunspell' extension
creating build
creating build/temp.linux-x86_64-3.4
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/hunspell -I/root/anaconda3/include/python3.4m -c hunspell.c -o build/temp.linux-x86_64-3.4/hunspell.o
hunspell.c:21:22: erreur fatale: hunspell.h : Aucun fichier ou dossier de ce type
#include <hunspell.h>
^
compilation terminée.
error: command 'gcc' failed with exit status 1
----------------------------------------
Failed building wheel for hunspell
Running setup.py clean for hunspell
Failed to build hunspell
Installing collected packages: hunspell
Running setup.py install for hunspell ... error
Complete output from command /root/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-oyfpp3iy/hunspell/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-euhsmasb-record/install-record.txt --single-version-externally-managed --compile:
/root/anaconda3/lib/python3.4/distutils/extension.py:132: UserWarning: Unknown Extension options: 'compile_args', 'macros'
warnings.warn(msg)
running install
running build
running build_ext
building 'hunspell' extension
creating build
creating build/temp.linux-x86_64-3.4
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/hunspell -I/root/anaconda3/include/python3.4m -c hunspell.c -o build/temp.linux-x86_64-3.4/hunspell.o
hunspell.c:21:22: erreur fatale: hunspell.h : Aucun fichier ou dossier de ce type
#include <hunspell.h>
^
compilation terminée.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/root/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-oyfpp3iy/hunspell/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-euhsmasb-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-oyfpp3iy/hunspell/
[root#localhost Bureau]# alias python-devel=python34-devel
[root#localhost Bureau]# pip install hunspell
Collecting hunspell
Using cached hunspell-0.4.1.tar.gz
Building wheels for collected packages: hunspell
Running setup.py bdist_wheel for hunspell ... error
Complete output from command /root/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-xpljhkom/hunspell/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 /tmp/tmptwg_9c8vpip-wheel- --python-tag cp34:
/root/anaconda3/lib/python3.4/distutils/extension.py:132: UserWarning: Unknown Extension options: 'compile_args', 'macros'
warnings.warn(msg)
running bdist_wheel
running build
running build_ext
building 'hunspell' extension
creating build
creating build/temp.linux-x86_64-3.4
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/hunspell -I/root/anaconda3/include/python3.4m -c hunspell.c -o build/temp.linux-x86_64-3.4/hunspell.o
hunspell.c:21:22: erreur fatale: hunspell.h : Aucun fichier ou dossier de ce type
#include <hunspell.h>
^
compilation terminée.
error: command 'gcc' failed with exit status 1
----------------------------------------
Failed building wheel for hunspell
Running setup.py clean for hunspell
Failed to build hunspell
Installing collected packages: hunspell
Running setup.py install for hunspell ... error
Complete output from command /root/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-xpljhkom/hunspell/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-zrlp2go9-record/install-record.txt --single-version-externally-managed --compile:
/root/anaconda3/lib/python3.4/distutils/extension.py:132: UserWarning: Unknown Extension options: 'compile_args', 'macros'
warnings.warn(msg)
running install
running build
running build_ext
building 'hunspell' extension
creating build
creating build/temp.linux-x86_64-3.4
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/hunspell -I/root/anaconda3/include/python3.4m -c hunspell.c -o build/temp.linux-x86_64-3.4/hunspell.o
hunspell.c:21:22: erreur fatale: hunspell.h : Aucun fichier ou dossier de ce type
#include <hunspell.h>
^
compilation terminée.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/root/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-xpljhkom/hunspell/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-zrlp2go9-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-xpljhkom/hunspell/
And I've heard that installing python3-dev would resolve the problem.
I tried with no succes.
I'm using python 3.4 under CentOS 7.
Can I get some help please ? Thanks in advance.
I just went through this using python3.4 and pip3.4 on Centos7 64-bit. (NB you need both python3.4 and pip3.4)
I eventually got it working via pip3.4, but before this would work, I had to take a few extra steps. The steps I took were:
Install the python3.4 development headers:
sudo yum install python34u-devel.x86_64
Install hunspell and hunspell-devel (needed for hunspell.h and hunspell lib):
sudo yum install hunspell hunspell-devel
In /usr/lib64/, add an extra symlink for the hunspell library:
sudo ln -s libhunspell-1.3.so libhunspell.so
Finally, run the command:
sudo pip3.4 install hunspell
... and this gave me the following output:
... (compiler output deleted) ...
Successfully built hunspell
Installing collected packages: hunspell
Successfully installed hunspell-0.4.1
Try This:
sudo apt install python-dev libhunspell-dev
pip install hunspell
Solution by OP.
I figured it out, I'll share this method here, it may help :)
first you need to install python-devel and
yum install python-devel
yum install hunspell-devel
then corrected your symlink
cd /usr/lib64
sudo ln -s libhunspell-1.3.so.0.0.0 libhunspell.so
ls -l | grep hunspell
Good Luck :)
I am working on MAC OS and this solved the error for me.
Hunspell Installation Steps:
brew install hunspell (installed version 1.7.0_2-1)
brew install pkg-config (0.29.2_3)
ln -s /usr/local/lib/libhunspell-1.7.a /usr/local/lib/libhunspell.a
ln -s /usr/local/Cellar/hunspell/1.7.0_2/lib/libhunspell-1.7.dylib /usr/local/Cellar/hunspell/1.7.0_2/lib/libhunspell.dylib
CFLAGS=$(pkg-config --cflags hunspell) LDFLAGS=$(pkg-config --libs hunspell) pip3 install hunspell

Categories