Emacs 24.4 on Mac? - macos

I am trying to get Emacs 24.4 running on Mac (Maverick).
I have tried following these instructions, but when I run:
./build-emacs gzr
I get the error:
bzr: ERROR: exceptions.ImportError: Unable to load subvertpy extensions: dlopen(/Library/Python/2.6/site-packages/subvertpy/client.so, 2): Library not loaded: /usr/lib/libsvn_client-1.0.dylib
Referenced from: /Library/Python/2.6/site-packages/subvertpy/client.so
Reason: image not found
Traceback (most recent call last):
File "/Library/Python/2.6/site-packages/bzrlib/commands.py", line 930, in exception_to_return_code
return the_callable(*args, **kwargs)
File "/Library/Python/2.6/site-packages/bzrlib/commands.py", line 1121, in run_bzr
ret = run(*run_argv)
File "/Library/Python/2.6/site-packages/bzrlib/commands.py", line 673, in run_argv_aliases
return self.run(**all_cmd_args)
File "/Library/Python/2.6/site-packages/bzrlib/commands.py", line 697, in run
return self._operation.run_simple(*args, **kwargs)
File "/Library/Python/2.6/site-packages/bzrlib/cleanup.py", line 136, in run_simple
self.cleanups, self.func, *args, **kwargs)
File "/Library/Python/2.6/site-packages/bzrlib/cleanup.py", line 166, in _do_with_cleanups
result = func(*args, **kwargs)
File "/Library/Python/2.6/site-packages/bzrlib/builtins.py", line 2214, in run
show_bzrdir_info(newdir, verbose=0, outfile=self.outf)
File "/Library/Python/2.6/site-packages/bzrlib/info.py", line 378, in show_bzrdir_info
outfile)
File "/Library/Python/2.6/site-packages/bzrlib/info.py", line 394, in show_component_info
format = describe_format(control, repository, branch, working)
File "/Library/Python/2.6/site-packages/bzrlib/info.py", line 499, in describe_format
format = controldir.format_registry.make_bzrdir(key)
File "/Library/Python/2.6/site-packages/bzrlib/controldir.py", line 1348, in make_bzrdir
return self.get(key)()
File "/Library/Python/2.6/site-packages/bzrlib/registry.py", line 177, in get
return self._dict[self._get_key_or_default(key)].get_obj()
File "/Library/Python/2.6/site-packages/bzrlib/registry.py", line 74, in get_obj
self._obj = get_named_object(self._module_name, self._member_name)
File "/Library/Python/2.6/site-packages/bzrlib/pyutils.py", line 51, in get_named_object
obj = __import__(module_name, {}, {}, from_list)
File "/Library/Python/2.6/site-packages/bzrlib/plugins/svn/workingtree.py", line 28, in <module>
import subvertpy
File "/Library/Python/2.6/site-packages/subvertpy/__init__.py", line 131, in <module>
raise ImportError("Unable to load subvertpy extensions: %s" % e)
ImportError: Unable to load subvertpy extensions: dlopen(/Library/Python/2.6/site- packages/subvertpy/client.so, 2): Library not loaded: /usr/lib/libsvn_client-1.0.dylib
Referenced from: /Library/Python/2.6/site-packages/subvertpy/client.so
Reason: image not found
bzr 2.6.0 on python 2.6.8 (Darwin-13.0.0-x86_64-i386-64bit)
arguments: ['/usr/local/bin/bzr', 'init-repo', 'emacs-bzr']
plugins: bash_completion[2.6.0], bzrtools[2.5.0], changelog_merge[2.6.0],
colo[0.4.0], email[unknown], explorer[1.3.0], fastimport[0.14.0dev],
git[0.6.11], grep[2.6.0], keychain[0.1.0], launchpad[2.6.0], loom[2.2.0],
netrc_credential_store[2.6.0], news_merge[2.6.0], pipeline[1.4.0],
po_merge[2.6.0], qbzr[0.23.1], rewrite[0.6.3], svn[1.2.2], upload[1.1.0],
weave_fmt[2.6.0], xmloutput[0.8.8]
encoding: 'utf-8', fsenc: 'utf-8', lang: 'en_US'
*** Bazaar has encountered an internal error. This probably indicates a
bug in Bazaar. You can help us fix it by filing a bug report at
https://bugs.launchpad.net/bzr/+filebug
including this traceback and a description of the problem.
Any ideas? Another way?

Homebrew provides Emacs 24.4 as well, with
$ brew install emacs --with-cocoa --with-gnutls

I'm using GNU Emacs 24.4.1 (x86_64-apple-darwin13.4.0, NS apple-appkit-1265.21) on OS X 10.9.5 currently, this version is the one from Emacs for Mac OS X and used with It's All Text! for Firefox to write this answer. ;)
Obviously most people generally opt for homebrew (as the top answer indicates), but since homebrew has a tendency to screw with /usr/local to such an extent that it won't cope with alternative (e.g. custom compiled or original) installations of Python, I can't/won't run it (so I compile from source or use MacPorts). For those in a similar position to me regarding homebrew (and I know it's not everyone), then give the Emacs for Mac OS X version a shot, failing that try MacPorts and if it's still not ideal this question has many good responses, depending on your circumstances, particularly this answer.

I've struggled with various emacs installs on OSX, so eventually I switched to MacPorts. It has emacs 24.3 available.

The current "bzr" release doesn't work out of the box on Mavericks. You can either install another prebuilt variant (from MacPorts, homebrew, or fink), or try to manually upgrade the library subvertpy.
I use MacPorts when I use bzr and when I run autogen.sh. However, it must be disabled when you run ./configure --with-ns and make install. (I use two separate terminal windows with different PATH environment variables for this.)

Related

Error on installing fortran-language-server (MacOS)

I am new to MacOS and I am having issues running Fortran code in VSCode. I followed all steps from this: (https://www.youtube.com/watch?v=oukqHpJkdok&list=PL92_6M30qOELuwqSpd5-LkxyVD-Lluxoe&index=4), including the installation of homebrewer and gfortran. However, when I run on my terminal "sudo pip3 install fortran-language-server", which should enable the command "fortls", it runs but the command doesn't work and gives an error message.
The error message is:
Unexpected error: Line endings must be \r\n
Traceback (most recent call last):
File "/Users/pedro/opt/anaconda3/lib/python3.8/site-packages/fortls/langserver.py", line 115, in run
request = self.conn.read_message()
File "/Users/pedro/opt/anaconda3/lib/python3.8/site-packages/fortls/jsonrpc.py", line 110, in read_message
return self._receive()
File "/Users/pedro/opt/anaconda3/lib/python3.8/site-packages/fortls/jsonrpc.py", line 95, in _receive
length = self._read_header_content_length(line)
File "/Users/pedro/opt/anaconda3/lib/python3.8/site-packages/fortls/jsonrpc.py", line 81, in _read_header_content_length
raise JSONRPC2ProtocolError("Line endings must be \\r\\n")
fortls.jsonrpc.JSONRPC2ProtocolError: Line endings must be \r\n
Back in the VSCode, when I try to run a simple code in fortran it gives me a message saying: "gfortran can't found on path, update your settings with a proper path or disable the linter."
Could this error be cause by lack of support to the new processer (ARM)?
Also, is there other ways to setup fortran for VSCode?
Problem solved.
There were two issues. First I had not installed Xcode properly. Secondly, pip3 was installing in the anaconda directory.
After reinstalling Xcode I used this line I solved the problem:
/opt/homebrew/bin/pip3 install fortran-language-server

PyInstaller win32ctypes.pywin32.pywintypes.error: (2, 'LoadLibraryExW', 'The system cannot find the file specified.')

While using PyInstaller (dev version 4.0.dev0+8196c57ab), produced an OSError: [WinError 2] 'The system cannot find the file specified.'
Python version: 3.7
GUI: PySide2 5.13.0
Other packages: lxml, BeautifulSoup, Matplotlib (with dependencies like numpy), Pandas, pypiwin32, reportlab, Theano
Anaconda 3, Windows
Compiled with PyInstaller --onedir
What I've tried:
Tried downgrading PyInstaller to 2.1 as suggested here: https://github.com/pyinstaller/pyinstaller/issues/3916 but doesn't work as Python 3 is not supported
Was originally on PyInstaller 3.5, upgraded to dev version as suggested under some of the issues on PyInstaller github
Tried including --exclude-module=.git
import PyInstaller.__main__
if __name__ == '__main__':
PyInstaller.__main__.run([
'--name=%s' % 'Dummy App',
'--onedir',
'--nowindowed',
r'--workpath=C:\Users\User1\Desktop\build7',
r'--distpath=C:\Users\User1\Desktop\dist7',
'--hidden-import=theano.tensor.shared_randomstreams',
'--hidden-import=pandas._libs.tslibs.timedeltas',
'--clean',
'--add-data={0};.'.format('redacted.xml'),
'--add-data={0};{0}'.format('redacted_folder'),
'--add-data={0};.'.format('redacted.pdf'),
'--exclude-module={0}'.format('.git'),
'--log-level=WARN',
'MainWindow.py'
])
Full stacktrace:
79702 DEBUG: Analyzing .git\objects\78\e83411cea88cd038acb12c005a984fc0d6d423
Traceback (most recent call last):
File "C:\Users\User1\Anaconda3\envs\ids_gui\lib\site-packages\win32ctypes\pywin32\pywintypes.py", line 35, in pywin32error
yield
File "C:\Users\User1\Anaconda3\envs\ids_gui\lib\site-packages\win32ctypes\pywin32\win32api.py", line 43, in LoadLibraryEx
return _dll._LoadLibraryEx(fileName, 0, flags)
File "C:\Users\User1\Anaconda3\envs\ids_gui\lib\site-packages\win32ctypes\core\ctypes\_util.py", line 42, in check_null
raise make_error(function, function_name)
OSError: [WinError 2] The system cannot find the file specified.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/User1/Dropbox/GitHub_Repos/DiabetesReportGenerator_v2/pyinstaller_freeze.py", line 37, in <module>
'MainWindow.py'
File "C:\Users\User1\Anaconda3\envs\ids_gui\lib\site-packages\PyInstaller\__main__.py", line 112, in run
run_build(pyi_config, spec_file, **vars(args))
File "C:\Users\User1\Anaconda3\envs\ids_gui\lib\site-packages\PyInstaller\__main__.py", line 63, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "C:\Users\User1\Anaconda3\envs\ids_gui\lib\site-packages\PyInstaller\building\build_main.py", line 732, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "C:\Users\User1\Anaconda3\envs\ids_gui\lib\site-packages\PyInstaller\building\build_main.py", line 679, in build
exec(code, spec_namespace)
File "C:\Users\User1\Dropbox\GitHub_Repos\DiabetesReportGenerator_v2\Risk Calculator.spec", line 17, in <module>
noarchive=False)
File "C:\Users\User1\Anaconda3\envs\ids_gui\lib\site-packages\PyInstaller\building\build_main.py", line 242, in __init__
self.__postinit__()
File "C:\Users\User1\Anaconda3\envs\ids_gui\lib\site-packages\PyInstaller\building\datastruct.py", line 158, in __postinit__
self.assemble()
File "C:\Users\User1\Anaconda3\envs\ids_gui\lib\site-packages\PyInstaller\building\build_main.py", line 468, in assemble
redirects=self.binding_redirects))
File "C:\Users\User1\Anaconda3\envs\ids_gui\lib\site-packages\PyInstaller\depend\bindepend.py", line 226, in Dependencies
for ftocnm, fn in getAssemblyFiles(pth, manifest, redirects):
File "C:\Users\User1\Anaconda3\envs\ids_gui\lib\site-packages\PyInstaller\depend\bindepend.py", line 402, in getAssemblyFiles
for assembly in getAssemblies(pth):
File "C:\Users\User1\Anaconda3\envs\ids_gui\lib\site-packages\PyInstaller\depend\bindepend.py", line 353, in getAssemblies
res = GetManifestResources(pth)
File "C:\Users\User1\Anaconda3\envs\ids_gui\lib\site-packages\PyInstaller\utils\win32\winmanifest.py", line 1005, in GetManifestResources
return winresource.GetResources(filename, [RT_MANIFEST], names, languages)
File "C:\Users\User1\Anaconda3\envs\ids_gui\lib\site-packages\PyInstaller\utils\win32\winresource.py", line 168, in GetResources
hsrc = win32api.LoadLibraryEx(filename, 0, LOAD_LIBRARY_AS_DATAFILE)
File "C:\Users\User1\Anaconda3\envs\ids_gui\lib\site-packages\win32ctypes\pywin32\win32api.py", line 43, in LoadLibraryEx
return _dll._LoadLibraryEx(fileName, 0, flags)
File "C:\Users\User1\Anaconda3\envs\ids_gui\lib\contextlib.py", line 130, in __exit__
self.gen.throw(type, value, traceback)
File "C:\Users\User1\Anaconda3\envs\ids_gui\lib\site-packages\win32ctypes\pywin32\pywintypes.py", line 37, in pywin32error
raise error(exception.winerror, exception.function, exception.strerror)
win32ctypes.pywin32.pywintypes.error: (2, 'LoadLibraryExW', 'The system cannot find the file specified.')
P.S. Compilation and the exe functioned perfectly with virtualenv environment created from Anaconda environment earlier (without need for --exclude-module=.git), but was too bloated with packages because the virtualenv environment is still considered to be part of the conda environment. So I used a new conda environment, and this error appeared
I've gotten it to work by creating another virtualenv environment in this new conda environment, but that is a very roundabout way. Is there any workaround?
For me, PyInstaller seems to search through .git folder and redacted_folder unnecessarily
I solved this problem by:
MOVING the folder(s) out of the directory before freezing
Additionally, if the folder is required for the frozen app to run (e.g. as a data folder), I would also either:
Comment / remove the corresponding part for --add-data and manually copy the folder over, or
Change the path for --add-data e.g. if you moved redacted_folder to your Desktop, you can change to '--add-data=C:/Users/User1/Desktop/redacted_folder'
You'll still need .git and redacted_folder back in the original directory to use Git and run your code without freezing
For example, I had trouble with .git and redacted_folder. The frozen executable needed redacted_folder to run parts of the code.
What I did was:
Move .git and redacted_folder to a separate directory
Then, I commented out the line to add data for redacted_folder:
import PyInstaller.__main__
if __name__ == '__main__':
PyInstaller.__main__.run([
'--name=%s' % 'Dummy App',
'--onedir',
'--nowindowed',
r'--workpath=C:\Users\User1\Desktop\build7',
r'--distpath=C:\Users\User1\Desktop\dist7',
'--hidden-import=theano.tensor.shared_randomstreams',
'--hidden-import=pandas._libs.tslibs.timedeltas',
'--clean',
'--add-data={0};.'.format('redacted.xml'),
# Remove `redacted_folder` and comment out the following line
# '--add-data={0};{0}'.format('redacted_folder'),
'--add-data={0};.'.format('redacted.pdf'),
'--exclude-module={0}'.format('.git'),
'--log-level=WARN',
'MainWindow.py'
])
After freezing, I copied redacted_folder over to the appropriate location relative to the frozen executable in distpath
This was fixed. Update PyInstaller.
I installed pyinstaller in a new conda environment using pip, however pywin32 did not get installed by default (eventhough documentation mentioned it would). Installing it fixed the error for me.
I had this same issue and found another thread where somebody uninstalled Python and then reinstalled Python to fix it.
The key information to understand the problem though, was that they had originally installed Python using Microsoft Store. When they reinstalled Python, they just downloaded Python from python.org and this took care of the problem. It worked for me too.
It seems very likely that something in the Microsoft Store version is causing problems like this.
Start from administrator cmd or ide and try again, it's helped me.
Running from Jupyter Notebook with elevated privilegies worked for me!

Manually specify library when pyinstaller sees conflicting versions

Is it possible to manually replace or specify the location of a .dylib on Mac OSX when using pyinstaller?
I'm getting the error when trying to open my completed .app
Traceback (most recent call last):
File "DeepMeerkat/main.py", line 3, in <module>
import cv2
File "/Library/Python/2.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 546, in load_module
module = imp.load_module(fullname, fp, filename, ext_tuple)
ImportError: dlopen(/Users/ben/Documents/DeepMeerkat/Installer/dist/Lib/cv2.so, 2): Library not loaded: #loader_path/libpng16.16.dylib
Referenced from: /Users/ben/Documents/DeepMeerkat/Installer/dist/Lib/libopencv_imgcodecs.3.3.dylib
Reason: Incompatible library version: libopencv_imgcodecs.3.3.dylib requires version 48.0.0 or later, but libpng16.16.dylib provides version 45.0.0
Failed to execute script main
I have no problem loading cv2 in python outside of the app, or any other problems with open, which was installed with homebrew.
Poking around, I think it is extremely likely the error comes from pyinstaller grabbing libpng from X11 (/opt/X11/include/libpng16) when it needs to be grabbing from Homebrew's folders (/usr/local/Cellar/libpng/1.6.32/)
How can I use a hook to specify which libpng I want?
I had the same problem, the answer lay in editing the .spec file. Add the following line after a = Analysis...:
a.binaries = a.binaries - TOC([('libpng16.16.dylib',None,None)])
This has the effect of removing the offending dylib from the relevant TOC file which solves the conflict.

