Caffe2 doesn't seem to see cuDNN? - linux

I am trying to install SpConv (spatially sparse convolution library), however when running python3 setup.py bdist_wheel, I get an error which seems to be related to Caffe2 not being able to see cuDNN, as I infer from this message:
CMake Error at /home/ivan/.local/lib/python3.6/site-packages/torch/share/cmake/Caffe2/Caffe2Config.cmake:96 (message):
Your installed Caffe2 version uses cuDNN but I cannot find the cuDNN
libraries. Please set the proper cuDNN prefixes and / or install cuDNN.
I have tried reinstalling cuDNN but no luck. Can I manually point Caffe2 to cuDNN? This is because usually cuda is located in /usr/local/cuda/, however I have it in /usr/lib/cuda.
Full output below:
running bdist_wheel
running build
running build_py
running build_ext
Release
|||||CMAKE ARGS||||| ['-DCMAKE_PREFIX_PATH=/home/ivan/.local/lib/python3.6/site-packages/torch', '-DPYBIND11_PYTHON_VERSION=3.6', '-DSPCONV_BuildTests=OFF', '-DCMAKE_CUDA_FLAGS="--expt-relaxed-constexpr" -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/mnt/home/ivan/second.pytorch/second/spconv/build/lib.linux-x86_64-3.6/spconv', '-DCMAKE_BUILD_TYPE=Release']
-- Caffe2: CUDA detected: 9.1
-- Caffe2: CUDA nvcc is: /usr/bin/nvcc
-- Caffe2: CUDA toolkit directory: /usr
-- Caffe2: Header version is: 9.1
-- Could NOT find CUDNN (missing: CUDNN_INCLUDE_DIR)
CMake Warning at /home/ivan/.local/lib/python3.6/site-packages/torch/share/cmake/Caffe2/public/cuda.cmake:131 (message):
Caffe2: Cannot find cuDNN library. Turning the option off
Call Stack (most recent call first):
/home/ivan/.local/lib/python3.6/site-packages/torch/share/cmake/Caffe2/Caffe2Config.cmake:88 (include)
/home/ivan/.local/lib/python3.6/site-packages/torch/share/cmake/Torch/TorchConfig.cmake:40 (find_package)
CMakeLists.txt:20 (find_package)
-- Autodetected CUDA architecture(s): 6.1
-- Added CUDA NVCC flags for: -gencode;arch=compute_61,code=sm_61
CMake Error at /home/ivan/.local/lib/python3.6/site-packages/torch/share/cmake/Caffe2/Caffe2Config.cmake:96 (message):
Your installed Caffe2 version uses cuDNN but I cannot find the cuDNN
libraries. Please set the proper cuDNN prefixes and / or install cuDNN.
Call Stack (most recent call first):
/home/ivan/.local/lib/python3.6/site-packages/torch/share/cmake/Torch/TorchConfig.cmake:40 (find_package)
CMakeLists.txt:20 (find_package)
-- Configuring incomplete, errors occurred!
See also "/mnt/home/ivan/second.pytorch/second/spconv/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeOutput.log".
See also "/mnt/home/ivan/second.pytorch/second/spconv/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
File "setup.py", line 99, in <module>
zip_safe=False,
File "/home/ivan/.local/lib/python3.6/site-packages/setuptools/__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/lib/python3/dist-packages/wheel/bdist_wheel.py", line 204, in run
self.run_command('build')
File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/lib/python3.6/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "setup.py", line 40, in run
self.build_extension(ext)
File "setup.py", line 82, in build_extension
subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
File "/usr/lib/python3.6/subprocess.py", line 311, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '/mnt/home/ivan/second.pytorch/second/spconv', '-DCMAKE_PREFIX_PATH=/home/ivan/.local/lib/python3.6/site-packages/torch', '-DPYBIND11_PYTHON_VERSION=3.6', '-DSPCONV_BuildTests=OFF', '-DCMAKE_CUDA_FLAGS="--expt-relaxed-constexpr" -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/mnt/home/ivan/second.pytorch/second/spconv/build/lib.linux-x86_64-3.6/spconv', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.
System: Ubuntu 18.04, CUDA 9.1, cuDNN 7.6.3

