要创建一个helloworld .ipk
包,如here所述,我将bitbake
和OpenEmbedded
克隆为
git clone git://git.openembedded.org/bitbake
git clone git://git.openembedded.org/openembedded
然后导出以下变量
export OEBASE=/media/sda3/open_env/
export PATH=$OEBASE/bitbak/ebin:$PATH
export BBPATH=$OEBASE/build:$OEBASE/openembedded
export BB_ENV_EXTRAWHITE="OEBASE"
当我运行以下命令时,出现以下错误:
bitbake -b packages/myhelloworld/myhelloworld_0.1.bb
Traceback (most recent call last):
File "/usr/bin/bitbake", line 35, in <module>
import bb
ImportError: No module named bb
我正在
ubuntu 10.04
上执行此操作。我在这里想念的是什么?编辑:
如答案中给出的,我执行了以下命令并得到如下错误:
git clone git://git.openembedded.org/openembedded-core
cd openembedded-core
git clone git://git.openembedded.org/bitbake
cd ..
git checkout dylan
cd bitbake
git checkout 1.18
cd ..
. oe-init-build-env
修改
build/conf/local.conf
并在myhelloworld
目录中创建openembedded-core/build/
目录,然后执行bitbake myhelloworld/
我收到以下错误消息:
Traceback (most recent call last):
File "/media/sda3/open_env/openembedded-core/bitbake/bin/bitbake", line 34, in <module>
import bb
File "/media/sda3/open_env/openembedded-core/bitbake/lib/bb/__init__.py", line 77, in <module>
from bb import fetch2 as fetch
File "/media/sda3/open_env/openembedded-core/bitbake/lib/bb/fetch2/__init__.py", line 38, in <module>
import bb.persist_data, bb.utils
File "/media/sda3/open_env/openembedded-core/bitbake/lib/bb/persist_data.py", line 35, in <module>
from pysqlite2 import dbapi2 as sqlite3
ImportError: No module named pysqlite2
/media/sda3/open_env/openembedded-core/bitbake/lib/bb/event.py:104: RuntimeWarning: Parent module 'bb' not found while handling absolute import
from bb.msg import BBLogFormatter
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/home/python-2.7.3/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/media/sda3/open_env/openembedded-core/bitbake/lib/bb/event.py", line 104, in print_ui_queue
from bb.msg import BBLogFormatter
File "/media/sda3/open_env/openembedded-core/bitbake/lib/bb/__init__.py", line 77, in <module>
from bb import fetch2 as fetch
File "/media/sda3/open_env/openembedded-core/bitbake/lib/bb/fetch2/__init__.py", line 38, in <module>
import bb.persist_data, bb.utils
File "/media/sda3/open_env/openembedded-core/bitbake/lib/bb/persist_data.py", line 35, in <module>
from pysqlite2 import dbapi2 as sqlite3
ImportError: No module named pysqlite2
Error in sys.exitfunc:
Traceback (most recent call last):
File "/home/python-2.7.3/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/media/sda3/open_env/openembedded-core/bitbake/lib/bb/event.py", line 104, in print_ui_queue
from bb.msg import BBLogFormatter
File "/media/sda3/open_env/openembedded-core/bitbake/lib/bb/__init__.py", line 77, in <module>
from bb import fetch2 as fetch
File "/media/sda3/open_env/openembedded-core/bitbake/lib/bb/fetch2/__init__.py", line 38, in <module>
import bb.persist_data, bb.utils
File "/media/sda3/open_env/openembedded-core/bitbake/lib/bb/persist_data.py", line 35, in <module>
from pysqlite2 import dbapi2 as sqlite3
ImportError: No module named pysqlite2
Pseudo is not present but is required, building this first before the main build
Traceback (most recent call last):
File "/media/sda3/open_env/openembedded-core/bitbake/bin/bitbake", line 34, in <module>
import bb
File "/media/sda3/open_env/openembedded-core/bitbake/lib/bb/__init__.py", line 77, in <module>
from bb import fetch2 as fetch
File "/media/sda3/open_env/openembedded-core/bitbake/lib/bb/fetch2/__init__.py", line 38, in <module>
import bb.persist_data, bb.utils
File "/media/sda3/open_env/openembedded-core/bitbake/lib/bb/persist_data.py", line 35, in <module>
from pysqlite2 import dbapi2 as sqlite3
ImportError: No module named pysqlite2
/media/sda3/open_env/openembedded-core/bitbake/lib/bb/event.py:104: RuntimeWarning: Parent module 'bb' not found while handling absolute import
from bb.msg import BBLogFormatter
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/home/python-2.7.3/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/media/sda3/open_env/openembedded-core/bitbake/lib/bb/event.py", line 104, in print_ui_queue
from bb.msg import BBLogFormatter
File "/media/sda3/open_env/openembedded-core/bitbake/lib/bb/__init__.py", line 77, in <module>
from bb import fetch2 as fetch
File "/media/sda3/open_env/openembedded-core/bitbake/lib/bb/fetch2/__init__.py", line 38, in <module>
import bb.persist_data, bb.utils
File "/media/sda3/open_env/openembedded-core/bitbake/lib/bb/persist_data.py", line 35, in <module>
from pysqlite2 import dbapi2 as sqlite3
ImportError: No module named pysqlite2
Error in sys.exitfunc:
Traceback (most recent call last):
File "/home/python-2.7.3/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/media/sda3/open_env/openembedded-core/bitbake/lib/bb/event.py", line 104, in print_ui_queue
from bb.msg import BBLogFormatter
File "/media/sda3/open_env/openembedded-core/bitbake/lib/bb/__init__.py", line 77, in <module>
from bb import fetch2 as fetch
File "/media/sda3/open_env/openembedded-core/bitbake/lib/bb/fetch2/__init__.py", line 38, in <module>
import bb.persist_data, bb.utils
File "/media/sda3/open_env/openembedded-core/bitbake/lib/bb/persist_data.py", line 35, in <module>
from pysqlite2 import dbapi2 as sqlite3
ImportError: No module named pysqlite2
Traceback (most recent call last):
File "/media/sda3/open_env/openembedded-core/bitbake/bin/bitbake", line 34, in <module>
import bb
File "/media/sda3/open_env/openembedded-core/bitbake/lib/bb/__init__.py", line 77, in <module>
from bb import fetch2 as fetch
File "/media/sda3/open_env/openembedded-core/bitbake/lib/bb/fetch2/__init__.py", line 38, in <module>
import bb.persist_data, bb.utils
File "/media/sda3/open_env/openembedded-core/bitbake/lib/bb/persist_data.py", line 35, in <module>
from pysqlite2 import dbapi2 as sqlite3
ImportError: No module named pysqlite2
/media/sda3/open_env/openembedded-core/bitbake/lib/bb/event.py:104: RuntimeWarning: Parent module 'bb' not found while handling absolute import
from bb.msg import BBLogFormatter
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/home/python-2.7.3/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/media/sda3/open_env/openembedded-core/bitbake/lib/bb/event.py", line 104, in print_ui_queue
from bb.msg import BBLogFormatter
File "/media/sda3/open_env/openembedded-core/bitbake/lib/bb/__init__.py", line 77, in <module>
from bb import fetch2 as fetch
File "/media/sda3/open_env/openembedded-core/bitbake/lib/bb/fetch2/__init__.py", line 38, in <module>
import bb.persist_data, bb.utils
File "/media/sda3/open_env/openembedded-core/bitbake/lib/bb/persist_data.py", line 35, in <module>
from pysqlite2 import dbapi2 as sqlite3
ImportError: No module named pysqlite2
Error in sys.exitfunc:
Traceback (most recent call last):
File "/home/python-2.7.3/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/media/sda3/open_env/openembedded-core/bitbake/lib/bb/event.py", line 104, in print_ui_queue
from bb.msg import BBLogFormatter
File "/media/sda3/open_env/openembedded-core/bitbake/lib/bb/__init__.py", line 77, in <module>
from bb import fetch2 as fetch
File "/media/sda3/open_env/openembedded-core/bitbake/lib/bb/fetch2/__init__.py", line 38, in <module>
import bb.persist_data, bb.utils
File "/media/sda3/open_env/openembedded-core/bitbake/lib/bb/persist_data.py", line 35, in <module>
from pysqlite2 import dbapi2 as sqlite3
ImportError: No module named pysqlite2
最佳答案
您正在将最近的Bitbake与OpenEmbedded classic混合使用;请不要那样做。您还尝试手动设置构建环境,也不要设置该环境。任何新开发都应基于OpenEmbedded Core。
您应该做什么:
克隆存储库。
git clone git://git.openembedded.org/openembedded-core
cd openembedded-core
git clone git://git.openembedded.org/bitbake
如果要使用某个分支,例如jethro
git checkout jethro
cd bitbake
git checkout 1.28
cd ..
请参见corresponding release branches of OE-core and bitbake。
设置构建环境:
. oe-init-build-env
配置构建。
即在
build/conf/local.conf
中设置正确的机器等。建立!
现在您想要什么,例如任何:
bitbake core-image-minimal
bitbake myehelloworld
更新:请注意,最后一个发行版(
Poky
,已针对Ubuntu 10.04
进行了正式测试,是Dylan
)。以后的发行版很可能在该主机上存在问题,我建议更新到较新的LTS发行版。更新2:您的新错误为
ImportError: No module named pysqlite2
。 Bitbake首先会查找sqlite3
。将其安装在您的构建主机apt-get install libsqlite3-dev
上关于python - ImportError:没有名为bb的模块,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/36395831/