Pyinotify error when building linux with yocto on mac osx

I'm trying to build a linux with yocto (morty) on my Mac OSX (El Capitan). The source step with source poky/oe-init-build-env buildsucceeded without errors, but when I execute bitbake core-image-baseI get the following error trace:
Traceback (most recent call last):
File "/Users/peterblicharski/Entwicklung/dnsPro/yocto/yoctowa/poky/bitbake/bin/bitbake", line 48, in <module>
cookerdata.CookerConfiguration()))
File "/Users/peterblicharski/Entwicklung/dnsPro/yocto/yoctowa/poky/bitbake/lib/bb/main.py", line 468, in bitbake_main
server = start_server(servermodule, configParams, configuration, featureset)
File "/Users/peterblicharski/Entwicklung/dnsPro/yocto/yoctowa/poky/bitbake/lib/bb/main.py", line 354, in start_server
cooker = bb.cooker.BBCooker(configuration, features)
File "/Users/peterblicharski/Entwicklung/dnsPro/yocto/yoctowa/poky/bitbake/lib/bb/cooker.py", line 178, in __init__
self.configwatcher = pyinotify.WatchManager()
File "/Users/peterblicharski/Entwicklung/dnsPro/yocto/yoctowa/poky/bitbake/lib/pyinotify.py", line 1759, in __init__
raise InotifyBindingNotFoundError()
pyinotify.InotifyBindingNotFoundError: Couldn't find any inotify binding
DEBUG: Removed the following variables from the environment: __CF_USER_TEXT_ENCODING, XPC_SERVICE_NAME, SECURITYSESSIONID, PS1, TERM_PROGRAM_VERSION, TMPDIR, _, TERM_PROGRAM, DISPLAY, LANG, SHLVL, GIT_PS1_SHOWDIRTYSTATE, Apple_PubSub_Socket_Render, __PYVENV_LAUNCHER__, OLDPWD, XPC_FLAGS, TERM_SESSION_ID, BUILDDIR
Mac is not a supported build host and currently does not work at all. Quoting Ross Burton from mailing list:
If you install all of the GNU tools using brew or similar and put them first
on $PATH then you can get bitbake started. Then you need to stub out the
linux-specific bits in bitbake. I've previously started on this work
already
(http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=ross/darwin).
The next step is figuring out how to configure OE to build and link natively
on OSX using LLVM instead of GCC.
However all of this is mostly academic because in Sierra (iirc) onwards
there is tighter security on processes, which means that pseudo won't work
even if you port it to macOS.
Your error would be part of "linux-specific bits in bitbake" and seems to be worked around in ross' branch. But as you can see it's not the last issue you'll face.
Based on the discussion there are probably ways to get pseudo running but after that you would get to fix all the native builds Yocto does: it's likely that many projects we use are not frequently built on Mac and will fail there.

Configparser error leads to crash of Spyder 3 under Python(x,y)

During its startup, Spyder3 IDE crashes under Python(x,y). I have installed a Python(x,y) distribution (2.7.10.0) of Python2.7 under Windows 7 and after updating the package spyder to the most recent version (with pip: V3.0.x), it does not restart anymore. Resetting the spyder config does not help.
It is reproducible as I checked it on 3 computers and also with the Enthought distribution, it has the same problem. Only under Anaconda, it keeps working properly.
The error message is stored in the contents of file spyder_crash.log:
Traceback (most recent call last):
File "c:\python27\lib\site-packages\spyder\app\mainwindow.py", line 3001, in main
mainwindow = run_spyder(app, options, args)
File "c:\python27\lib\site-packages\spyder\app\mainwindow.py", line 2905, in run_spyder
main.setup()
File "c:\python27\lib\site-packages\spyder\app\mainwindow.py", line 1010, in setup
from xy.config import DOC_PATH as xy_doc_path
File "c:\python27\lib\site-packages\xy\config.py", line 40, in <module>
CONF = UserConfig('xy', defaults=DEFAULTS, version=__version__, subfolder='.xy')
File "c:\python27\lib\site-packages\xy\userconfig.py", line 110, in __init__
if version != self.get_version(version):
File "c:\python27\lib\site-packages\xy\userconfig.py", line 130, in get_version
return self.get(self.DEFAULT_SECTION_NAME, 'version', version)
File "c:\python27\lib\site-packages\xy\userconfig.py", line 269, in get
value = cp.ConfigParser.get(self, section, option, raw=self.raw)
File "c:\python27\lib\site-packages\backports\configparser\__init__.py", line 811, in get
d)
File "c:\python27\lib\site-packages\backports\configparser\__init__.py", line 384, in before_get
self._interpolate_some(parser, option, L, value, section, defaults, 1)
File "c:\python27\lib\site-packages\backports\configparser\__init__.py", line 397, in _interpolate_some
rawval = parser.get(section, option, raw=True, fallback=rest)
TypeError: get() got an unexpected keyword argument 'raw'
PS: I see that I could post an issue directly on Github but there are over 600 issues open. Maybe there is someone who knows a fix directly.
Different causes that Spyder crashes:
Spyder IDE won't start WinPython-64bit- 2.7.10.2
Broken links and probably different cause - Spyder/Pythonxy crashes
Edit:
Installation details:
C:\Users\strpeter>pip install spyder
Successfully installed configparser-3.5.0 jupyter-core-4.2.1 nbformat-4.2.0
setuptools-30.0.0 spyder-3.0.2
When uninstalling configparser, as recommended in the comment below, pythonw.exe stops working during the initialization of spyder3. I have no details at hand to report about the crash.
C:\Users\strpeter>pip uninstall configparser
Uninstalling configparser-3.5.0:
c:\python27\lib\site-packages\backports\configparser\__init__.py
c:\python27\lib\site-packages\backports\configparser\__init__.pyc
c:\python27\lib\site-packages\backports\configparser\helpers.py
c:\python27\lib\site-packages\backports\configparser\helpers.pyc
c:\python27\lib\site-packages\configparser-3.5.0-py2.7-nspkg.pth
c:\python27\lib\site-packages\configparser-3.5.0-py2.7.egg-info
c:\python27\lib\site-packages\configparser.py
c:\python27\lib\site-packages\configparser.pyc
Proceed (y/n)? y
Successfully uninstalled configparser-3.5.0
(Spyder developer here) This is an error between PythonXY and Spyder. I opened an issue about it, which we're going to solve in Spyder 3.1.0 (to be released in mid January/2017).
This might be due to incompatibilities due to different Qt wrappers. To test this in Enthought Python, please open a Canopy Command Prompt (or otherwise ensure that Enthought Python is your default python). Then ensure that PyQt is installed and make it the default Qt wrapper:
enpkg pyqt
set QT_API=pyqt
Now does Spyder 3 run ok?

Resources