I'm trying to install spacy by running pip install spacy for python version 3.6.1 but continuously i'm getting errors like below,how to get rid of this issue? previously i was having cl.exe not found error, after that i added visual studio path in environment variables where cl.exe exists.
Failed building wheel for spacy
Running setup.py clean for spacy
Running setup.py bdist_wheel for murmurhash ... error
Complete output from command c:\users\sh00428701\appdata\local\programs\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\SH0042~1\\AppData\\Local\\Temp\\pip-build-joi6voav\\murmurhash\\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\SH0042~1\AppData\Local\Temp\tmpa6tzdkovpip-wheel- --python-tag cp36:
running bdist_wheel
running build
running build_py
----------------------------------------
Failed building wheel for murmurhash
Running setup.py clean for murmurhash
Running setup.py bdist_wheel for cymem ... error
Complete output from command c:\users\sh00428701\appdata\local\programs\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\SH0042~1\\AppData\\Local\\Temp\\pip-build-joi6voav\\cymem\\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\SH0042~1\AppData\Local\Temp\tmpz7p6hkiwpip-wheel- --python-tag cp36:
----------------------------------------
Failed building wheel for cymem
Running setup.py clean for cymem
Running setup.py bdist_wheel for preshed ... error
Complete output from command c:\users\sh00428701\appdata\local\programs\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\SH0042~1\\AppData\\Local\\Temp\\pip-build-joi6voav\\preshed\\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\SH0042~1\AppData\Local\Temp\tmpwppgmyp9pip-wheel- --python-tag cp36:
----------------------------------------
Failed building wheel for preshed
Running setup.py clean for preshed
Running setup.py bdist_wheel for thinc ... error
----------------------------------------
Failed building wheel for thinc
Running setup.py clean for thinc
Running setup.py bdist_wheel for ujson ... error
----------------------------------------
Failed building wheel for ujson
Running setup.py clean for ujson
Running setup.py bdist_wheel for cytoolz ... error
----------------------------------------
Failed building wheel for cytoolz
Running setup.py clean for cytoolz
Failed to build spacy murmurhash cymem preshed thinc ujson cytoolz
Installing collected packages: murmurhash, cymem, preshed, wrapt, tqdm, toolz, cytoolz, plac, pyreadline, dill, termcolor, pathlib, thinc, ujson, regex, spacy
Running setup.py install for murmurhash ... error
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\sh00428701\appdata\local\programs\python\python36\include -IC:\Users\SH0042~1\AppData\Local\Temp\pip-build-joi6voav\murmurhash\murmurhash\include -Ic:\users\sh00428701\appdata\local\programs\python\python36\include -Ic:\users\sh00428701\appdata\local\programs\python\python36\include /EHsc /Tpmurmurhash/mrmr.cpp /Fobuild\temp.win-amd64-3.6\Release\murmurhash/mrmr.obj /Ox /EHsc
mrmr.cpp
c1xx: fatal error C1083: Cannot open source file: 'murmurhash/mrmr.cpp': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\cl.exe' failed with exit status 2
----------------------------------------
Command "c:\users\sh00428701\appdata\local\programs\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\SH0042~1\\AppData\\Local\\Temp\\pip-build-joi6voav\\murmurhash\\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\SH0042~1\AppData\Local\Temp\pip-_j1cxej1-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\SH0042~1\AppData\Local\Temp\pip-build-joi6voav\murmurhash\
for me, pip install --no-cache-dir spacy worked
A couple thoughts:
Grab the various wheel files you need from http://www.lfd.uci.edu/~gohlke/pythonlibs/#spacy and install with pip install x.whl y.whl etc.
Upgrade your version of cpp build tools to 2017 and try pip again
I installed these packages, then it works:
sudo apt-get install python-dev
sudo apt-get install python3-dev
sudo apt-get install libevent-dev
This worked for me:
# Note, use sudo. I'm in a docker image, so i dont need it.
# install dev libs
apt-get install python-dev -y && \
apt-get install python3-dev -y && \
apt-get install libevent-dev -y && \
# install new gcc
apt-get update && \
apt-get install build-essential software-properties-common -y && \
add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
apt-get update && \
apt-get install gcc-snapshot -y && \
apt-get update && \
apt-get install gcc-6 g++-6 -y && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6 && \
apt-get install gcc-4.8 g++-4.8 -y && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8;
see https://gist.github.com/application2000/73fd6f4bf1be6600a2cf9f56315a2d91
conda install -c conda-forge spacy worked for me. I have windows 10 and Python 3.5.3 :: Anaconda custom (64-bit)
If you are on Ubuntu, just do this
sudo apt-get install build-essential python-dev git
Now install spacy by
pip install -U spacy
Download and install from the Gihub source. Here is the link: https://github.com/explosion/spaCy
Use these commands:
python -m pip install -U pip venv # update pip & virtualenv
git clone https://github.com/explosion/spaCy # clone spaCy
cd spaCy # navigate into directory
venv .env # create environment in .env
source .env/bin/activate # activate virtual environment
export PYTHONPATH=`pwd` # set Python path to spaCy directory
pip install -r requirements.txt # install all requirements
python setup.py build_ext --inplace # compile spaCy
Feel free to use only last two commands if not using virtual environment. Follow the official Documentation here
If you are using it with manually installed python3.6 and trying to install in a 3.6 environment then you maybe missing python3.6-dev
sudo apt-get install python3.6-dev
also maybe
sudo apt-get install gcc
This is an answer to particular case.
yum -y groupinstall development
WORKED FOR ME
Spacy requires 64-bit python.
Uninstall 32-bit.
Install 64-bit python.
Try spacy installation again.
For anyone looking for an answer for spacy 2.X with Python 3.8 in Ubuntu, I had the same problem. I'm using venv. As the other answers were not enough, I write the solution which solved my problem.
install the required libraries as mentioned in other answers:
sudo apt-get install python3-dev libevent-dev build-essential gcc g++
pip install setuptools wheel
Update pip and install cython
pip install -U pip
pip install cython
I suspect that updating pip to the newest version solved my problem.
At first, install those packages and try to install spacy
sudo apt update
sudo apt install python3-dev
sudo apt install libpython3-dev
sudo apt install python3-devel
sudo apt-get install libevent-dev
sudo apt update
Related
I would greatly appreciate help in tackling a problem that drives me crazy (I do need Ubuntu 18.04 and python 3). I did try using different scenarios, but everything fails when installing PyPI package isal on Ubuntu 18.04:
FROM ubuntu:18.04
RUN apt update -y && apt upgrade -y
RUN apt install -y python3 python3-pip
RUN pip3 install isal
docker build . fails with:
Step 3/3 : RUN pip3 install isal
---> Running in 71a47c31d97c
Collecting isal
Downloading https://files.pythonhosted.org/packages/d6/72/b997fd8ba95a0820edcd5da268505705a5518fd860d64bf28a7c1c343a3a/isal-0.11.0.tar.gz (680kB)
Building wheels for collected packages: isal
Running setup.py bdist_wheel for isal: started
Running setup.py bdist_wheel for isal: finished with status 'error'
....
running build_ext
/tmp/tmpk3o08f96/autogen.sh: 3: /tmp/tmpk3o08f96/autogen.sh: autoreconf: not found
error: [Errno 2] No such file or directory: '/tmp/tmpk3o08f96/configure': '/tmp/tmpk3o08f96/configure'
----------------------------------------
Failed building wheel for isal
Running setup.py clean for isal
Failed to build isal
Installing collected packages: isal
Running setup.py install for isal: started
Running setup.py install for isal: finished with status 'error'
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-qa68yevk/isal/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-8qioc11y-record/install-record.txt --single-version-externally-managed --compile:
/usr/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type'
warnings.warn(msg)
....
running build_ext
/tmp/tmpnfxsy9ug/autogen.sh: 3: /tmp/tmpnfxsy9ug/autogen.sh: autoreconf: not found
error: [Errno 2] No such file or directory: '/tmp/tmpnfxsy9ug/configure': '/tmp/tmpnfxsy9ug/configure'
----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-qa68yevk/isal/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-8qioc11y-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-qa68yevk/isal/
The command '/bin/sh -c pip3 install isal' returned a non-zero code: 1
while FROM ubuntu:20.04 everything works fine
pip also fails:
FROM ubuntu:18.04
RUN apt update -y && apt upgrade -y \
&& apt install -y python python-pip
RUN pip install isal
Step 3/3 : RUN pip install isal
---> Running in 6e157d7d965a
Collecting isal
Could not find a version that satisfies the requirement isal (from versions: )
No matching distribution found for isal
The command '/bin/sh -c pip install isal' returned a non-zero code: 1
you can try apt install autoconf to resolve autoreconf: not found
The project was working perfectly until recently when I created a model for my database and tried to pip install requirement.txt. I have done everything I know including modifying my settings.py to add the missing library, reinstalling django and psycopg2, all to no avail. Here's my requirement.txt:
tweepy==3.8.0
django
gunicorn
django-heroku
The error i'm getting:
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/Users/apple/Downloads/font_text/python-getting-started/getting-started/bin/python3 -u -c "import setuptools, tokenize;__file__='/private/var/folders/tn/843ff_ns4j5ddf0fyc998v6c0000gn/T/pip-install-phi9wroh/psycopg2/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/tn/843ff_ns4j5ddf0fyc998v6c0000gn/T/pip-record-sc3y24vo/install-record.txt --single-version-externally-managed --compile --install-headers /Users/apple/###/###/PROJECTFOLDER/getting-started/include/site/python3.7/psycopg2" failed with error code 1 in /private/var/folders/tn/843ff_ns4j5ddf0fyc998v6c0000gn/T/pip-install-phi9wroh/psycopg2/
Based on the error message, you need to install the openssl-devel package on your system.
After long hours of searching and experimenting, I finally was able to solve the problem. But I'm still investigating on what really could have caused the error. Anyways, here's what fixed it
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
pip install psycopg2
I found it here: error installing psycopg2, library not found for -lssl
You need to reinstall gcc , gcc-c++ and dependencies.
For python 2.7
$ sudo yum -y install gcc gcc-c++ kernel-devel
$ sudo yum -y install python-devel libxslt-devel libffi-devel openssl-devel
$ pip install "your python packet"
For python 3.4
$ sudo apt-get install python3-dev
$ pip install "your python packet"
Hope this will help.
Currently building the image:
FROM python:3.7-slim-stretch
WORKDIR /root/forstack-host
COPY requirements.txt /root/requirements.txt
RUN apt-get update && apt-get install -y libgomp1 gcc
RUN apt-get install -y libpq-dev
RUN apt-get install net-tools
RUN apt-get install -y libhdf5-serial-dev hdf5-tools
RUN python3 -m pip install --no-cache-dir -U pip && \
python3 -m pip install --no-cache-dir -r /root/requirements.txt
When installing tables=3.4.4 I get the error
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-91revz2s/tables/setup.py'"'"'; __file__='"'"'/tmp/pip-install-91revz2s/tables/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-91revz2s/tables/pip-egg-info
cwd: /tmp/pip-install-91revz2s/tables/
Complete output (12 lines):
/tmp/H5close9pyniq85.c: In function ‘main’:
/tmp/H5close9pyniq85.c:2:5: warning: implicit declaration of function ‘H5close’ [-Wimplicit-function-declaration]
H5close();
^~~~~~~
/usr/bin/ld: cannot find -lhdf5
collect2: error: ld returned 1 exit status
* Using Python 3.7.5 (default, Oct 19 2019, 00:03:48)
* USE_PKGCONFIG: True
.. ERROR:: Could not find a local HDF5 installation.
You may need to explicitly state where your local HDF5 headers and
library can be found by setting the ``HDF5_DIR`` environment
variable or by using the ``--hdf5`` command-line option.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Using RUN apt-get install -y libhdf5-serial-dev hdf5-tools doesn't seem to fix this error and I can't seem to set the HDF5_DIR env. Is there a working 3.7 image with a fix for this hdf5 issue?
you may try add this ARG to your Dockerfile before installing:
ARG HDF5_DIR=PATH_TO_YOUR_HDF5 # normally should be in /usr/local or /opt/local
you may also need to install build-dep
I downloaded the Virtual Machine (for Android/Buildozer) from here.
I need to install Matplotlib on this virtual machine, but I am not able to.
I already tried the following in the terminal:
sudo pip install matplotlib
sudo apt-get build-dep python-matplotlib
python -mpip install matplotlib
I get the following error:
posixsybprocess.c:16:20: fatal error: Python.h: No such file or directory
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-5xFopz/subprocess32/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-Q8TTao/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-5xFopz/subprocess32/
Can anyone help me with that?
try this:
sudo apt-get install libfreetype6-dev libpng-dev
then
sudo apt-get install python-pip
sudo pip install matplotlib
if it's not working:
sudo apt-get install python-matplotlib
or just
sudo apt-get install matplotlib
If it's not working at first try to upgrade and update the apt-get, then try one more time
I have trouble installing modules using pip, for example
sudo -H pip3 install kivy
returns this error
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-b3rwh_e6/kivy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-bev6v2mx-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-b3rwh_e6/kivy/
I am fairly new to python and to programming in general so I'm probably doing something wrong, it's probably worth mentioning that I have python2.7 and python3.5 installed, and installing the packages python3.5-dev and build-essential didn't fix it.
Edit: build log:
https://drive.google.com/file/d/0B5e3GD1lfCbUZ19LU3RENzY4MU0/view?usp=sharing
Packages which include C extensions require compilation and so might require both gcc and python-dev (and in some cases gcc-c++).
run:
sudo apt-get install gcc python-dev
prior to pip installing your package.
Have you tried to install
sudo apt-get install python-dev
for python2.7 ?
From the official site
https://kivy.org/docs/installation/installation-linux.html
for python 2
sudo apt-get install python-kivy
for python 3
sudo apt-get install python3-kivy