Install ROS2 on OS X - Error: No module named 'rclpy._rclpy' - macos

I am trying to install ros2 env in Mac. I created a conda env for it.
I have installed conda install -c anaconda sphinx and conda install -c conda-forge sphinx-autodoc-typehints.
I got the errors when I ran ros2 run demo_nodes_cpp talker:
Failed to load entry point 'test': No module named 'rclpy._rclpy'
Failed to load entry point 'launch': No module named 'rclpy._rclpy'
Failed to load entry point 'info': No module named 'rclpy._rclpy'
.
.
.
Failed to load entry point 'list': No module named 'rclpy._rclpy'
Failed to load entry point 'pub': No module named 'rclpy._rclpy'
dyld: Library not loaded: /usr/local/opt/poco/lib/libPocoFoundation.63.dylib
Referenced from: /Users/linfeng/workspace/ros2_dashing/ros2-osx/lib/librosidl_typesupport_c.dylib
Reason: image not found
Any idea? Thank you in advance

I got it working by linking the newer installed poco version:
ln -s /usr/local/opt/poco/lib/libPocoFoundation.71.dylib /usr/local/opt/poco/lib/libPocoFoundation.63.dylib

Related

ModuleNotFoundError: No module named 'apt_pkg && ln: failed to create symbolic link 'apt_pkg.so': File exists on ubuntu20.04

I already have python version 3.7.4 and i am trying to install new python version along with the existing but unable to do so as the following error occur:
ModuleNotFoundError: No module named 'apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
i tried to reinstall apt_pkg to solve this and even remove it and install it again but nothing works
during the re-installation process the following error occur:
ln: failed to create symbolic link 'apt_pkg.so': File exists on ubuntu20.04
on listing i found:
ll apt_pkg.*
i can see multiple versions of apt_pkg. how to correctly link this and solve the problem?

Error running Fortran on Mac

