我通過pip install urdf2webots. 使用命令后python -m urdf2webots.importer --input=Rover_2022.urdf --output=Rover_2022.proto,我得到/bin/python: No module named urdf2webots. 我該如何解決?
沒有sudo
which python回傳/bin/pythonpip show urdf2webots回傳
Name: urdf2webots
Version: 1.0.16
Summary: A converter between URDF and PROTO files.
Home-page: https://github.com/cyberbotics/urdf2webots
Author: Cyberbotics
Author-email: [email protected]
License: Apache License, Version 2.0
Location: /home/drakeprovost/.local/lib/python3.8/site-packages
Requires: rospkg, pycollada, numpy, Pillow
Required-by:
- 如果我
python要列印 sys.path,我會得到:
$ python
Python 2.7.18 (default, Mar 8 2021, 13:02:45)
[GCC 9.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/opt/ros/foxy/lib/python3.8/site-packages', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages']
>>>
和sudo
值得注意的是,我也嘗試了所有這些命令,sudo看看它是否改變了軟體包的安裝位置。確實如此,但問題仍然存在:
$ sudo python -m urdf2webots.importer --input=Rover_2022.urdf --output=Rover_2022.proto產量/usr/bin/python: No module named urdf2webotssudo which python產量/usr/bin/pythonsudo pip show urdf2webots給
Name: urdf2webots
Version: 1.0.16
Summary: A converter between URDF and PROTO files.
Home-page: https://github.com/cyberbotics/urdf2webots
Author: Cyberbotics
Author-email: [email protected]
License: Apache License, Version 2.0
Location: /usr/local/lib/python3.8/dist-packages
Requires: rospkg, Pillow, pycollada, numpy
Required-by:
- sys.path 回傳
$ sudo python
Python 2.7.18 (default, Mar 8 2021, 13:02:45)
[GCC 9.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages']
>>>
我認識到在這兩種情況下, 的位置urdf2webots都不匹配來自 的任何路徑sys.path,但我不知道如何解決這個問題。有小費嗎?
uj5u.com熱心網友回復:
你可以試試:
python -m pip install urdf2webots
這將為您要使用的默認 python 安裝庫。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/430802.html
標籤:Python python-2.7 点子
上一篇:在javascript中使用filter()來實作curriable()是可行的,但是,uisngmap()是可行的,為什么?
下一篇:無法訪問Unity的類
