Issues installing Drake on Ubuntu 18.04 - drake

Followed through installation tips, but after typing
$ python underactuated/src/double_pendulum/simulate.py
I get
ImportError: dynamic module does not define init function (init_module_py).
If I run python3 I get
ImportError: cannot import name 'FindResource'.
After typing $ python3 -c 'import pydrake; print(pydrake.__file__)' I get /opt/drake/lib/python3.6/site-packages/pydrake/__init__.py
Edit:
Full output of running python3
Traceback (most recent call last):
File "underactuated/src/double_pendulum/simulate.py", line 5, in <module>
from underactuated import FindResource, PlanarSceneGraphVisualizer
ImportError: cannot import name 'FindResource'
And full output of running python (without3):
Traceback (most recent call last):
File "underactuated/src/double_pendulum/simulate.py", line 1, in <module>
from pydrake.all import (AddMultibodyPlantSceneGraph,
File "/opt/drake/lib/python3.6/site-packages/pydrake/__init__.py", line 32, in <module>
from . import common
File "/opt/drake/lib/python3.6/site-packages/pydrake/common/__init__.py", line 3, in <module>
from ._module_py import *
ImportError: dynamic module does not define init function (init_module_py)
Version of python after typing python -V is Python 2.7.15+

The fact that the print test succeeds suggests that drake is installed correctly.
Please post the full output of running simulate.py with python3.

Related

ModuleNotFoundError: No module named 'frida'

[Hi. there,
Traceback (most r](https://www.stackoverflow.com/)ecent call last):
File "/Users/xxxx/Desktop/Pentest/frida-ios-dump-master/dump.py", line 11, in <module>
import frida
ModuleNotFoundError: No module named 'frida'
Iam trying the above command not no module name frida
I have already done
pip3 install frida
Program will run as expected

Drake installation issue on ubuntu 20.04

I'm following Drake's installation instructions from here for ubuntu.
I get stuck at this line:
python3 -c 'import pydrake; print(pydrake.__file__)'
with the following error:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/opt/drake/lib/python3.6/site-packages/pydrake/__init__.py", line 41, in <module>
from . import common
File "/opt/drake/lib/python3.6/site-packages/pydrake/common/__init__.py", line 7, in <module>
from ._module_py import *
ModuleNotFoundError: No module named 'pydrake.common._module_py'
What is the ._module_py file? I don't see it in:
/opt/drake/lib/python3.6/site-packages/pydrake/common
The python version I've got installed is 3.8.5, but I don't think that's causing any problems.
The instructions you linked to say curl -o drake.tar.gz https://drake-packages.csail.mit.edu/drake/nightly/drake-latest-bionic.tar.gz. The "bionic" there is Ubuntu's codename for 18.04. If you are using Ubuntu 20.04, then the codename is "focal", so you should use start from curl -o drake.tar.gz https://drake-packages.csail.mit.edu/drake/nightly/drake-latest-focal.tar.gz so that you have Python 3.8 support.
Here are Drake's own installation instructions for pydrake, which are usually the most up-to-date reference: https://drake.mit.edu/python_bindings.html#installation

How to fix numpy fail with missing libcblas.so.3 on alpine docker

I had installed numpy on alpine docker and everything looked good before running numpy:
Traceback (most recent call last):
File "/app/venv/lib/python3.7/site-packages/numpy/core/__init__.py", line 24, in <module>
from . import multiarray
File "/app/venv/lib/python3.7/site-packages/numpy/core/multiarray.py", line 14, in <module>
from . import overrides
File "/app/venv/lib/python3.7/site-packages/numpy/core/overrides.py", line 7, in <module>
from numpy.core._multiarray_umath import (
ImportError: Error loading shared library libcblas.so.3: No such file or directory (needed by /app/venv/lib/python3.7/site-packages/numpy/core/_multiarray_umath.cpython-37m-x86_64-linux-gnu.so)
I found that licblas.so might be in /usr/lib/ as mentioned here: alpine blas
but it wasn't there.
After installing lapack, the missing file libcblas.so.3 appeared in /usr/lib/:
apk add lapack
I had openblas-dev installed from before but that was not sufficient.

Docker-compose start fail

I am trying to install and use docker-compose for the first time on my Ubuntu 14.04 machine, but I am failing :))
I have installed docker-compose via pip using
When I try to run docker-compose up I get this error trace:
Traceback (most recent call last):
File "/usr/local/bin/docker-compose", line 7, in <module>
from compose.cli.main import main
File "/usr/local/lib/python2.7/dist-packages/compose/cli/main.py", line 41, in <module>
from . import errors
File "/usr/local/lib/python2.7/dist-packages/compose/cli/errors.py", line 10, in <module>
from docker.errors import APIError
File "/usr/local/lib/python2.7/dist-packages/docker/__init__.py", line 2, in <module>
from .api import APIClient
File "/usr/local/lib/python2.7/dist-packages/docker/api/__init__.py", line 2, in <module>
from .client import APIClient
File "/usr/local/lib/python2.7/dist-packages/docker/api/client.py", line 11, in <module>
from .build import BuildApiMixin
File "/usr/local/lib/python2.7/dist-packages/docker/api/build.py", line 9, in <module>
from .. import utils
File "/usr/local/lib/python2.7/dist-packages/docker/utils/__init__.py", line 2, in <module>
from .utils import (
File "/usr/local/lib/python2.7/dist-packages/docker/utils/utils.py", line 19, in <module>
from .. import tls
File "/usr/local/lib/python2.7/dist-packages/docker/tls.py", line 5, in <module>
from .transport import SSLAdapter
File "/usr/local/lib/python2.7/dist-packages/docker/transport/__init__.py", line 3, in <module>
from .ssladapter import SSLAdapter
File "/usr/local/lib/python2.7/dist-packages/docker/transport/ssladapter.py", line 22, in <module>
urllib3.connection.match_hostname = match_hostname
AttributeError: 'module' object has no attribute 'connection'
Eggs versions:
$pip freeze | grep -e urllib3 -e requests -e docker-py
docker-pycreds==0.2.1
requests==2.13.0
urllib3==1.14
I tried to export PYTHONPATH like this:
export PYTHONPATH=/usr/local/lib/python2.7/dist-packages:/usr/lib/python2.7/dist-packages
I guess you have more than one packages with different version.
request and urllib3 can both exist in /usr/lib/python2.7/dist-packages/ and /usr/local/lib/python2.7/dist-packages
In ssladapter.py, request.packages.urllib3 is priorly imported according:
try:
import requests.packages.urllib3 as urllib3
except ImportError:
import urllib3
If your requests.packages.urllib3 is too old, error will be raised.
So you have two ways to fix this problem
copy the newest urllib3 into requests/packages
remove the urllib3 in requests/packages so that docker-compose will use the urllib3 from pythonpath (your latest urllib3)
(You can get the path of requests by the interactive console:
>>> import requests
>>> requests
<module 'requests' from '/usr/lib/python2.7/dist-packages/requests/__init__.pyc'>
)

clang-ctags error: ImportError: No module named clang.cindex

clang-ctags is producing the following error
$ clang-ctags trace make
Traceback (most recent call last):
File "/usr/local/bin/clang-ctags", line 9, in <module>
import clang.cindex
ImportError: No module named clang.cindex
Or
$ clang-ctags
Traceback (most recent call last):
File "/usr/local/bin/clang-ctags", line 9, in <module>
import clang.cindex
ImportError: No module named clang.cindex
I cannot find anything on the internet and I don't know python either. Can anyone solve this please?
If you are on Ubuntu you can install the Python bindings to Clang with the package
python-clang-3.4 or python-clang-3.5
To install it just run:
sudo apt-get install python-clang-3.4

Resources