how can i fix this invalid ELF header errror? - linux

I installed zeromq on ubuntu 10.04 and the compilation went through without any errors.
However when i try to run the python test, it results in this error:
jerome#VM1:~/zeromq/pyzmq-2.0.7$ python setup.py test
running test
Traceback (most recent call last):
File "setup.py", line 144, in <module>
'Topic :: System :: Networking'
File "/usr/lib/python2.6/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/lib/python2.6/distutils/dist.py", line 975, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.6/distutils/dist.py", line 995, in run_command
cmd_obj.run()
File "setup.py", line 59, in run
tests = TestLoader().loadTestsFromNames(testfiles)
File "/usr/lib/python2.6/unittest.py", line 613, in loadTestsFromNames
suites = [self.loadTestsFromName(name, module) for name in names]
File "/usr/lib/python2.6/unittest.py", line 576, in loadTestsFromName
module = __import__('.'.join(parts_copy))
File "/home/jerome/zeromq/pyzmq-2.0.7/zmq/__init__.py", line 26, in <module>
from zmq import _zmq
ImportError: /home/jerome/zeromq/pyzmq-2.0.7/zmq/_zmq.so: invalid ELF header
What do i need to do to fix this?

Try setting up pyzmq like this:
python setup.py configure --zmq=<your_zmqlibrary_installation_path>
python setup.py build_ext --rpath=<your_zmqlibrary_installation_path>/lib --inplace
python setup.py install
python setup.py test

According to how can i fix this invalid ELF header errror? you need to compile zeromq on your target instead of using a MAC OS X version ...

Related

Executable made with pyinstaller doesn't work

I've tried to create an executable of my python script with pyinstaller, but it's not working.
If I run the exe file from terminal, I get these errors:
Traceback (most recent call last):
File "main.py", line 127, in <module>
File "main.py", line 9, in main
File "c:\users\danie\onedrive - universitat de valencia\escritorio\professors banda\profs\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
exec(bytecode, module.__dict__)
File "docx2pdf\__init__.py", line 13, in <module>
File "importlib\metadata.py", line 531, in version
File "importlib\metadata.py", line 504, in distribution
File "importlib\metadata.py", line 177, in from_name
importlib.metadata.PackageNotFoundError: docx2pdf
[13776] Failed to execute script main
I installed pyinstaller using pip inside the virtual environment of the project.
I would appreciate any help.
Thank you in advance.
Seems you have missing modules, that weren't found by PyInstaller analysis hooks.
Try to rebuild your application with --hidden-import=docx2pdf option.

How to solve the metadata wheel error during installation of pyqt5 with pip

I recently installed a virtual environement using pyvenv in Python and it worked fine until I needed to install PyQt5.
After that I also tried installing directly but it gave me other problems too related to SIP
My operating system is Ubuntu 14.04 32 bit,
I ran:
sudo -H python3 -m pip install pyqt5
The output was:
Collecting pyqt5
Using cached PyQt5-5.15.0.tar.gz (3.3 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... error
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python3 /usr/local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpkqu84tmx
cwd: /tmp/pip-install-d7z8r80t/pyqt5
Complete output (35 lines):
Querying qmake about your Qt installation...
/usr/bin/qmake -query
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 126, in prepare_metadata_for_build_wheel
hook = backend.prepare_metadata_for_build_wheel
AttributeError: module 'sipbuild.api' has no attribute 'prepare_metadata_for_build_wheel'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
main()
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 131, in prepare_metadata_for_build_wheel
config_settings)
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 159, in _get_wheel_metadata_from_wheel
whl_basename = backend.build_wheel(metadata_directory, config_settings)
File "/tmp/pip-build-env-pn13k50g/overlay/lib/python3.6/site-packages/sipbuild/api.py", line 51, in build_wheel
project = AbstractProject.bootstrap('pep517')
File "/tmp/pip-build-env-pn13k50g/overlay/lib/python3.6/site-packages/sipbuild/abstract_project.py", line 82, in bootstrap
project.setup(pyproject, tool, tool_description)
File "/tmp/pip-build-env-pn13k50g/overlay/lib/python3.6/site-packages/sipbuild/project.py", line 477, in setup
self.apply_user_defaults(tool)
File "project.py", line 62, in apply_user_defaults
super().apply_user_defaults(tool)
File "/tmp/pip-build-env-pn13k50g/overlay/lib/python3.6/site-packages/pyqtbuild/project.py", line 86, in apply_user_defaults
super().apply_user_defaults(tool)
File "/tmp/pip-build-env-pn13k50g/overlay/lib/python3.6/site-packages/sipbuild/project.py", line 223, in apply_user_defaults
self.builder.apply_user_defaults(tool)
File "/tmp/pip-build-env-pn13k50g/overlay/lib/python3.6/site-packages/pyqtbuild/builder.py", line 76, in apply_user_defaults
self._get_qt_configuration()
File "/tmp/pip-build-env-pn13k50g/overlay/lib/python3.6/site-packages/pyqtbuild/builder.py", line 445, in _get_qt_configuration
"v{0}".format(self.qt_version_str))
sipbuild.exceptions.UserException
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/bin/python3 /usr/local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpkqu84tmx Check the logs for full command output.

How can I install Python 3.7 on an old centos shared web host (without root)?

I want to install Python 3.7 on a web hosting server that is live (production) without disturbing anything. I have SSH terminal access and I guess the server is running centos from the following commands:
> cat /proc/version
Linux version 3.10.0-693.11.6.1.ELK.el6.x86_64 (...) (gcc version 4.8.2 20140120 (Red Hat 4.8.2-15) (GCC) )
> rpm -qa centos-release
centos-release-6-10.el6.centos.12.3.x86_64
I tried to see what was installed with:
> rpm -qa | sort
...
Python27-2.7.8-1.x86_64
Python27-MySQL-1.2.3-2.el6.x86_64
Python27-bs4-4.1.3-1.noarch
Python27-distribute-0.6.32-1.noarch
Python27-lxml-3.0.1-1.x86_64
Python27-pip-1.2.1-1.noarch
Python27-regex-0.1.20120904-1.x86_64
Python27-virtualenv-1.8.4-1.noarch
Python3-3.2.3-1.x86_64
Python3-distribute-0.6.32-1.noarch
Python3-pip-1.2.1-1.noarch
Python3-virtualenv-1.8.4-1.noarch
...
So it looks like there's Python 2.7 and 3.2 already installed, and I don't want to disturb them.
I want to run a Python 3.7 script with dependencies on some modules.
What is the safest way of installing Python 3.7 (along with pip for modules) somewhere that will not mess with the current installation?
NOTE: I am familiar with conda/pip mostly on Windows, but I have limited knowledge of this linux environment.
EDIT: I first thought it was RHEL. I edited the post for centos.
EDIT: I have tried many unsuccessful attempts to install Python 3.7 on this shared web hosting:
Trying to create a virtualenv with Python 3.2:
> python3 -m virtualenv my_isolated_py3
New python executable in my_isolated_py3/bin/python3
Also creating executable in my_isolated_py3/bin/python
Installing distribute.....................
Complete output from command /home2/cccccc/my_isolated_py3/bin/python3 -c "#!python
\"\"\"Bootstra... sys.exit(main())
":
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.31.tar.gz
Traceback (most recent call last):
File "<string>", line 541, in <module>
File "<string>", line 537, in main
File "<string>", line 201, in download_setuptools
File "/opt/python3/lib/python3.2/urllib/request.py", line 138, in urlopen
return opener.open(url, data, timeout)
File "/opt/python3/lib/python3.2/urllib/request.py", line 375, in open
response = meth(req, response)
File "/opt/python3/lib/python3.2/urllib/request.py", line 487, in http_response
'http', request, response, code, msg, hdrs)
File "/opt/python3/lib/python3.2/urllib/request.py", line 413, in error
return self._call_chain(*args)
File "/opt/python3/lib/python3.2/urllib/request.py", line 347, in _call_chain
result = func(*args)
File "/opt/python3/lib/python3.2/urllib/request.py", line 495, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: SSL is required
----------------------------------------
...Installing distribute...done.
Traceback (most recent call last):
File "/opt/python3/lib/python3.2/runpy.py", line 160, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/opt/python3/lib/python3.2/runpy.py", line 73, in _run_code
exec(code, run_globals)
File "/opt/python3/lib/python3.2/site-packages/virtualenv.py", line 2560, in <module>
main()
File "/opt/python3/lib/python3.2/site-packages/virtualenv.py", line 964, in main
never_download=options.never_download)
File "/opt/python3/lib/python3.2/site-packages/virtualenv.py", line 1071, in create_environment
search_dirs=search_dirs, never_download=never_download)
File "/opt/python3/lib/python3.2/site-packages/virtualenv.py", line 616, in install_distribute
search_dirs=search_dirs, never_download=never_download)
File "/opt/python3/lib/python3.2/site-packages/virtualenv.py", line 583, in _install_req
cwd=cwd)
File "/opt/python3/lib/python3.2/site-packages/virtualenv.py", line 1042, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /home2/cccccc/my_isolated_py3/bin/python3 -c "#!python
\"\"\"Bootstra... sys.exit(main())
" failed with error code 1
The key error is urllib.error.HTTPError: HTTP Error 403: SSL is required, which seems related to old non-https repository.
Trying to create a virtualenv with Python 2.6:
> python -m virtualenv my_isolated_py2
Traceback (most recent call last):
File "/usr/lib64/python2.6/runpy.py", line 122, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib64/python2.6/runpy.py", line 34, in _run_code
exec code in run_globals
File "/usr/lib/python2.6/site-packages/virtualenv.py", line 2352, in <module>
main()
File "/usr/lib/python2.6/site-packages/virtualenv.py", line 825, in main
symlink=options.symlink)
File "/usr/lib/python2.6/site-packages/virtualenv.py", line 985, in create_environment
site_packages=site_packages, clear=clear, symlink=symlink))
File "/usr/lib/python2.6/site-packages/virtualenv.py", line 1179, in install_python
copyfile(join(stdlib_dir, fn), join(lib_dir, fn), symlink)
File "/usr/lib/python2.6/site-packages/virtualenv.py", line 479, in copyfile
copyfileordir(src, dest, symlink)
File "/usr/lib/python2.6/site-packages/virtualenv.py", line 454, in copyfileordir
shutil.copytree(src, dest, symlink)
File "/usr/lib64/python2.6/shutil.py", line 173, in copytree
raise Error, errors
shutil.Error: [('/usr/lib64/python2.6/config/libpython2.6.so', 'my_isolated_py2/lib/python2.6/config/libpython2.6.so', '[Errno 2] No such file or directory')]
Trying to install Python 3.7 miniconda:
> wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
Resolving repo.anaconda.com... 104.16.130.3, 104.16.131.3, 2606:4700::6810:8203, ...
Connecting to repo.anaconda.com|104.16.130.3|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 85055499 (81M) [application/x-sh]
Saving to: `Miniconda3-latest-Linux-x86_64.sh'
100%[=========================================>] 85,055,499 108M/s in 0.8s
2020-06-11 08:22:53 (108 MB/s) - `Miniconda3-latest-Linux-x86_64.sh' saved [85055499/85055499]
> bash Miniconda3-latest-Linux-x86_64.sh
...
Unpacking payload ...
Miniconda3-latest-Linux-x86_64.sh: line 409: /home2/cccccc/miniconda3/preconda.tar.bz2: No such file or directory
Trying to install Python 3.7 from sources:
> wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tgz
> tar xvzf Python-3.7.3.tgz
> cd Python-3.7.3
> ./configure --prefix=$HOME/python_37
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for python3.7... no
checking for python3... python3
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... checking for --without-gcc... no
checking for --with-icc... no
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in '/home2/cccccc/Python-3.7.3':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
Trying to install Python 3.7 portable binaries:
> wget https://github.com/indygreg/python-build-standalone/releases/download/20200408/cpython-3.7.7-linux64-20200409T0045.tar.zst
> [unzstd on another machine since not installed here]
> tar -xvf cpython-3.7.7-linux64-20200409T0045.tar
...
tar: python/install/share/man/man1/python3.1: Cannot create symlink to `python3.7.1': No such file or directory
...
> ./python/install/bin/python3.7m
./python/install/bin/python3.7m: /lib64/libc.so.6: version `GLIBC_2.13' not found (required by ./python/install/bin/python3.7m)
I also found out that this shared web hosting greatly limits what we can do through terminal, which is jailshell.
Do I have any options left to use Python 3.7 on this machine?
You can use venv to completely isolate your python environment from all other python versions (and python libraries) installed in the system.
Read the virtual environment, venv, docs here.

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!

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.

Resources