I am trying to run:-
roslaunch turtlebot_gazebo turtlebot_world.launch
but I am getting following error
Traceback (most recent call last):
File "/opt/ros/kinetic/share/xacro/xacro.py", line 55, in <module>
import xacro
File "/opt/ros/kinetic/lib/python2.7/dist-packages/xacro/__init__.py", line 42, in <module>
from roslaunch import substitution_args
File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/__init__.py", line 56, in <module>
from .launch import ROSLaunchRunner
File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/launch.py", line 55, in <module>
from roslaunch.nodeprocess import create_master_process, create_node_process
File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/nodeprocess.py", line 49, in <module>
from roslaunch.node_args import create_local_process_args
File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/node_args.py", line 53, in <module>
import roslib.packages
File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslib/__init__.py", line 54, in <module>
import roslib.stacks
File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslib/stacks.py", line 46, in <module>
import roslib.packages
File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslib/packages.py", line 49, in <module>
from catkin.find_in_workspaces import find_in_workspaces as catkin_find
File "/opt/ros/kinetic/lib/python2.7/dist-packages/catkin/find_in_workspaces.py", line 36, in <module>
from catkin_pkg.packages import find_packages
ImportError: No module named catkin_pkg.packages
while processing /opt/ros/kinetic/share/turtlebot_gazebo/launch/includes/kobuki.launch.xml:
Invalid <param> tag: Cannot load command parameter [robot_description]: command [/opt/ros/kinetic/share/xacro/xacro.py '/opt/ros/kinetic/share/turtlebot_description/robots/kobuki_hexagons_asus_xtion_pro.urdf.xacro'] returned with code [1].
This worked for me
pip install catkin_pkg
On Arch Linux: In my case, I installed from an AUR package python2-catkin_pkg which installed the library at /usr/lib/python2.7/site-packages. So just do a symlink from /opt/ros/kinetic/lib/python2.7/site-packages to /usr/lib/python2.7/site-packages/catkin_pkg. So do this when you're in /usr/lib/python2.7/site-packages directory:
ln -s /usr/lib/python2.7/site-packages/catkin_pkg catkin_pkg
Probably because your python version is too high as it was in my case. Try to use the system default python first.
Go back to /usr/bin/python3 and use that as the default.
For those who have conda installed, here is the solution:
https://github.com/colcon/colcon-ros/issues/118#issuecomment-1355078266
You need to install catkin_pkg into the environment. I'm using conda and I had to install catkin_pkg, empy, and lark:
conda install -c conda-forge catkin_pkg empy lark
Related
Error Message:
Traceback (most recent call last):
File "/home/upboard/visioonbot/Connect4Py/connect4.py", line 7, in <module>
import dbus
File "/home/upboard/visioonbot/Connect4Py/venv/lib/python3.6/site-packages/dbus/__init__.py", line 77, in <module>
import dbus.types as types
File "/home/upboard/visioonbot/Connect4Py/venv/lib/python3.6/site-packages/dbus/types.py", line 6, in <module>
from _dbus_bindings import (
File "/home/upboard/visioonbot/Connect4Py/venv/lib/python3.6/site-packages/_dbus_bindings/__init__.py", line 13, in <module>
import dbus.lowlevel as __dbus_lowlevel
File "/home/upboard/visioonbot/Connect4Py/venv/lib/python3.6/site-packages/dbus/lowlevel.py", line 32, in <module>
from _dbus_bindings import (
File "/home/upboard/visioonbot/Connect4Py/venv/lib/python3.6/site-packages/_dbus_bindings/ErrorMessage.py", line 13, in <module>
import dbus.lowlevel as __dbus_lowlevel
AttributeError: module 'dbus' has no attribute 'lowlevel'
Process finished with exit code 1
Here are the dbus files mentioned in the error path:
and the dbus_bindings files:
What is missing? How to solve this issue?
I've already reinstalled the packages using
sudo apt install python3-dbus
and
sudo apt-get install -y python-dbus
It looks like your issue might be that you are using a venv. python3-dbus does not play nicely with venv's.
You can try using --system-site-packages as suggested in https://stackoverflow.com/a/13367493/7721752.
Or use pydbus and vext.gi
I get this error when I type airflow vesrion command in terminal. i install airflow from pip in virtual environment.
Traceback (most recent call last):
File "/Users/subham.polpagedar/Desktop/celery_task/venv_celery/bin/airflow", line 25, in <module>
from airflow.configuration import conf
File "/Users/subham.polpagedar/Desktop/celery_task/venv_celery/lib/python3.7/site-packages/airflow/__init__.py", line 42, in <module>
from airflow.models import DAG
File "/Users/subham.polpagedar/Desktop/celery_task/venv_celery/lib/python3.7/site-packages/airflow/models/__init__.py", line 21, in <module>
from airflow.models.baseoperator import BaseOperator, BaseOperatorLink # noqa: F401
File "/Users/subham.polpagedar/Desktop/celery_task/venv_celery/lib/python3.7/site-packages/airflow/models/baseoperator.py", line 43, in <module>
from airflow.models.dag import DAG
File "/Users/subham.polpagedar/Desktop/celery_task/venv_celery/lib/python3.7/site-packages/airflow/models/dag.py", line 46, in <module>
from airflow.executors import LocalExecutor, get_default_executor
File "/Users/subham.polpagedar/Desktop/celery_task/venv_celery/lib/python3.7/site-packages/airflow/executors/__init__.py", line 24, in <module>
from airflow.executors.base_executor import BaseExecutor # noqa
File "/Users/subham.polpagedar/Desktop/celery_task/venv_celery/lib/python3.7/site-packages/airflow/executors/base_executor.py", line 24, in <module>
import airflow.utils.dag_processing
File "/Users/subham.polpagedar/Desktop/celery_task/venv_celery/lib/python3.7/site-packages/airflow/utils/dag_processing.py", line 40, in <module>
from setproctitle import setproctitle
ImportError: dlopen(/Users/subham.polpagedar/Desktop/celery_task/venv_celery/lib/python3.7/site-packages/setproctitle.cpython-37m-darwin.so, 2): Symbol not found: _Py_GetArgcArgv
Referenced from: /Users/subham.polpagedar/Desktop/celery_task/venv_celery/lib/python3.7/site-packages/setproctitle.cpython-37m-darwin.so
Expected in: flat namespace
in /Users/subham.polpagedar/Desktop/celery_task/venv_celery/lib/python3.7/site-packages/setproctitle.cpython-37m-darwin.so
I faced a similar issue on macos. It turns out it was related to the python installed through brew.
If you can, try to use this version from python official website: https://www.python.org/downloads/
and use your virtual environment base as the version you just downloaded.
Hope it helps
I am using python 3.6
Below is the error message I am facing:
Traceback (most recent call last):
File "c:\Users\Vishal\Desktop\tf\new.py", line 1, in <module>
import tensorflow as tf
File "C:\Users\Vishal\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\__init__.py", line 98, in <module>
from tensorflow_core import *
File "C:\Users\Vishal\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow_core\__init__.py", line 40, in <module>
from tensorflow.python.tools import module_util as _module_util
File "C:\Users\Vishal\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\__init__.py", line 50, in __getattr__
module = self._load()
File "C:\Users\Vishal\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\__init__.py", line 44, in _load
module = _importlib.import_module(self.__name__)
File "C:\Users\Vishal\AppData\Local\Programs\Python\Python36\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\Vishal\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow_core\python\__init__.py", line 52, in <module>
from tensorflow.core.framework.graph_pb2 import *
File "C:\Users\Vishal\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow_core\core\framework\graph_pb2.py", line 7, in <module>
from google.protobuf import descriptor as _descriptor
File "C:\Users\Vishal\AppData\Local\Programs\Python\Python36\lib\site-packages\google\protobuf\descriptor.py", line 47, in <module>
from google.protobuf.pyext import _message
ImportError: DLL load failed: The specified procedure could not be found.
How to resolve the above?
Are you sure you have it installed for the right version of pip (also for the right version of python)?
Below is how you can install a library for a specific version of python (python3 in this case):
python3 -m pip install tensorflow
Or you can also do the below:
pip3 install tensorflow
It depends upon how you have configured python and pip.
How do you invoke python3.6?
In my system if I type python3 in the command line, it opens python3.6 console. It might be different for your case, so it is important to install libraries for appropriate versions for pip as well as python.
There are ways to check which pip is working with which version of python, one of which is, type pip --version or pip -V and it will show you in the output the version of the python it is working for.
Example:
$ pip -V
pip 6.1.1 from /usr/lib/python2.6/site-packages (python 2.6)
I am trying to use tensorflow for research in my macbook. I use pip3 to install tensorflow in the system (not in virtual environment).
At first, I just want to verify tensorflow can be correctly imported via python3 in terminal. However, sometimes, I got the following problem when importing.
>>>import tensorflow as tf
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/cyan/Library/Python/3.5/lib/python/site-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "/Users/cyan/Library/Python/3.5/lib/python/site-packages/tensorflow/python/__init__.py", line 47, in <module>
import numpy as np
File "/Library/Python/2.7/site-packages/numpy/__init__.py", line 142, in <module>
from . import add_newdocs
File "/Library/Python/2.7/site-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/Library/Python/2.7/site-packages/numpy/lib/__init__.py", line 8, in <module>
from .type_check import *
File "/Library/Python/2.7/site-packages/numpy/lib/type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "/Library/Python/2.7/site-packages/numpy/core/__init__.py", line 14, in <module>
from . import multiarray
ImportError: dlopen(/Library/Python/2.7/site-packages/numpy/core/multiarray.so, 2): Symbol not found: _PyBuffer_Type
Referenced from: /Library/Python/2.7/site-packages/numpy/core/multiarray.so
Expected in: flat namespace in /Library/Python/2.7/site-packages/numpy/core/multiarray.so
This error could only be solved if I ran the following code firstly before python3 execution
unset PYTHONPATH
If I didn't unset PYTHONPATH, I also found errors when checking the version of pip3 using
pip3 --version
The errors are shown as follows.
>> pip3 --version
Traceback (most recent call last):
File "/usr/local/bin/pip3", line 6, in <module>
from pip._internal import main
File "/Library/Python/2.7/site-packages/pip/_internal/__init__.py", line 19, in <module>
from pip._vendor.urllib3.exceptions import DependencyWarning
File "/Library/Python/2.7/site-packages/pip/_vendor/urllib3/__init__.py", line 8, in <module>
from .connectionpool import (
File "/Library/Python/2.7/site-packages/pip/_vendor/urllib3/connectionpool.py", line 11, in <module>
from .exceptions import (
File "/Library/Python/2.7/site-packages/pip/_vendor/urllib3/exceptions.py", line 2, in <module>
from .packages.six.moves.http_client import (
File "/Library/Python/2.7/site-packages/pip/_vendor/urllib3/packages/six.py", line 203, in load_module
mod = mod._resolve()
File "/Library/Python/2.7/site-packages/pip/_vendor/urllib3/packages/six.py", line 115, in _resolve
return _import_module(self.mod)
File "/Library/Python/2.7/site-packages/pip/_vendor/urllib3/packages/six.py", line 82, in _import_module
__import__(name)
File "/Library/Python/2.7/site-packages/http/__init__.py", line 7, in <module>
raise ImportError('This package should not be accessible on Python 3. '
ImportError: This package should not be accessible on Python 3. Either you are trying to run from the python-future src folder or your installation of python-future is corrupted.
I thought it was so inconvenient to unset PYTHONPATH every time, so is there any solutions for this problem? I also want to import tensorflow in other text editor, such as Sublime and Pycharm, so I was really not sure what to do next.
I tried the same scenario. It is working fine for me. In the first error it seems your python installation is messed up. If you are using python3 in terminal, it should not refer to 2.7 libraries.
Also I dont think you require unset PYTHONPATH everytime. First thing is you dont need to setup PYTHONPATH. It seems the installation got issue.
You using homebrew in mac to install packages. If not I will say use homebrew and it will work as charm. As it adds dependency properly.
Thanks,
Ashish
I'm trying to execute ansible in my system. I guess I messed up something and unable to run ansible. When I run ansible --version, I see the following error:
krishnapatamset:bin krishna.patamsetti$ ansible --version
[WARNING]: log file at /var/log/ansible/ansible.log is not writeable and we cannot create it, aborting
ERROR! Unexpected Exception: No module named markupsafe
the full traceback was:
Traceback (most recent call last):
File "/usr/local/bin/ansible", line 80, in <module>
from ansible.cli.adhoc import AdHocCLI as mycli
File "/usr/local/lib/python2.7/site-packages/ansible/cli/adhoc.py", line 28, in <module>
from ansible.executor.task_queue_manager import TaskQueueManager
File "/usr/local/lib/python2.7/site-packages/ansible/executor/task_queue_manager.py", line 29, in <module>
from ansible.executor.play_iterator import PlayIterator
File "/usr/local/lib/python2.7/site-packages/ansible/executor/play_iterator.py", line 30, in <module>
from ansible.playbook.block import Block
File "/usr/local/lib/python2.7/site-packages/ansible/playbook/__init__.py", line 27, in <module>
from ansible.playbook.play import Play
File "/usr/local/lib/python2.7/site-packages/ansible/playbook/play.py", line 27, in <module>
from ansible.playbook.base import Base
File "/usr/local/lib/python2.7/site-packages/ansible/playbook/base.py", line 29, in <module>
from jinja2.exceptions import UndefinedError
File "/usr/local/lib/python2.7/site-packages/jinja2/__init__.py", line 33, in <module>
from jinja2.environment import Environment, Template
File "/usr/local/lib/python2.7/site-packages/jinja2/environment.py", line 13, in <module>
from jinja2 import nodes
File "/usr/local/lib/python2.7/site-packages/jinja2/nodes.py", line 19, in <module>
from jinja2.utils import Markup
File "/usr/local/lib/python2.7/site-packages/jinja2/utils.py", line 531, in <module>
from markupsafe import Markup, escape, soft_unicode
ImportError: No module named markupsafe
Can anyone please help me with this situation. Thanks in advance
I even tried pip install markupsafe but still I am unable to get ansible working
Ansible is based on python and there is a python module that's missing called markupsafe
install it via pip, you may need to escalate privileges
pip2 install -I markupsafe
pip2 for python 2.x
-I to ignore and reinstall package if it's already installed
I uninstalled pip and installed it again.
brew uninstall pip
brew doctor
brew install pip