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

Pr fix sai_thrift import error #639

Merged
merged 3 commits into from
Nov 7, 2024

Conversation

vikumarks
Copy link
Contributor

Fixing below error

/usr/local/lib/python3.9/dist-packages/saichallenger/common/sai_client/sai_thrift_client/sai_thrift_client.py:8: in <module>
    from saichallenger.common.sai_client.sai_thrift_client.sai_thrift_utils import *
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    import re
    from itertools import zip_longest
    import ipaddress
    import json
    > from sai_thrift import sai_headers
    E   ModuleNotFoundError: No module named 'sai_thrift'

"python3 setup.py install" CHANGED to "pip3 install ." in Dockerfile.saichallenger-client.
python3 setup.py install , installs files in /usr/lib/python3.9/site-packages/ which is not in sys.path
pip3 install . , installs filesin /usr/local/lib/python3.9/dist-packages/ which is in sys.apth

Fixing below error
/usr/local/lib/python3.9/dist-packages/saichallenger/common/sai_client/sai_thrift_client/sai_thrift_client.py:8: in <module>
    from saichallenger.common.sai_client.sai_thrift_client.sai_thrift_utils import *
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    import re
    from itertools import zip_longest
    import ipaddress
    import json
>   from sai_thrift import sai_headers
E   ModuleNotFoundError: No module named 'sai_thrift'

python3 setup.py install changed to pip3 install .
Update Dockerfile.saichallenger-client to Fix "ModuleNotFoundError: No module named 'sai_thrift'"
@vikumarks
Copy link
Contributor Author

This PR will fix #613

@vikumarks
Copy link
Contributor Author

@r12f Could you please review the changes in PR at your convenience? If everything looks good, kindly approve and merge the changes.

@KrisNey-MSFT KrisNey-MSFT requested a review from r12f November 5, 2024 22:40
@KrisNey-MSFT
Copy link
Collaborator

adding @r12f as a reviewer

@r12f r12f merged commit 07bc9ae into sonic-net:main Nov 7, 2024
3 checks passed
@vikumarks vikumarks deleted the pr-fix-sai_thrift-import-error branch November 8, 2024 17:46
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

Successfully merging this pull request may close these issues.

3 participants