I am running macOS 10.13.5 and I have installed Fortran using Homebrew. I can compile and build a program like this:
program HelloWorld
write(*,*)'Hello World'
end program
But when I try to run it I get the same error:
dyld: Library not loaded: #rpath/libgfortran.3.dylib
Referenced from: /Users/sergiobacelar/Documents/books2calibre/books_software/feher_fortran/prog01/prog01_01/Build/prog
Reason: image not found
/var/folders/tq/f5jbfqp97y52w_y7byn05_fw0000gn/T/geany_run_script_2Q4DKZ.sh: line 7: 47712 Abort trap: 6 "Build/prog"
I have libgfortran.3.dylib inside anaconda3/lib and I have gcc 8.1.0 in homebrew but when I do gfortran -v I get gcc 4.8.5 from Anaconda.
I use anaconda/miniconda quite a bit on Linux and mac environments. Modules (https://en.wikipedia.org/wiki/Environment_Modules_(software)) are a great way to keep it from polluting your environment. As an example, at the end of my .bashrc file, I have:
module use --append "$HOME/.modules"
This directory contains a module file for conda:
$ cat .modules/conda
#%Module1.0
module-whatis "add ~/miniconda3 to path"
prepend-path PATH /Users/ptb/miniconda3/bin
A $ module load conda will then adjust the PATH, making all miniconda related things visible.
Edit:
I wrote the first part of this answer on my linux machine where modules are installed by default and forgot that 2 things are needed to make it work on a mac.
On a mac, modules can be installed via homebrew with brew install modules. One then needs to put the following before module use ...:
. /usr/local/Modules/default/init/bash

DYLD error when starting up mongodb

I installed mongo with:
brew install mongodb
I created the data directory:
/data/dir
i included mongod the path (which mongod --> /opt/local/bin/mongod):
export PATH=$PATH:/opt/local/bin/mongod
I tried to run mongod:
mongod
And got this response:
dyld: lazy symbol binding failed: Symbol not found: __ZN7pcrecpp2RE4InitERKSsPKNS_10RE_OptionsE
Referenced from: /opt/local/bin/mongod
Expected in: /opt/local/lib/libpcrecpp.0.dylib
dyld: Symbol not found: __ZN7pcrecpp2RE4InitERKSsPKNS_10RE_OptionsE
Referenced from: /opt/local/bin/mongod
Expected in: /opt/local/lib/libpcrecpp.0.dylib
What is this error all about? How do I proceed?
the problem was that I had set the path to the wrong directory
Brew installs packages into /usr/local/bin which is where there resides a symlink mongod# -> homebrew's cellar
so, instead, I ran /usr/local/bin/mongod and then it started fine.

brew doctor throwing loads of errors?

I recently installed Laravel on my Mac to begin learning about it as I've heard good things.
My first error was while accessing /public/:
Laravel requires the Mcrypt PHP extension.
I then installed php54-mcrypt and continued learning yesterday evening.
I then came home today from work, hit 'brew update' and then the same error appeared?
I then ran brew install php54-mcrypt to receive:
Warning: php54-mcrypt-5.4.16 already installed
I then ran brew doctor to receive;
Warning: "config" scripts exist outside your system or Homebrew directories
./configure scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.
Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
/opt/sm/pkg/active/bin/curl-config
/opt/sm/pkg/active/bin/ncurses5-config
/opt/sm/pkg/active/bin/ncursesw5-config
/opt/sm/pkg/active/bin/pkg-config
/opt/sm/pkg/active/bin/xml2-config
/opt/sm/pkg/active/bin/xslt-config
PHP Warning: PHP Startup: Unable to load dynamic library
'/usr/local/Cellar/php54-mcrypt/5.4.16/mcrypt.so' -
dlopen(/usr/local/Cellar/php54-mcrypt/5.4.16/mcrypt.so, 9):
Library not loaded: /usr/local/lib/libmcrypt.4.4.8.dylib
Referenced from: /usr/local/Cellar/php54-mcrypt/5.4.16/mcrypt.so
Reason: image not found in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library
'/usr/local/Cellar/php54-mcrypt/5.4.16/mcrypt.so' -
dlopen(/usr/local/Cellar/php54-mcrypt/5.4.16/mcrypt.so, 9):
Library not loaded: /usr/local/lib/libmcrypt.4.4.8.dylib
Referenced from: /usr/local/Cellar/php54-mcrypt/5.4.16/mcrypt.so
Reason: image not found in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library
'/usr/local/Cellar/php54-mcrypt/5.4.16/mcrypt.so' -
dlopen(/usr/local/Cellar/php54-mcrypt/5.4.16/mcrypt.so, 9):
Library not loaded: /usr/local/lib/libmcrypt.4.4.8.dylib
Referenced from: /usr/local/Cellar/php54-mcrypt/5.4.16/mcrypt.so
Reason: image not found in Unknown on line 0
The stuff in /usr/local/Cellar was put there by MacPorts, an earlier package manager for mac. You probably want to remove that. https://guide.macports.org/chunked/installing.macports.uninstalling.html

OS X 10.8.2 python 3 import sqlite error

Both brew installed python3 and manually compiled python3 with -–enable-loadable-sqlite-extensions fails when import sqlite from python3 shell. Please help!
The module is named sqlite3, not sqlite:
import sqlite3
http://docs.python.org/3/library/sqlite3.html
Update: Now that we've cleared up the module name, the problem being reported:
ImportError: No module named '_sqlite3'
means that your Python instance cannot find the C extension module, _sqlite3.so, that is part of the sqlite3 module in the standard library. Since the file path of the dbapi2.py in the traceback looks reasonable, the issue is probably not a path issue (sys.path). Most likely the _sqlite3 extension module failed to build or link. Check the output from your Python build for errors. OS X 10.8 includes a version of sqlite3 but for security reasons it does not include the optional loadable extensions feature. Your Python build likely included this message:
Failed to build these modules:
_sqlite3
and, earlier, this:
*** WARNING: renaming "_sqlite3" since importing it failed: dlopen(build/lib.macosx-10.8-x86_64-3.3-pydebug/_sqlite3.so, 2): Symbol not found: _sqlite3_enable_load_extension
Referenced from: build/lib.macosx-10.8-x86_64-3.3-pydebug/_sqlite3.so
Expected in: flat namespace
in build/lib.macosx-10.8-x86_64-3.3-pydebug/_sqlite3.so
The solution is to build and install a separate copy of sqlite3 that is built with the loadable extensions feature. If you are using Homebrew, its sqlite recipe with the with-functions option should do that. Then rebuild Python.
Homebrew provides python3 with sqlite3 support and loadable modules.
brew install python3 will do the right thing (and brew sqlite, too).
There was a bug, that probably struck you, but it has been fixed

Resources