Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 550864 - dev-embedded/bitbake-1.17.0:ImportError: No module named pysh
Summary: dev-embedded/bitbake-1.17.0:ImportError: No module named pysh
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Embedded Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-31 09:04 UTC by Toralf Förster
Modified: 2019-09-17 08:41 UTC (History)
7 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge log (dev-embedded-bitbake-1.17.0-20150530-111505.log,22.11 KB, text/plain)
2015-05-31 09:04 UTC, Toralf Förster
Details
package list (dev-embedded-bitbake-1.17.0-20150530-111505.pks,240.93 KB, text/plain)
2015-05-31 09:04 UTC, Toralf Förster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2015-05-31 09:04:06 UTC
Created attachment 404354 [details]
emerge log

File "/var/tmp/portage/dev-embedded/bitbake-1.17.0/work/bitbake-1.17.0-python2_7/lib/bb/pysh/pyshyacc.py", line 657, in <module>
    yacc.yacc(tabmodule = 'pysh.pyshtables', write_tables = 0, debug = 0)
  File "/usr/lib64/python2.7/site-packages/ply/yacc.py", line 3215, in yacc
    exec('import %s' % pkgname)
  File "<string>", line 1, in <module>
ImportError: No module named pysh
Error in sys.exitfunc:
Traceback (most recent call last):
  File "/usr/lib64/python2.7/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "/var/tmp/portage/dev-embedded/bitbake-1.17.0/work/bitbake-1.17.0-python2_7/lib/bb/event.py", line 104, in print_ui_queue
    from bb.msg import BBLogFormatter
  File "/var/tmp/portage/dev-embedded/bitbake-1.17.0/work/bitbake-1.17.0-python2_7/lib/bb/__init__.py", line 82, in <module>
    from bb import fetch2 as fetch
  File "/var/tmp/portage/dev-embedded/bitbake-1.17.0/work/bitbake-1.17.0-python2_7/lib/bb/fetch2/__init__.py", line 35, in <module>
    from bb import data
  File "/var/tmp/portage/dev-embedded/bitbake-1.17.0/work/bitbake-1.17.0-python2_7/lib/bb/data.py", line 48, in <module>
    from bb import data_smart
  File "/var/tmp/portage/dev-embedded/bitbake-1.17.0/work/bitbake-1.17.0-python2_7/lib/bb/data_smart.py", line 35, in <module>
    import bb, bb.codeparser
  File "/var/tmp/portage/dev-embedded/bitbake-1.17.0/work/bitbake-1.17.0-python2_7/lib/bb/codeparser.py", line 7, in <module>
    from pysh import pyshyacc, pyshlex, sherrors
  File "/var/tmp/portage/dev-embedded/bitbake-1.17.0/work/bitbake-1.17.0-python2_7/lib/bb/pysh/pyshyacc.py", line 657, in <module>
    yacc.yacc(tabmodule = 'pysh.pyshtables', write_tables = 0, debug = 0)
  File "/usr/lib64/python2.7/site-packages/ply/yacc.py", line 3215, in yacc
    exec('import %s' % pkgname)
  File "<string>", line 1, in <module>
ImportError: No module named pysh
 * ERROR: dev-embedded/bitbake-1.17.0::gentoo failed (install phase):
 *   (no error message)
 * 
 * Call stack:
 *     ebuild.sh, line   93:  Called src_install
 *   environment, line 3817:  Called distutils-r1_src_install
 *   environment, line 1234:  Called _distutils-r1_run_foreach_impl 'distutils-r1_python_install'
 *   environment, line  362:  Called python_foreach_impl 'distutils-r1_run_phase' 'distutils-r1_python_install'
 *   environment, line 3398:  Called multibuild_foreach_variant '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_install'
 *   environment, line 2522:  Called _multibuild_run '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_install'
 *   environment, line 2520:  Called _python_multibuild_wrapper 'distutils-r1_run_phase' 'distutils-r1_python_install'
 *   environment, line  802:  Called distutils-r1_run_phase 'distutils-r1_python_install'
 *   environment, line 1203:  Called distutils-r1_python_install
 *   environment, line 1130:  Called esetup.py 'install' '--root=/var/tmp/portage/dev-embedded/bitbake-1.17.0/image//_python2.7'
 *   environment, line 1691:  Called die
 * The specific snippet of code:
 *       "${@}" || die
 * 
 * If you need support, post the output of `emerge --info '=dev-embedded/bitbake-1.17.0::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-embedded/bitbake-1.17.0::gentoo'`.
 * The complete build log is located at '/var/log/portage/dev-embedded:bitbake-1.17.0:20150530-111505.log'.
 * For convenience, a symlink to the build log is located at '/var/tmp/portage/dev-embedded/bitbake-1.17.0/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-embedded/bitbake-1.17.0/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-embedded/bitbake-1.17.0/work/bitbake-1.17.0'
 * S: '/var/tmp/portage/dev-embedded/bitbake-1.17.0/work/bitbake-1.17.0'

  -----------------------------------------------------------------

  This is an unstable amd64 chroot image (named amd64-hardened-unstable_20150515-221306) at a hardened host acting as a tinderbox.

Portage 2.2.19 (python 2.7.9-final-0, hardened/linux/amd64, gcc-4.9.2, glibc-2.20-r2, 4.0.4-hardened-r2 x86_64)
=================================================================
System uname: Linux-4.0.4-hardened-r2-x86_64-Intel-R-_Core-TM-_i7-3770_CPU_@_3.40GHz-with-gentoo-2.2
KiB Mem:    16164692 total,   1315868 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Sat, 30 May 2015 07:15:01 +0000
sh bash 4.3_p33-r2
ld GNU ld (Gentoo 2.25 p1.1) 2.25
app-shells/bash:          4.3_p33-r2::gentoo
dev-java/java-config:     2.2.0::gentoo
dev-lang/perl:            5.20.2-r1::gentoo
dev-lang/python:          2.7.9-r2::gentoo, 3.3.5-r1::gentoo, 3.4.3::gentoo
dev-util/cmake:           3.2.2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.16.3::gentoo
sys-apps/sandbox:         2.6-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r1::gentoo
sys-devel/automake:       1.9.6-r4::gentoo, 1.10.3-r1::gentoo, 1.11.6-r1::gentoo, 1.13.4::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25::gentoo
sys-devel/gcc:            4.8.4::gentoo, 4.9.2::gentoo
sys-devel/gcc-config:     1.8::gentoo
sys-devel/libtool:        2.4.6-r1::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.0::gentoo (virtual/os-headers)
sys-libs/glibc:           2.20-r2::gentoo
Repositories:

local
    location: /usr/local/portage
    masters: gentoo

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: 9999

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/entropy /etc/stunnel/stunnel.conf /usr/lib64/tomoyo/conf /usr/share/config /usr/share/easy-rsa /usr/share/gnupg/qualified.txt /usr/share/qpsmtpd/plugins"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.6/ext-active/ /etc/php/cgi-php5.6/ext-active/ /etc/php/cli-php5.6/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/var/tmp/distfiles"
EMERGE_DEFAULT_OPTS="--nospinner --tree --quiet-build"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://ftp.uni-erlangen.de/pub/mirrors/gentoo rsync://mirror.netcologne.de/gentoo/ ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gor.bytemark.co.uk/gentoo/ rsync://ftp.snt.utwente.nl/gentoo"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j1"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
USE="X acl aes-ni alsa amd64 apache2 avx avx2 berkdb bzip2 cairo cli corefonts cracklib crypt cups cxx dbus designer dnssec dot dri drmkms dvd ecc ecdsa extraengine ffmpeg fontconfig fortran fpm gd gdbm gif gtk gudev gui hardened iconv icu isag jadetex jpeg justify kvm lapack libkms libvirtd logrotate mbox minizip mmx mmxext modules multilib mysql ncurses nls nptl ogg opengl openmp openssl pam pax_kernel pcre pcre16 plasma png policykit pwquality python qemu qt3support readline scrpyt sdl session spice sqlite sse sse2 sse4 sse4_1 sse4_2 ssh-askpass ssl ssse3 svg tcpd theora thinkpad threads tk tls truetype uml unicode urandom usb usbredir uxa v4l v4l2 video vorbis xa xattr xkb xmp xscreensaver xslt xtpax xvfb xvmc zenmap zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_E XTENSIONS="presenter-console presenter-minimizer" LINGUAS="en en_GB" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Toralf Förster gentoo-dev 2015-05-31 09:04:26 UTC
Created attachment 404356 [details]
package list
Comment 2 Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2015-05-31 09:15:39 UTC
Comment on attachment 404356 [details]
package list

What is that? I can't get it.
Comment 3 Toralf Förster gentoo-dev 2015-05-31 09:31:34 UTC
(In reply to Mikle Kolyada from comment #2)
> Comment on attachment 404356 [details]
> package list
> 
> What is that? I can't get it.

The list of all currently installed packages of that chroot image.
And I can download it fine - so why do you mark it as obsolete ?
Comment 4 Petre Rodan 2015-11-11 07:08:51 UTC
I had the same "No module named pysh" when I tried to emerge this package.

according to their mailinglist [1], setup.py is not to be used. that file has been removed from their git repo as well, which makes bitbake-9999 unusable.

this ebuild should (probably) simply copy the files and use them directly.

[1] http://lists.openembedded.org/pipermail/bitbake-devel/2015-May/005703.html

$ cd /local; tar -xzvf /usr/portage/distfiles/bitbake-1.17.0.tar.gz
$ export PATH="${PATH}:/local/bitbake-1.17.0/bin"
$ bitbake --help
Usage: bitbake [options] [recipename/target ...]

    Executes the specified task (default is 'build') for a given set of target recipes (.bb files).
    It is assumed there is a conf/bblayers.conf available in cwd or in BBPATH which
    will provide the layer, BBFILES and other configuration information.

Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -b BUILDFILE, --buildfile=BUILDFILE
[..]
$ bitbake wrlinux-image-glibc-small
Parsing recipes: 100% |###############################################################################################################################| Time: 00:03:36
Parsing of 2236 .bb files complete (0 cached, 2236 parsed). 2805 targets, 104 skipped, 5 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
[..]
Comment 5 Juergen Rose 2016-04-06 04:56:33 UTC
(In reply to Petre Rodan from comment #4)
...
> according to their mailinglist [1], setup.py is not to be used. that file
> has been removed from their git repo as well, which makes bitbake-9999
> unusable.
> 
> this ebuild should (probably) simply copy the files and use them directly.
> 
> [1]
> http://lists.openembedded.org/pipermail/bitbake-devel/2015-May/005703.html
> 
> $ cd /local; tar -xzvf /usr/portage/distfiles/bitbake-1.17.0.tar.gz
> $ export PATH="${PATH}:/local/bitbake-1.17.0/bin"
> $ bitbake --help
...

I hit the same issuse. Is there a patch for the ebuild?
Comment 6 Juergen Rose 2016-04-06 16:14:32 UTC
At http://www.openembedded.org/wiki/OEandYourDistro#Gentoo_instructions it is stated, that before installing bitbake psyco, pysqlite, chrpath, fakeroot etc should be installed. And it is noted that Psyco, the Python JIT compiler, requires python-2.6.6 and works on 32-bit x86 platforms only. 
Is there not any way to install bitbake on a current system?
Comment 7 Paul Osmialowski 2016-05-13 05:03:00 UTC
The same here on newly installed gentoo. Strangely, on one of my older x86_64 gentoo systems I got this version of bitbake installed:
[ebuild   R    ] dev-embedded/bitbake-1.17.0::gentoo  USE="-doc" PYTHON_TARGETS="python2_7" 0 KiB
Comment 8 Guillermo A. Amaral 2017-04-21 19:21:03 UTC
FYI, pysh IS included in the bitbake sources (you can see it in the output: /var/tmp/portage/dev-embedded/bitbake-1.17.0/work/bitbake-1.17.0-python2_7/lib/bb/pysh)

It's just a matter of fixing looking in the lib/bb directory while building (a quick workaround would be to set the PYTHONPATH to point to it after it fails the first time).
Comment 9 Michael Frommberger 2017-07-03 11:36:23 UTC
Here the same problem. Seems that is discouraged to install bitbake system wide:
http://git.openembedded.org/bitbake/commit/?id=e446281fbdd13cdfd2e39af0f48035829e2133ba
Comment 10 Henning Schild 2017-07-15 05:28:09 UTC
Same here.
Comment 11 Jerry Zhou 2018-10-18 03:18:11 UTC
I met this issue too. I think it maybe is the ebuild issue.
1. The root cause maybe is python couldn't locate the local pysh package exactly.

$ cat bitbake-1.17.0/setup.py 
#!/usr/bin/env python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
# Copyright (C) 2003  Chris Larson
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

import os, sys
sys.path.append(os.path.join(os.path.dirname(__file__), "lib"))
from bb import __version__

from glob import glob
from distutils.command.clean import clean
from distutils.command.build import build
from distutils.core import setup


doctype = "html"

class Clean(clean):
    def run(self):
        clean.run(self)
... ...

When I appended a "sys.path.append(os.path.join(os.path.dirname(__file__), "lib/bb"))" below "sys.path.append(os.path.join(os.path.dirname(__file__), "lib"))", this issue will be fixed.

2. So, maybe the following modification is workable.

$ cat /usr/portage/dev-embedded/bitbake/bitbake-1.17.0.ebuild 
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI="5"
PYTHON_COMPAT=( python2_7 )
PYTHON_REQ_USE="sqlite"

inherit distutils-r1 vcs-snapshot

if [[ ${PV} == *9999 ]]; then
	EGIT_REPO_URI="git://git.openembedded.org/bitbake.git"
	inherit git-r3
else
	SRC_URI="https://github.com/openembedded/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
	KEYWORDS="amd64 ppc x86"
fi

DESCRIPTION="package management tool for OpenEmbedded"
HOMEPAGE="http://git.openembedded.org/bitbake/"

LICENSE="GPL-2"
SLOT="0"
IUSE="doc"

RDEPEND="
	dev-python/ply[${PYTHON_USEDEP}]
	dev-python/progressbar[${PYTHON_USEDEP}]"
DEPEND="doc? ( dev-libs/libxslt )"

src_prepare() {
	if ! use doc ; then
		sed -i -e 's:doctype = "html":doctype = "none":' \
			-e 's:("share/doc/bitbake-%s/manual.*))::' setup.py || die
		echo "none:" >> doc/manual/Makefile || die
	else
	    sed -i -e "s:\(share/doc/bitbake-%s.* %\) __version__:\1 \"${PV}\":" setup.py || die
		sed -i -e '/sys.path.append/asys.path.append(os.path.join(os.path.dirname(__file__), "lib/bb"))' setup.py # !!! I AM HERE !!!
	fi
} 

At last, I don't know if this modification is good, but I am sure it is workable for me. AND, I DON'T KNOW how to commit this patch. Who can help me, check or review this modification?
Comment 12 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-09-17 08:41:35 UTC
The package is being removed wrt bug #540360.