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

install python3-bpfcc to conda environment #5103

Open
zhangzhiqiangcs opened this issue Sep 11, 2024 · 1 comment
Open

install python3-bpfcc to conda environment #5103

zhangzhiqiangcs opened this issue Sep 11, 2024 · 1 comment

Comments

@zhangzhiqiangcs
Copy link

zhangzhiqiangcs commented Sep 11, 2024

After install python3-bpfcc and libbpfcc, the script python3 -c "from bcc import BPF; print('BCC installed successfully')" is OK.
But if you use conda environment, it will output error with No module named 'bcc'.
What is the way to install python3-bpfcc into a conda environment.

@wan-nan
Copy link

wan-nan commented Dec 3, 2024

I attempted to install the package from source, but encountered the same issue of missing the bcc package. This seems to be due to differences between the Python version used by Conda and my system's default Python, as well as differing sys.path.
I eventually resolved the problem by copying the bcc files obtained from the source installation directly into a path included in Conda's sys.path. Specifically, I used the following command:

sudo cp -r /path-to-cloned-bcc-repo/build/src/python/bcc-python3/bcc /root/miniconda3/lib/python3.12/site-packages/

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

2 participants