no module named '_bz2' in virtualenv, python3

475 Views Asked by At

I'm using 'virtualenv' to manage different environments. (ubuntu 18.04)

But when I workon an env with python3.7 and run the code(smpl-x from github) , it says "no module named '_bz2'".

I tried these:

  1. sudo apt-get install libbz2-dev But it seems that bz2 is not installed in my virualenv, so it doesn't work.

  2. some posts say that I need to rebuild python. But I don't know how to do this in my virtualenv.

Is there a way to solve this problem?

Any help would be greatly appreciated. Thank you very much.

1

There are 1 best solutions below

0
Dummy Head On BEST ANSWER

Guys I have solved this problem.

I removed my global python3.7 and built it again from the source code. Then the problem is solved.

I'm a noob in linux so not very familiar with these operations.

Again very appreciate your attention. Thank you very much!!