Vector35 / Vector35/binaryninja-api

User specified Python environment is not prioritized in Python Path

Open
#4,093 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Component: Plugin Effort: Low Impact: Medium
Dominant language
C++
Stars
1.3k
Forks
298
Avg merge
5d 5h
Merged PRs (30d)
19

Description

Version and Platform (required):

  • Binary Ninja Version: 3.4.4133
  • OS: Ubuntu
  • OS Version: 22.04
  • CPU Architecture: x64

Bug Description:
When a user manually sets the "virtualenv" of their Binja's plugin, they expect that Python to have priority in package lookup against the builtin Binja Python; however, it is not prioritized.

Steps To Reproduce:

  1. Open Binja and set up your Python to be something like this:
    image
  2. Restart Binja
  3. Go to the Python interpreter in Binja and type import sys; sys.path, this should result in something like:
['/home/mahaloz/.binaryninja/repositories/official/plugins', '/home/mahaloz/.binaryninja/repositories/community/plugins', '/home/mahaloz/.binaryninja/plugins', '/home/mahaloz/.binaryninja/python310/site-packages', ...]

Notice that the last entry in the path is /home/mahaloz/.binaryninja/python310/site-packages, which means when a user has a library installed on the Binja python, that one will always be chosen. Whenever a user sets their Python env manually, it's expected that their packages would be chosen when this happens.

Expected Behavior:
Whenever a user sets their Python env manually, it's expected that their packages would be chosen when this happens. After they do this change, they should see their site packages before Binjas in the Path.

Screenshots:
Show above.

Additional Information:
Linking BinSync issue so both can close when this is fixed: https://github.com/binsync/binsync/issues/241

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the configured virtualenv behavior in Binary Ninja's Python interpreter with import sys; sys.path, as described in the issue. Trace the plugin environment setup and verify that the user-selected environment's site-packages appear before Binary Ninja's built-in site-packages when the issue is fixed.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.