I am trying to install fitsne in colab. Recommended way for installation is:
conda config --add channels conda-forge #if not already in your channels. Needed for fftw.
conda install cython numpy fftw
pip install fitsne
Yet, I get following error:
Requirement already satisfied: numpy in /usr/local/lib/python3.7/dist-packages (from fitsne) (1.19.5)
Requirement already satisfied: cython in /usr/local/lib/python3.7/dist-packages (from fitsne) (0.29.22)
Building wheels for collected packages: fitsne
Building wheel for fitsne (setup.py) ... error
ERROR: Failed building wheel for fitsne
Running setup.py clean for fitsne
Failed to build fitsne
Installing collected packages: fitsne
Running setup.py install for fitsne ... error
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ezkx1s2e/fitsne/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ezkx1s2e/fitsne/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-uzkyz06_/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
Can someone please explain how to fix such an error in colab?
I solved it using this gist
!git clone https://github.com/KlugerLab/FIt-SNE.git
!wget http://www.fftw.org/fftw-3.3.8.tar.gz
!tar -xf fftw-3.3.8.tar.gz
!cd fftw-3.3.8
!./fftw-3.3.8/configure
!make
!make install
!g++ -std=c++11 -O3 FIt-SNE/src/sptree.cpp FIt-SNE/src/tsne.cpp FIt-SNE/src/nbodyfft.cpp -o FIt-SNE/bin/fast_tsne -pthread -lfftw3 -lm -Wno-address-of-packed-member
import sys; sys.path.append('FIt-SNE/')
from fast_tsne import fast_tsne
Related
This used to work for me, but since two days now i am getting this issue:
pip install sklearn-contrib-py-earth
Collecting sklearn-contrib-py-earth
Using cached https://files.pythonhosted.org/packages/f8/c4/53a24835bafac880036446cc13839471a025b41de1436543f30d15d846c1/sklearn-contrib-py-earth-0.1.0.tar.gz
Requirement already satisfied: scipy>=0.16 in /usr/local/lib/python3.7/dist-packages (from sklearn-contrib-py-earth) (1.4.1)
Requirement already satisfied: scikit-learn>=0.16 in /usr/local/lib/python3.7/dist-packages (from sklearn-contrib-py-earth) (0.22.2.post1)
Requirement already satisfied: six in /usr/local/lib/python3.7/dist-packages (from sklearn-contrib-py-earth) (1.15.0)
Requirement already satisfied: numpy>=1.13.3 in /usr/local/lib/python3.7/dist-packages (from scipy>=0.16->sklearn-contrib-py-earth) (1.19.5)
Requirement already satisfied: joblib>=0.11 in /usr/local/lib/python3.7/dist-packages (from scikit-learn>=0.16->sklearn-contrib-py-earth) (1.0.1)
Building wheels for collected packages: sklearn-contrib-py-earth
Building wheel for sklearn-contrib-py-earth (setup.py) ... error
ERROR: Failed building wheel for sklearn-contrib-py-earth
Running setup.py clean for sklearn-contrib-py-earth
Failed to build sklearn-contrib-py-earth
Installing collected packages: sklearn-contrib-py-earth
Running setup.py install for sklearn-contrib-py-earth ... error
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-s6vbb2vf/sklearn-contrib-py-earth/setup.py'"'"'; __file__='"'"'/tmp/pip-install-s6vbb2vf/sklearn-contrib-py-earth/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-j66r3m9x/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
This worked for me:
pip install git+https://github.com/scikit-learn-contrib/py-earth#v0.2dev
Try this:
git clone git://github.com/scikit-learn-contrib/py-earth.git
cd py-earth
python setup.py install --cythonize
I tried pip install openbabel --log log_file and I got the following error:
Collecting openbabel
Using cached openbabel-2.4.1.tar.gz (74 kB)
Building wheels for collected packages: openbabel
Building wheel for openbabel (setup.py) ... error
ERROR: Failed building wheel for openbabel
Running setup.py clean for openbabel
Failed to build openbabel
Installing collected packages: openbabel
Running setup.py install for openbabel ... error
ERROR: Command errored out with exit status 1: /usr/local/opt/python/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/59/zn1rl7b13tqc7t2njskzp6th0000gn/T/pip-install-d2aqd_xf/openbabel/setup.py'"'"'; __file__='"'"'/private/var/folders/59/zn1rl7b13tqc7t2njskzp6th0000gn/T/pip-install-d2aqd_xf/openbabel/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/59/zn1rl7b13tqc7t2njskzp6th0000gn/T/pip-record-i_0qytcj/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.7m/openbabel Check the logs for full command output.
Here pip is an alias for pip3.
The log file is here (I am not sure if you can read it, this is my first time sharing a file)
note: A few days ago I opened a second user on my computer, I don't know how it affects things but maybe that's the reason.
I am using Mac OS Catalina.
From a quick look at the log file it looks like it wont install as it cant find a version for Mac OS, only for Windows, however the following may be useful as a workaround to that: How to Install openbabel for Python 3.6 on macOS Sierra 10.12.3
So I found a much simpler way than building openbabel manually. brew install openbabel works for openbabel3
Check the link: http://openbabel.org/wiki/Category:Installation
I am trying to install the scipy library with python3 -m pip install --user --no-use-pep517 scipy but I am receiving the following error:
ERROR: Failed building wheel for scipy
Running setup.py clean for scipy
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-spokr6ic/scipy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-spokr6ic/scipy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' clean --all
cwd: /tmp/pip-install-spokr6ic/scipy
I am using that code to install because pip3 install scipy is giving me this error:
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
How can I resolve this issue?
Python == 3.7.3
PS:The complete traceback is 414 lines. I don't know if I should include here.
Try this:
sudo apt update
sudo apt install -y python3-scipy
I am working on a Mac OSX 10.13.6 and trying to build a barcode reader using python3. Unfortunately, I can not even import the decode module in the pyzbar package. I have tried installing zbar, libzbar0, zbarlight, etc. and all attempts fail
Here are my successful installations
$ pip3 install pyzbar
Requirement already satisfied: pyzbar in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (0.1.8)
$ pip3 install opencv-python
Requirement already satisfied: opencv-python in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (4.1.1.26)
Requirement already satisfied: numpy>=1.14.5 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from opencv-python) (1.16.2)
Here is the failure message when I try to use my successfully installed pyzbar package to import a decode function despite the face that I know pyzbar has a decode function:
>>> from pyzbar.pyzbar import decode
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pyzbar/pyzbar.py", line 7, in <module>
from .wrapper import (
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pyzbar/wrapper.py", line 143, in <module>
c_uint_p, # minor
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pyzbar/wrapper.py", line 136, in zbar_function
return prototype((fname, load_libzbar()))
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pyzbar/wrapper.py", line 115, in load_libzbar
libzbar, dependencies = zbar_library.load()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pyzbar/zbar_library.py", line 65, in load
raise ImportError('Unable to find zbar shared library')
ImportError: Unable to find zbar shared library
When I tried to install zbar, this is what occurred:
$ pip3 install zbar
Collecting zbar
Using cached https://files.pythonhosted.org/packages/33/54/cc5819efc9ee7e34b60b41e1d2d4753b6dd0c26a41c9a552611f66aa106e/zbar-0.10.tar.bz2
Building wheels for collected packages: zbar
Building wheel for zbar (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/74/01qhmy3s3qg_fwctkdf6mrvh0000gn/T/pip-install-rhbz3vss/zbar/setup.py'"'"'; __file__='"'"'/private/var/folders/74/01qhmy3s3qg_fwctkdf6mrvh0000gn/T/pip-install-rhbz3vss/zbar/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/74/01qhmy3s3qg_fwctkdf6mrvh0000gn/T/pip-wheel-z0xoqwir --python-tag cp37
cwd: /private/var/folders/74/01qhmy3s3qg_fwctkdf6mrvh0000gn/T/pip-install-rhbz3vss/zbar/
Complete output (13 lines):
running bdist_wheel
running build
running build_ext
building 'zbar' extension
creating build
creating build/temp.macosx-10.9-x86_64-3.7
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 -c zbarmodule.c -o build/temp.macosx-10.9-x86_64-3.7/zbarmodule.o
In file included from zbarmodule.c:24:
./zbarmodule.h:26:10: fatal error: 'zbar.h' file not found
#include <zbar.h>
^~~~~~~~
1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for zbar
Running setup.py clean for zbar
Failed to build zbar
Installing collected packages: zbar
Running setup.py install for zbar ... error
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/74/01qhmy3s3qg_fwctkdf6mrvh0000gn/T/pip-install-rhbz3vss/zbar/setup.py'"'"'; __file__='"'"'/private/var/folders/74/01qhmy3s3qg_fwctkdf6mrvh0000gn/T/pip-install-rhbz3vss/zbar/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/74/01qhmy3s3qg_fwctkdf6mrvh0000gn/T/pip-record-5zw82lo9/install-record.txt --single-version-externally-managed --compile
cwd: /private/var/folders/74/01qhmy3s3qg_fwctkdf6mrvh0000gn/T/pip-install-rhbz3vss/zbar/
Complete output (13 lines):
running install
running build
running build_ext
building 'zbar' extension
creating build
creating build/temp.macosx-10.9-x86_64-3.7
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 -c zbarmodule.c -o build/temp.macosx-10.9-x86_64-3.7/zbarmodule.o
In file included from zbarmodule.c:24:
./zbarmodule.h:26:10: fatal error: 'zbar.h' file not found
#include <zbar.h>
^~~~~~~~
1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/74/01qhmy3s3qg_fwctkdf6mrvh0000gn/T/pip-install-rhbz3vss/zbar/setup.py'"'"'; __file__='"'"'/private/var/folders/74/01qhmy3s3qg_fwctkdf6mrvh0000gn/T/pip-install-rhbz3vss/zbar/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/74/01qhmy3s3qg_fwctkdf6mrvh0000gn/T/pip-record-5zw82lo9/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
So then went to https://pypi.org/project/pyzbar/ and read that "The zbar DLLs are included with the Windows Python wheels. On other operating systems, you will need to install the zbar shared library." The site then gives an option to use brew install zbar or pip install pyzbar.
Because I do not want to install homebrew, I used pip install pyzbar.
It did not help. Any advice on getting this to work?
This worked for me, sudo apt-get install zbar-tools
How to solve the below mentioned cmake error while installing the face_recognition library?
Collecting face_recognition
Using cached face_recognition-1.2.1-py2.py3-none-any.whl
Requirement already satisfied: face-recognition-models>=0.3.0 in ./anaconda/lib/python3.6/site-packages (from face_recognition)
Requirement already satisfied: Pillow in ./anaconda/lib/python3.6/site-packages (from face_recognition)
Requirement already satisfied: Click>=6.0 in ./anaconda/lib/python3.6/site-packages (from face_recognition)
Requirement already satisfied: scipy>=0.17.0 in ./anaconda/lib/python3.6/site-packages (from face_recognition)
Collecting dlib>=19.7 (from face_recognition)
Using cached dlib-19.10.0.tar.gz
Requirement already satisfied: numpy in ./anaconda/lib/python3.6/site-packages (from face_recognition)
Requirement already satisfied: olefile in ./anaconda/lib/python3.6/site-packages (from Pillow->face_recognition)
Building wheels for collected packages: dlib
Running setup.py bdist_wheel for dlib ... error
Complete output from command /Users/muralidharan/anaconda/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/xz/rcv9f_6x41gcvhrqzsd6mrxw0000gn/T/pip-build-5zqyoigf/dlib/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 /var/folders/xz/rcv9f_6x41gcvhrqzsd6mrxw0000gn/T/tmpw6lzrrukpip-wheel- --python-tag cp36:
running bdist_wheel
running build
running build_py
package init file 'dlib/__init__.py' not found (or not a regular file)
running build_ext
Invoking CMake setup: 'cmake /private/var/folders/xz/rcv9f_6x41gcvhrqzsd6mrxw0000gn/T/pip-build-5zqyoigf/dlib/tools/python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/private/var/folders/xz/rcv9f_6x41gcvhrqzsd6mrxw0000gn/T/pip-build-5zqyoigf/dlib/build/lib.macosx-10.7-x86_64-3.6 -DPYTHON_EXECUTABLE=/Users/muralidharan/anaconda/bin/python -DCMAKE_BUILD_TYPE=Release'
error: [Errno 2] No such file or directory: 'cmake'
----------------------------------------
Failed building wheel for dlib
Running setup.py clean for dlib
Failed to build dlib
Installing collected packages: dlib, face-recognition
Running setup.py install for dlib ... error
Complete output from command /Users/muralidharan/anaconda/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/xz/rcv9f_6x41gcvhrqzsd6mrxw0000gn/T/pip-build-5zqyoigf/dlib/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/xz/rcv9f_6x41gcvhrqzsd6mrxw0000gn/T/pip-qhc3clwr-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
package init file 'dlib/__init__.py' not found (or not a regular file)
running build_ext
Invoking CMake setup: 'cmake /private/var/folders/xz/rcv9f_6x41gcvhrqzsd6mrxw0000gn/T/pip-build-5zqyoigf/dlib/tools/python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/private/var/folders/xz/rcv9f_6x41gcvhrqzsd6mrxw0000gn/T/pip-build-5zqyoigf/dlib/build/lib.macosx-10.7-x86_64-3.6 -DPYTHON_EXECUTABLE=/Users/muralidharan/anaconda/bin/python -DCMAKE_BUILD_TYPE=Release'
error: [Errno 2] No such file or directory: 'cmake'
----------------------------------------
Command "/Users/muralidharan/anaconda/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/xz/rcv9f_6x41gcvhrqzsd6mrxw0000gn/T/pip-build-5zqyoigf/dlib/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/xz/rcv9f_6x41gcvhrqzsd6mrxw0000gn/T/pip-qhc3clwr-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/xz/rcv9f_6x41gcvhrqzsd6mrxw0000gn/T/pip-build-5zqyoigf/dlib/
As to me, I install face_recognition in ubuntu16 python2.7, I write a shell to install it.
#!/bin/bash
# This shell script install face_recognition in ubuntu16 python2.7
apt-get -y install git
apt-get -y install cmake
# install dlib without cuda
git clone https://github.com/davisking/dlib.git
cd dlib
mkdir build; cd build; cmake .. ; cmake --build .
# install dlib python interface
cd -
apt-get -y install python-setuptools
apt-get -y install python-dev
python setup.py install
# install face_recognition
apt-get -y install python-pip
pip install face_recognition
error: [Errno 2] No such file or directory: 'cmake'
I ran into the same problem recently, I resolved it downloading CMAKE.
Here is the link to download it for each OS