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'>
)
Related
My CKAN Docker install seems perfect except that the ckan container exits immediately after a restart.strong textI have repeatedly tried a rebuild of the docker containers. I see no errors except a reference to the deprecation of python2. Please advise on any issues that I may have overlooked or something missing. This installation is on Ubuntu 19.10.
docker log is as follows:
Command 'db' not known (you may need to run setup.py egg_info)
Known commands:
create Create the file layout for a Python distribution
Traceback (most recent call last):
File "/usr/local/bin/ckan-paster", line 8, in <module>
sys.exit(run())
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/paste/script/command.py", line 102, in run
invoke(command, command_name, options, args[1:])
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/paste/script/command.py", line 141, in invoke
exit_code = runner.run(args)
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/paste/script/command.py", line 806, in run
command.load().summary))
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2321, in load
return self.resolve()
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2327, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/lib/ckan/venv/src/ckan/ckanext/datapusher/cli.py", line 7, in <module>
import ckan.lib.cli as cli
File "/usr/lib/ckan/venv/src/ckan/ckan/lib/cli.py", line 17, in <module>
from ckan.cli import load_config as _get_config
File "/usr/lib/ckan/venv/src/ckan/ckan/cli/__init__.py", line 8, in <module>
from configparser import ConfigParser
ImportError: No module named configparser
Command 'db' not known (you may need to run setup.py egg_info)
Known commands:
create Create the file layout for a Python distribution
Traceback (most recent call last):
File "/usr/local/bin/ckan-paster", line 8, in <module>
sys.exit(run())
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/paste/script/command.py", line 102, in run
invoke(command, command_name, options, args[1:])
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/paste/script/command.py", line 141, in invoke
exit_code = runner.run(args)
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/paste/script/command.py", line 806, in run
command.load().summary))
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2321, in load
return self.resolve()
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2327, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/lib/ckan/venv/src/ckan/ckanext/datapusher/cli.py", line 7, in <module>
import ckan.lib.cli as cli
File "/usr/lib/ckan/venv/src/ckan/ckan/lib/cli.py", line 17, in <module>
from ckan.cli import load_config as _get_config
File "/usr/lib/ckan/venv/src/ckan/ckan/cli/__init__.py", line 8, in <module>
from configparser import ConfigParser
ImportError: No module named configparser
Traceback (most recent call last):
File "/usr/local/bin/ckan-paster", line 8, in <module>
Command 'db' not known (you may need to run setup.py egg_info)
Known commands:
create Create the file layout for a Python distribution
sys.exit(run())
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/paste/script/command.py", line 102, in run
invoke(command, command_name, options, args[1:])
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/paste/script/command.py", line 141, in invoke
exit_code = runner.run(args)
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/paste/script/command.py", line 806, in run
command.load().summary))
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2321, in load
return self.resolve()
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2327, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/lib/ckan/venv/src/ckan/ckanext/datapusher/cli.py", line 7, in <module>
import ckan.lib.cli as cli
File "/usr/lib/ckan/venv/src/ckan/ckan/lib/cli.py", line 17, in <module>
from ckan.cli import load_config as _get_config
File "/usr/lib/ckan/venv/src/ckan/ckan/cli/__init__.py", line 8, in <module>
from configparser import ConfigParser
ImportError: No module named configparser
You are using python 2.7 but importing configparser, which is Python 3 module. Check which version you are pooling from the Docker, I think you need 2.8.x tag as the latest stable.
1) I built the visualizer but couldn’t launch it. Here is what I see:
(base) Taos-MacBook-Pro:drake taosun$ bazel build //tools:drake_visualizer //manipulation/util:geometry_inspector
INFO: Analyzed 2 targets (0 packages loaded, 0 targets configured).
INFO: Found 2 targets...
INFO: Elapsed time: 0.988s, Critical Path: 0.01s
INFO: 0 processes.
INFO: Build completed successfully, 1 total action
But when I tried to launch it, it didn't work:
(base) Taos-MacBook-Pro:drake taosun$ ./bazel-bin/tools/drake_visualizer
Traceback (most recent call last):
File "/usr/local/opt/vtk#8.2/lib/python3.7/site-packages/vtkmodules/vtkIOAMR.py", line 5, in <module>
from .vtkIOAMRPython import *
ImportError: dlopen(/usr/local/opt/vtk#8.2/lib/python3.7/site-packages/vtkmodules/vtkIOAMRPython.so, 2): Library not loaded: /usr/local/opt/hdf5/lib/libhdf5.103.dylib
Referenced from: /usr/local/opt/vtk#8.2/lib/libvtkIOAMR-8.2.1.dylib
Reason: image not found
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/tmp/_bazel_taosun/faebfa4431921ca82cfb8e7cf6a74cad/external/drake_visualizer/lib/python3.7/site-packages/director/drakevisualizerapp.py", line 3, in <module>
from director import mainwindowapp
File "/private/var/tmp/_bazel_taosun/faebfa4431921ca82cfb8e7cf6a74cad/external/drake_visualizer/lib/python3.7/site-packages/director/mainwindowapp.py", line 2, in <module>
from director.componentgraph import ComponentFactory
File "/private/var/tmp/_bazel_taosun/faebfa4431921ca82cfb8e7cf6a74cad/external/drake_visualizer/lib/python3.7/site-packages/director/componentgraph.py", line 2, in <module>
from director.fieldcontainer import FieldContainer
File "/private/var/tmp/_bazel_taosun/faebfa4431921ca82cfb8e7cf6a74cad/external/drake_visualizer/lib/python3.7/site-packages/director/fieldcontainer.py", line 1, in <module>
import vtk
File "/usr/local/opt/vtk#8.2/lib/python3.7/site-packages/vtk.py", line 32, in <module>
all_spec.loader.exec_module(all_m)
File "/usr/local/opt/vtk#8.2/lib/python3.7/site-packages/vtkmodules/all.py", line 67, in <module>
from .vtkIOAMR import *
File "/usr/local/opt/vtk#8.2/lib/python3.7/site-packages/vtkmodules/vtkIOAMR.py", line 9, in <module>
from vtkIOAMRPython import *
ModuleNotFoundError: No module named 'vtkIOAMRPython'
2) I also tried python-binding. The cmake and make completed successfully. However, when I tried to import pydrake, I got the below error:
(base) Taos-MacBook-Pro:GitHub taosun$ cd drake-build
(base) Taos-MacBook-Pro:drake-build taosun$ python3 -c 'import pydrake; print(pydrake.__file__)'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/opt/drake/lib/python3.7/site-packages/pydrake/__init__.py", line 41, in <module>
from . import common
File "/opt/drake/lib/python3.7/site-packages/pydrake/common/__init__.py", line 1, in <module>
from ._module_py import *
ImportError: dlopen(/opt/drake/lib/python3.7/site-packages/pydrake/common/_module_py.so, 2): Symbol not found: _PyThread_tss_alloc
Referenced from: /opt/drake/lib/python3.7/site-packages/pydrake/common/_module_py.so
Expected in: flat namespace
in /opt/drake/lib/python3.7/site-packages/pydrake/common/_module_py.so
For both of the above two issues, I doubt whether it is because I don’t set $PYTHONPATH correctly. This is what I set at the moment
(base) Taos-MacBook-Pro:drake-build taosun$ echo $PYTHONPATH
/opt/drake/lib/python3.7/site-packages
Thank you for the help!
For the VTK error, try adding --define="-DUSE_SYSTEM_VTK=OFF" at the end of your build command.
bazel build //tools:drake_visualizer //manipulation/util:geometry_inspector --define="-DUSE_SYSTEM_VTK=OFF"`
I've error on executing below command:
"googlesamples-assistant-pushtotalk --project-id my-dev-project --device-model-id my-model"
That gives me error as:
File "/home/pi/env/bin/googlesamples-assistant-pushtotalk", line 6, in <module>
from googlesamples.assistant.grpc.pushtotalk import main
File "/home/pi/env/lib/python3.7/site-packages/googlesamples/assistant/grpc/pushtotalk.py", line 28, in <module>
import grpc
File "/home/pi/env/lib/python3.7/site-packages/grpc/__init__.py", line 23, in <module>
from grpc._cython import cygrpc as _cygrpc
ImportError: /home/pi/env/lib/python3.7/site-packages/grpc/_cython/cygrpc.cpython-37m-arm-linux-gnueabihf.so: undefined symbol: __atomic_exchange_8
Run this code in env:
pip3 install 'grpcio==1.23.0' --force-reinstall
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.
I am testing py2app on a simple test.py application, doing nothing special.
python == 3.6
py2app == 0.14
It builds fine with no errors when I give this command:
python3.6 setup.py py2app -A
but when I launch it, this is the result:
./dist/test.app/Contents/MacOS/test
Traceback (most recent call last):
File "/Users/fabio/projvenv/dist/test.app/Contents/Resources/__boot__.py", line 132, in <module>
_run()
File "/Users/fabio/projvenv/dist/test.app/Contents/Resources/__boot__.py", line 126, in _run
exec(compile(source, script, 'exec'), globals(), globals())
File "/Users/fabio/projvenv/test.py", line 3, in <module>
import tkinter
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/tkinter/__init__.py", line 36, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
ValueError: character U+6573552f is not in range [U+0000; U+10ffff]
2017-06-24 11:32:26.266 test[65341:8804502] test Error
downgrading to 0.12 fixed the issue for me. More of a workaround that a fix though but good enough for me at this point