Found the problem. I needed to set CUDNN_INCLUDE_DIR to /usr/lib/cuda/include (i.e. where the cudnn.h file is located).
Lesson learnt: take time to understand the error, missing: CUDNN_INCLUDE_DIR was key.

Another way to fix this:
Acquire cuDNN from here. You may have to register to do this, but the registration is free.
Unpack the cuDNN archive file.
Move the cuDNN files as follows:
sudo cp cuda/include/cudnn*.h /usr/local/cuda/include
sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64
sudo chmod a+r /usr/local/cuda/include/cudnn*.h /usr/local/cuda/lib64/libcudnn*
Alternately, place a symoblic link at /usr/local/ pointing to the cuda directory produced by unpacking the cuDNN archive.

Related

FAILED: meson-install

I want to install the totem app from the source GNOME code.
I cloned source code for totem app from GNOME github, and compiled with messon and ninja commands, and all of that was successfully compiled.
The problem is when I call command meson install, at one point it breaks off.
The steps I followed:
git clone https://github.com/GNOME/totem.git
cd totem
meson builddir
ninja
ninja test
cd ..
meson compile
cd builddir
sudo ninja install
Error which occured:
Traceback (most recent call last):
File "/usr/bin/meson", line 20, in <module>
sys.exit(mesonmain.main())
File "/usr/lib/python3/dist-packages/mesonbuild/mesonmain.py", line 226, in main
return run(sys.argv[1:], launcher)
File "/usr/lib/python3/dist-packages/mesonbuild/mesonmain.py", line 215, in run
return run_script_command(args[1], args[2:])
File "/usr/lib/python3/dist-packages/mesonbuild/mesonmain.py", line 163, in run_script_command
return module.run(script_args)
File "/usr/lib/python3/dist-packages/mesonbuild/scripts/yelphelper.py", line 130, in run
merge_translations(build_subdir, abs_sources, langs)
File "/usr/lib/python3/dist-packages/mesonbuild/scripts/yelphelper.py", line 57, in merge_translations
subprocess.call([
File "/usr/lib/python3.8/subprocess.py", line 340, in call
with Popen(*popenargs, **kwargs) as p:
File "/usr/lib/python3.8/subprocess.py", line 854, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.8/subprocess.py", line 1702, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'itstool'
FAILED: meson-install
/usr/bin/meson install --no-rebuild
ninja: build stopped: subcommand failed.
Note: I tried on two PC (ubuntu 20.04), and on one PC it works, and other I got an error.
It looks you are missing one of the build dependencies for totem: itstool (converts xml localization (language translations) data); dependent through usage of i18 module here. You can install it with
sudo apt-get install itstool
Here is the list of other required dependencies (latest or another package versions may or may not work though).

Slycot fails to import when using control

I cannot seem to get the control.ss2tf() function to work for state space MIMO system. The function works perfectly for a SISO system.
The following code is used to run the module:
control.ss2tf(A,B,C,D)
The resulting output indicated that the slycot module was not installed.
I then tried installing slycot with
pip install slycot
This command gave the following output:
Failed building wheel for slycot
Running setup.py clean for slycot
Failed to build slycot
Installing collected packages: slycot
Running setup.py install for slycot ... error
Complete output from command c:\users\wian\anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Wian\\AppData\\Local\\Temp\\pip-install-cmcxwtts\\slycot\\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\Wian\AppData\Local\Temp\pip-record-_n6gj2yv\install-record.txt --single-version-externally-managed --compile:
Running from numpy source directory.
running install
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
build_src
building py_modules sources
building extension "slycot._wrapper" sources
f2py options: []
adding 'build\src.win-amd64-3.6\build\src.win-amd64-3.6\slycot\src\fortranobject.c' to sources.
adding 'build\src.win-amd64-3.6\build\src.win-amd64-3.6\slycot\src' to include_dirs.
adding 'build\src.win-amd64-3.6\slycot\src\_wrapper-f2pywrappers.f' to sources.
build_src: building npy-pkg config files
running build_py
copying slycot\version.py -> build\lib.win-amd64-3.6\slycot
copying build\src.win-amd64-3.6\slycot\__config__.py -> build\lib.win-amd64-3.6\slycot
running build_ext
Looking for python36.dll
Building import library (arch=AMD64): "c:\users\wian\anaconda3\libs\libpython36.a" (from c:\users\wian\anaconda3\python36.dll)
objdump.exe: c:\users\wian\anaconda3\python36.dll: file format not recognized
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Wian\AppData\Local\Temp\pip-install-cmcxwtts\slycot\setup.py", line 241, in <module>
setup_package()
File "C:\Users\Wian\AppData\Local\Temp\pip-install-cmcxwtts\slycot\setup.py", line 233, in setup_package
setup(**metadata)
File "c:\users\wian\anaconda3\lib\site-packages\numpy\distutils\core.py", line 171, in setup
return old_setup(**new_attr)
File "c:\users\wian\anaconda3\lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "c:\users\wian\anaconda3\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\wian\anaconda3\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "c:\users\wian\anaconda3\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\users\wian\anaconda3\lib\site-packages\numpy\distutils\command\install.py", line 62, in run
r = self.setuptools_run()
File "c:\users\wian\anaconda3\lib\site-packages\numpy\distutils\command\install.py", line 36, in setuptools_run
return distutils_install.run(self)
File "c:\users\wian\anaconda3\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "c:\users\wian\anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\wian\anaconda3\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\users\wian\anaconda3\lib\site-packages\numpy\distutils\command\build.py", line 47, in run
old_build.run(self)
File "c:\users\wian\anaconda3\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\wian\anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\wian\anaconda3\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\users\wian\anaconda3\lib\site-packages\numpy\distutils\command\build_ext.py", line 116, in run
force=self.force)
File "c:\users\wian\anaconda3\lib\site-packages\numpy\distutils\ccompiler.py", line 765, in new_compiler
compiler = klass(None, dry_run, force)
File "c:\users\wian\anaconda3\lib\site-packages\numpy\distutils\mingw32ccompiler.py", line 103, in __init__
build_import_library()
File "c:\users\wian\anaconda3\lib\site-packages\numpy\distutils\mingw32ccompiler.py", line 415, in build_import_library
return _build_import_library_amd64()
File "c:\users\wian\anaconda3\lib\site-packages\numpy\distutils\mingw32ccompiler.py", line 471, in _build_import_library_amd64
generate_def(dll_file, def_file)
File "c:\users\wian\anaconda3\lib\site-packages\numpy\distutils\mingw32ccompiler.py", line 301, in generate_def
raise ValueError("Symbol table not found")
ValueError: Symbol table not found
I read that this is due to a FORTRAN compiler not installed on the system. I therefore installed gfortran with Ming32. To verify the install I ran the following:
(base) C:\WINDOWS\system32>gfortran
gfortran: fatal error: no input files
compilation terminated.
So gfortran is installed as a compiler, but yet pip remain unable to install slycot. I have also installed Microsoft Visual Studio 2017.
At this point I went to PyPi library to download the compiled binary of the slycot module. https://www.lfd.uci.edu/~gohlke/pythonlibs/
Here I downloaded the correct .whl file for my system (64 bit Python 3.6), and installed it with pip.
pip install "C:\Users\Wian\Desktop\slycot-0.3.3-cp36-cp36m-win_amd64.whl"
Using this command slycot 0.3.3 was installed successfully. However, when i run the command
control.ss2tf(A,B,C,D)
I get the following output
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
~\Anaconda3\lib\site-packages\control\xferfcn.py in _convertToTransferFunction(sys, **kw)
1089 try:
-> 1090 from slycot import tb04ad
1091 if len(kw):
ImportError: cannot import name 'tb04ad'
During handling of the above exception, another exception occurred:
TypeError Traceback (most recent call last)
<ipython-input-8-2b014ac15956> in <module>()
----> 1 control.ss2tf(Model)
~\Anaconda3\lib\site-packages\control\xferfcn.py in ss2tf(*args)
1315 sys = args[0]
1316 if isinstance(sys, StateSpace):
-> 1317 return _convertToTransferFunction(sys)
1318 else:
1319 raise TypeError("ss2tf(sys): sys must be a StateSpace object. It \
~\Anaconda3\lib\site-packages\control\xferfcn.py in _convertToTransferFunction(sys, **kw)
1113 # If slycot is not available, use signal.lti (SISO only)
1114 if (sys.inputs != 1 or sys.outputs != 1):
-> 1115 raise TypeError("No support for MIMO without slycot")
1116
1117 # Do the conversion using sp.signal.ss2tf
TypeError: No support for MIMO without slycot
When I try to import slycot in Python, I get the following result:
>>> import slycot
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\Wian\Anaconda3\lib\site-packages\slycot\__init__.py", line 18, in <module>
from .analysis import ab01nd,ab05md,ab05nd,ab07nd,ab08nd, \
File "C:\Users\Wian\Anaconda3\lib\site-packages\slycot\analysis.py", line 21, in <module>
from . import _wrapper
ImportError: DLL load failed: The specified module could not be found.
There is a _wrapper.pyd file in the Slycot directory (under Anaconda3\Libs\site-packages).
This is where I am currently stuck, and I cannot get Slycot to import correctly.
Your help is greatly appreciated!

Error installing dlib in windows 10

I can't seem to install dlib on my windows 10 machine using pip.
I am using python 3.6.1
i did try pip installing dlib using the following commands
pip install dlib
but it returns me with the following error.
Collecting dlib
Using cached dlib-19.10.0.tar.gz
Installing collected packages: dlib
Running setup.py install for dlib ... error
Complete output from command c:\users\ayush\appdata\local\programs\python \python36-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Ayush\\AppData\\Local\\Temp\\pip-build-iu6_cvvs\\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 C:\Users\Ayush\AppData\Local\Temp\pip-uhnfkgpd-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 C:\Users\Ayush\AppData\Local\Temp\pip-build-iu6_cvvs\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Ayush\AppData\Local\Temp\pip-build-iu6_cvvs\dlib\build\lib.win32-3.6 -DPYTHON_EXECUTABLE=c:\users\ayush\appdata\local\programs\python\python36-32\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Ayush\AppData\Local\Temp\pip-build-iu6_cvvs\dlib\build\lib.win32-3.6'
-- Building for: NMake Makefiles
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error in CMakeLists.txt:
The CMAKE_C_COMPILER:
cl
is not a full path and was not found in the PATH.
To use the NMake generator with Visual C++, cmake must be run from a shell
that can use the compiler cl from the command line. This environment is
unable to invoke the cl compiler. To fix this problem, run cmake from the
Visual Studio Command Prompt (vcvarsall.bat).
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.
CMake Error in CMakeLists.txt:
The CMAKE_CXX_COMPILER:
cl
is not a full path and was not found in the PATH.
To use the NMake generator with Visual C++, cmake must be run from a shell
that can use the compiler cl from the command line. This environment is
unable to invoke the cl compiler. To fix this problem, run cmake from the
Visual Studio Command Prompt (vcvarsall.bat).
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred!
See also "C:/Users/Ayush/AppData/Local/Temp/pip-build-iu6_cvvs/dlib/build/temp.win32-3.6/Release/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Ayush/AppData/Local/Temp/pip-build-iu6_cvvs/dlib/build/temp.win32-3.6/Release/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Ayush\AppData\Local\Temp\pip-build-iu6_cvvs\dlib\setup.py", line 249, in <module>
'Topic :: Software Development',
File "c:\users\ayush\appdata\local\programs\python\python36-32\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\ayush\appdata\local\programs\python\python36-32\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "c:\users\ayush\appdata\local\programs\python\python36-32\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\users\ayush\appdata\local\programs\python\python36-32\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "c:\users\ayush\appdata\local\programs\python\python36-32\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "c:\users\ayush\appdata\local\programs\python\python36-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\ayush\appdata\local\programs\python\python36-32\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\users\ayush\appdata\local\programs\python\python36-32\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\ayush\appdata\local\programs\python\python36-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\ayush\appdata\local\programs\python\python36-32\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\Ayush\AppData\Local\Temp\pip-build-iu6_cvvs\dlib\setup.py", line 129, in run
self.build_extension(ext)
File "C:\Users\Ayush\AppData\Local\Temp\pip-build-iu6_cvvs\dlib\setup.py", line 163, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "c:\users\ayush\appdata\local\programs\python\python36-32\lib\subprocess.py", line 291, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\Ayush\\AppData\\Local\\Temp\\pip-build-iu6_cvvs\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\Ayush\\AppData\\Local\\Temp\\pip-build-iu6_cvvs\\dlib\\build\\lib.win32-3.6', '-DPYTHON_EXECUTABLE=c:\\users\\ayush\\appdata\\local\\programs\\python\\python36-32\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\Ayush\\AppData\\Local\\Temp\\pip-build-iu6_cvvs\\dlib\\build\\lib.win32-3.6']' returned non-zero exit status 1.
i have Cmake installed and i also tried setting a environmental variable path to the Cmake library but the same error occurs.

py2app Mach-O header error

I am trying to use py2app on the following code:
print(1+1)
I create my setup with:
py2applet --make-setup test.py
Development with alias mode works fine:
python3 setup.py py2app -A
But when I try the standalone mode:
python3 setup.py py2app
I get after a lot of lines:
WARNING: Mach-O header in '/Users/quentinpeter/Documents/PHD/Python/People project/Michele_worms/dist/test.app/Contents/Resources/lib/python3.6/scipy/linalg/_interpolative.cpython-36m-darwin.so' may be too large to relocate
WARNING: Mach-O header in '/Users/quentinpeter/Documents/PHD/Python/People project/Michele_worms/dist/test.app/Contents/Resources/lib/python3.6/scipy/linalg/_interpolative.cpython-36m-darwin.so' may be too large to relocate
Traceback (most recent call last):
File "setup.py", line 18, in <module>
setup_requires=['py2app'],
File "/usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/local/lib/python3.6/site-packages/py2app/build_app.py", line 764, in run
self._run()
File "/usr/local/lib/python3.6/site-packages/py2app/build_app.py", line 974, in _run
self.run_normal()
File "/usr/local/lib/python3.6/site-packages/py2app/build_app.py", line 1082, in run_normal
self.create_binaries(py_files, pkgdirs, extensions, loader_files)
File "/usr/local/lib/python3.6/site-packages/py2app/build_app.py", line 1385, in create_binaries
platfiles = mm.run()
File "/usr/local/lib/python3.6/site-packages/macholib/MachOStandalone.py", line 146, in run
node.write(f)
File "/usr/local/lib/python3.6/site-packages/macholib/MachO.py", line 133, in write
header.write(f)
File "/usr/local/lib/python3.6/site-packages/macholib/MachO.py", line 343, in write
self.synchronize_size()
File "/usr/local/lib/python3.6/site-packages/macholib/MachO.py", line 333, in synchronize_size
self.parent.filename, self.total_size + self.sizediff, self.low_offset, self.sizediff))
ValueError: New Mach-O header is too large to relocate in '/Users/quentinpeter/Documents/PHD/Python/People project/Michele_worms/dist/test.app/Contents/Resources/lib/python3.6/scipy/linalg/_interpolative.cpython-36m-darwin.so' (new size=1764, max size=1712, delta=108)
Do you have any idea what might happen? Most of the things I found online refers to MacPorts but I use homebrew.
info on my python:
Python 3.6.0 (default, Dec 24 2016, 08:01:42)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
I had the same problem and I fixed it by uninstalling the version of macholib that I had (1.8) and installing 1.7 with pip. When using python 2.7, reverting to scipy version 0.14.0 would fix it as well.

Installing cython on windows 7, python 3.4.3 with pip

I try to install cython on windows 7 64bit ( Python 3.4.3 ) via
pip install cython
and ends with the error message
error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat).
Which I find kinda strange since I have visual studio community 2013 installed.
When I ask windows where vcvarsall.bat is it kindly answers me
C:\Users\me>where vcvarsall.bat
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat
So it is in my path. Do I need a different visual studio version and with that a different version of vcvarsall.bat?
Edit 1
I downloaded the VS2010 ISO SonicARG provided. Thank you.
Now cython acknowledges the compiler, but still fails to install.
pip install cython
Running setup.py install for cython
Complete output from command C:\Python34\python.exe -c "import setuptools, tokenize;__file__='C:\\Users\\me\\AppData\\Local\\Temp\\pip-build-12j3y7gp\\cython\\setup.py';exec(compile(getattr(t
okenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\me\AppData\Local\Temp\pip-lgya62cy-record\install-record.txt --single-version-external
ly-managed --compile:
Unable to find pgen, not compiling formal grammar.
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.4
copying cython.py -> build\lib.win-amd64-3.4
creating build\lib.win-amd64-3.4\Cython
copying Cython\CodeWriter.py -> build\lib.win-amd64-3.4\Cython
[Many lines of copying and creating]
copying Cython\Debugger\Tests\cfuncs.c -> build\lib.win-amd64-3.4\Cython\Debugger\Tests
running build_ext
cythoning C:\Users\me\AppData\Local\Temp\pip-build-12j3y7gp\cython\Cython\Plex\Scanners.py to C:\Users\me\AppData\Local\Temp\pip-build-12j3y7gp\cython\Cython\Plex\Scanners.c
building 'Cython.Plex.Scanners' extension
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\me\AppData\Local\Temp\pip-build-12j3y7gp\cython\setup.py", line 357, in <module>
**setup_args
File "C:\Python34\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Python34\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\Python34\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Python34\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "C:\Python34\lib\distutils\command\install.py", line 539, in run
self.run_command('build')
File "C:\Python34\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Python34\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Python34\lib\distutils\command\build.py", line 126, in run
self.run_command(cmd_name)
File "C:\Python34\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Python34\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\me\AppData\Local\Temp\pip-build-12j3y7gp\cython\Cython\Distutils\build_ext.py", line 164, in run
_build_ext.build_ext.run(self)
File "C:\Python34\lib\distutils\command\build_ext.py", line 339, in run
self.build_extensions()
File "C:\Users\me\AppData\Local\Temp\pip-build-12j3y7gp\cython\setup.py", line 192, in build_extensions
build_ext_orig.build_extensions(self)
File "C:\Users\me\AppData\Local\Temp\pip-build-12j3y7gp\cython\Cython\Distutils\build_ext.py", line 172, in build_extensions
self.build_extension(ext)
File "C:\Python34\lib\distutils\command\build_ext.py", line 503, in build_extension
depends=ext.depends)
File "C:\Python34\lib\distutils\msvc9compiler.py", line 460, in compile
self.initialize()
File "C:\Python34\lib\distutils\msvc9compiler.py", line 371, in initialize
vc_env = query_vcvarsall(VERSION, plat_spec)
File "C:\Python34\lib\site-packages\setuptools\msvc9_support.py", line 52, in query_vcvarsall
return unpatched['query_vcvarsall'](version, *args, **kwargs)
File "C:\Python34\lib\distutils\msvc9compiler.py", line 287, in query_vcvarsall
raise ValueError(str(list(result.keys())))
ValueError: ['path']
----------------------------------------
Command "C:\Python34\python.exe -c "import setuptools, tokenize;__file__='C:\\Users\\me\\AppData\\Local\\Temp\\pip-build-12j3y7gp\\cython\\setup.py';exec(compile(getattr(tokenize, 'open', open)(_
_file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\me\AppData\Local\Temp\pip-lgya62cy-record\install-record.txt --single-version-externally-managed --compile" fa
iled with error code 1 in C:\Users\me\AppData\Local\Temp\pip-build-12j3y7gp\cython
Python 3.4 is built against Microsoft's Visual Studio 2010; in order to build native modules you must use the exact version. You can just download the Express Edition to build them, the entire IDE is not necessary. You can fetch the VS2010 ISO from here, and install the C++ component, then try again.
Note for future: If you plan to upgrade Python to 3.5 (release date is September 13, 2015), the Visual Studio version will be 2015, so you can be ready if you have the save problem

Resources