1

I have an Arch Linux Machine inside which I have "containers" like Centos which I normally chroot and work upon from the command line. I setup Pycharm to work on a project that is inside this "container" The "container" was created using LXC, but I normally login using chroot.

There is a problem running the interactive debugger from Pycharm however.

The command that is run to start the interactive debugger from Pycharm is:

/usr/lib/lxc/centos/rootfs/home/virtual-environment/usr/bin/python /home/nishant/packages/pycharm-community/helpers/pydev/pydevconsole.py

ERROR:root:code for hash md5 was not found

I was able to reproduce this problem without Pycharm.

If I chroot to that environment and then do usr/bin/ python -v -c "import hashlib" everything works.

If I execute /usr/lib/lxc/centos/rootfs/home/virtual-environment/usr/bin/python from my main system, the same error comes.

Fundamentally I think the problem is that I am executing the command in a wrong environment. I think Pycharm should not be executing this interpreter directly but instead in a chroot context.

  1. Is it possible to achieve that using Pycharm?
  2. In general, is it possible to execute a chroot command by not doing a chroot, like setting the LDD path differently or something like that?
Nishant
  • 20,354
  • 18
  • 69
  • 101
  • Did you try googling the error message? – Code-Apprentice Sep 13 '17 at 05:14
  • Yes I did that, it is not clear how do I apply that fix in this case. I am still trying to figure out. For example there is https://stackoverflow.com/questions/20399331/error-importing-hashlib-with-python-2-7-but-not-with-2-6. I think the problem is the same but the way to solve it in this case is what I am confused about. – Nishant Sep 13 '17 at 05:16
  • Does your project depend on libssl or use a library which does? If so you need to be sure it is available from whatever directory is your `chroot`. – Code-Apprentice Sep 13 '17 at 05:18
  • I thinking everything is there. Will check again. My fundamental question is, is it fine for Pycharm to run this `/usr/lib/lxc/centos/rootfs/home/virtual-environment/usr/bin/python` directly? How does it know that this is actually supposed to be run in a chrooted environment? Won't it otherwise pick up libraries from my host system? – Nishant Sep 13 '17 at 05:22
  • 1
    python will have to simulate the chroot in some way. An alternative is to use the tool `virtualenv` instead of chroot. – Code-Apprentice Sep 13 '17 at 14:09

0 Answers0