Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing qira without installing qemu through qemu_build.sh #235

Open
aumars opened this issue Jul 8, 2019 · 2 comments
Open

Installing qira without installing qemu through qemu_build.sh #235

aumars opened this issue Jul 8, 2019 · 2 comments

Comments

@aumars
Copy link

aumars commented Jul 8, 2019

Continuing from #234, I used the following script to build and package qira.

build() {
  cd ${pkgname}-${pkgver}/qiradb
  python2 setup.py build
}

package() {
  cd ${pkgname}-${pkgver}

  pushd qiradb
  # python2 setup.py install -O1 --single-version-externally-managed --root="${pkgdir}"
  python2 setup.py install -O1 --root="${pkgdir}"
  popd

  mv qiradb/VERSION VERSION
  rm -r qiradb

  install -d "${pkgdir}/opt/${pkgname}"
  cp -r . "${pkgdir}/opt/${pkgname}"

  install -d "${pkgdir}/usr/bin"
  ln -s "/opt/${pkgname}/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"

  virtualenv2 venv
  source venv/bin/activate
  
  install -Dm644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README"
}

However, when I run qira, it doesn't seem to import ipaddr in Python 2.7.

$ qira
Traceback (most recent call last):
  File "/opt/qira/middleware/qira.py", line 6, in <module>
    import ipaddr
ImportError: No module named ipaddr

This shouldn't be the case, importing ipaddr on a separate process works fine.

$ python2.7
Python 2.7.16 (default, Mar 11 2019, 18:59:25) 
[GCC 8.2.1 20181127] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ipaddr
>>> 
@aumars
Copy link
Author

aumars commented Jul 14, 2019

Apparently it can't import from /usr/lib64/python2.7/site-packages.

@aumars
Copy link
Author

aumars commented Jul 14, 2019

I don't know if this is an issue for my arch or not but I temporarily fixed it by adding
sys.path.append('/usr/lib64/python2.7/site-packages') or by running sed -i '/import sys/c\import sys\nsys.path.append('/usr/lib64/python2.7/site-packages')/' middleware/qira.py.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant