I have been trying to install the BreakOut Detetction pkg (by Roland Hochmuth) in a MacOS Mojave environment.
Following is the pkg I am talking about, https://github.com/roland-hochmuth/BreakoutDetection
I was able to get swig on my machine by using homebrew.
The pkg details 3 steps to install:
swig -python -c++ breakout_detection.i
python setup.py build_ext -I../src build
sudo python setup.py build_ext -I../src install
I got the error with the first step and shows "Unable to find file 'breakout_detection.i'."
Then I try to swig with a detailed file paths, it somehow works with the first step.
However, the second step gives a lot of compilation errors and warnings.
One of the errors shows "error: command 'gcc' failed with exit status 1".
I was wondering if anyone has tried compiling this pkg.
I really want to know how this guy successfully compiled the pkg. (https://www.youtube.com/watch?v=fcsyL5TwIvE)
I found a way to simply solve this issue by putting codes in the breakout detection folder where "breakout_detection.py" is.
Then you can simply "import breakout_detection" library and use it.
Related
We need a tool to work with 3D-Harmonics and we've come across https://github.com/SHTOOLS/SHTOOLS - which fits all of our needs, but could not be installed properly on our windows computers (as it's intended for linux\osx).
When we tried to run pip install . in the directory SHTOOLS-3.3 (we use anaconda for managing packages and it includes pip), we at first got an error saying that we need a Fortran compiler (gfortran) - which we fixed by installing gcc with conda install -c r gcc. Afterwards, we got an error saying we need to install visual C++ compiler - which we downloaded as suggested from https://www.microsoft.com/en-gb/download/details.aspx?id=44266.
Alas, running the command again, this time from the visual C++ 2008 command prompt, we still get a fatal error and are still stuck with installing the library.
Some of the errors we get:
could not find library 'fftw3' in directories ['build\\temp.win-amd64-2.7']
could not find library 'm' in directories ['build\\temp.win-amd64-2.7']
could not find library 'lapack' in directories ['build\\temp.win-amd64-2.7']
could not find library 'blas' in directories ['build\\temp.win-amd64-2.7']
Followed by
LINK: fatal error LNK1181: cannot open input file 'fftw3.lib'
and
Failed building wheel for pyshtools
The full output of the installation attempt can be found here and here.
We've tried to download the lib files of the FFTW3, LAPACK and BLAS libraries but couldn't build them properly.
We would appreciate any help (suggesting a similar library that is compatible with windows \ helping with the install of SHTOOlS).
It's a shame when you find something ready to go but very time consuming to make it work on windows. My advice would be avoid the hazzle of installing that non-ready-to-go-on-windows library and just looking for another alternative, there are few ones dealing with spherical harmonics. What about this one? pyspharm
Also, posting an issue in the library's github issues could speed it up things.
I am trying to install a python package by using python setup.py install but at some point of the installation procedure an error is raised:
gcc: error: x86_64: No such file or directory
gcc: error: unrecognized option ‘-arch’
error: command 'gcc' failed with exit status 1
Previously, I installed Xcode 7.0 and their respective Command Line Tools for Xcode 7. The compiler seems to be in which gcc local /usr/local/bin/gcc. However, when I tried gcc -v I got Segmentation fault: 11. Moreover, when I tried /usr/bin/gcc -v I got
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.0.0 (clang-700.0.72)
Target: x86_64-apple-darwin14.5.0
Thread model: posix
Then, the installed compiler seems to be in a different location. A similar issue was raised in Command line tool installed, but gcc/g++ compiler not working but there is not a clear solution to the problem. Do you have any idea how can I can fix it (link to the actual installed compiler to continue the installation of the Python package)? Thanks in advance.
Expanding on #Droppy's comment: xcode doesn't install gcc in /usr/local/bin (OP did not clarify where it came from). MacPorts would put it in /opt/local/bin/gcc, but omit to select the current port. So CC=clang is the simplest way to answer it. However, OP is asking how to override it in setup.py.
That has been discussed in these questions:
Choosing GCC version when building ( setup.py )
How may I override the compiler (gcc) flags that setup.py uses by default?
How to tell distutils to use gcc?
The first is most pertinent, leading to this suggestion:
CC=/usr/bin/clang CFLAGS="-O" python setup.py build
(clang simply ignores most of the gcc options, not even giving a warning, but setting CFLAGS can help persuade the python script to not try options that clang is unlikely to support).
I am attempting the installation of OpenPIV (python build) on 64-bit Win7.
Upon downloading the setup files(located - https://github.com/alexlib/openpiv-python) and running:
python setup.py install
I receive the error:
error: Unable to find vcvarsall.bat
Some research informed me to use:
python setup.py build --compiler=mingw32
Which then resulted in:
error: command 'gcc' failed: No such file or directory.
So, I installed MinGW and adjusted the PATH variable to include C:\MinGW\bin, where gcc.exe is located, but no dice. Following this, I tried restarting my command prompt, restarting my computer, reinstalling MinGW, and reinstalling the setup files.
Running gcc:
C:\OpenPIV\> gcc
gcc:fatal error: no input files
compilation terminated.
Which I assume means gcc works, but
python setup.py build --compiler=mingw32
still results in:
error: command 'gcc' failed: No such file or directory.
Thanks everyone. Any suggestions/tips would be greatly appreciated.
After hours and hours of searching, I've discovered that this is a problem between MinGW and Python. They don't communicate well with one another.
There exists a binary package of MinGW (unofficial) that was meant for use with Python located here
This fixes the problem!
I'm currently trying to install a few modules via virtualenv, which I have bootstrapped at the moment, and so far pip and easy_install have been working fine. I am now trying to install the Sybase module; however, it seems I need gcc to install it as I'm getting the following output:
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.6
copying Sybase.py -> build/lib.linux-x86_64-2.6
running build_ext
building 'sybasect' extension
creating build/temp.linux-x86_64-2.6
gcc ...
unable to execute gcc: No such file or directory
error: command 'gcc' failed with exit status 1
----------------------------------------
I am now trying to install the python dev package which I'm assuming will solve my problem; however, I don't have network access from the command line and can't use yum install. Is there a way to install the python dev package from a tar.gz or some other method? or just gcc for virtualenv? My machine does not have a native gcc either and I can't get it at this stage.
Installing python-dev will not solve your problem as you miss GNU C compiler on your system.
Installing that one, will probably fix your issue. python-dev is a secondary and missing that one will result in different type of errors (namely missing headers during compilation process).
And.. if you can't get native gcc, I'm afraid you're out of luck at this point.
I am trying to install Cython 0.14 on my Windows 7, 32 bit, coupled with Python 3.2. I followed the instructions given at http://wiki.cython.org/InstallingOnWindows, but have run into several deadends. I think the I have followed the instruction for MinGW exactly, except for the part about opening prompt and test if I have installed MinGW correctly (How do I test that?).
I first ran into some errors when I tried installing Cython by typing
python setup.py install
in cygwin, but I resolved those. However, my python 3.2 still didn't know of the existence of Cython, so I tracked to problem down to cython being installed under c:\cygwin\lib\ while python is installed under c:\python32. So I tried various methods of moving cython to python folder, but since I didn't know where exactly everything goes, those attempts did not come to fruition.
In the interim, I tried to look for different, faster interpreters of python, and installed pypy. I also reinstalled python 3.2 to clear out the mess I made by trying to install cython in the python directory.
Then later I tried to install cython again using the command prompt, with the same script, but found that the default version of python has changed to 2.6, which probably sneaked in with the failed cython installations. But finding that python 2.6 can't compile the setup.py file, I just did
c:\python32\python setup.py install
in the cython directory. This worked until it gave me an error
TypeError: NoneType() is Unordered: if self.gcc_version <= "2.91.57":
in the distutils.cygwinccompiler module in python32. So I changed that to
if (not self.gcc_version == None) and self.gcc_version <= "2.91.57":
When I tried installing again under the command prompt, I get this error:
running build
running build_py
running build_ext
Access is denied.
skipping 'C:\cython-0.14.1\Cython\Plex\Scanners.c' Cython extension (up-to-date)
building 'Cython.Plex.Scanners' extension
C:\cygwin\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\Python32\include -IC:\Pyth
on32\PC -c C:\cython-0.14.1\Cython\Plex\Scanners.c -o c:\cython-0.14.1\cython\pl
ex\scanners.o
error: command 'gcc' failed: Permission denied
I tried the same thing with cygwin and I get the same error. I have restarted my computer and tried again, still same error.
Any and all help would be appreciated, since I spent an entire day on this to no avail.
The "Permission denied" is still a good way to look. It can happen because:
the gcc command is not executable (weird, but are you able to type "gcc --version" and get the output ?)
the destination path "c:\cython-0.14.1\cython\plex\" is not available or not writable. If you have install it with administration right and use with user right, maybe it's the case. Try to give access to everyone here. (disclamer: i'm not a windows guy ^^)
See Get "Access is denied" when trying to compile with g++ from command line. Cygwin. This fully addresses your question. The issue is apparently symlinks (as i learnt today much to my discomfiture).