Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

SBP library path issue #22

Closed
marco-tranzatto opened this issue Jun 15, 2017 · 2 comments
Closed

SBP library path issue #22

marco-tranzatto opened this issue Jun 15, 2017 · 2 comments
Labels

Comments

@marco-tranzatto
Copy link
Contributor

marco-tranzatto commented Jun 15, 2017

SBP library in usage is the one located in /usr/local/lib/python2.7/dist-packages/, and not the one installed in ~/Software/ folder. Switching back and forth from Piksi V2 to Multi can be annoying, since you manually need to remove the SBP folder that you don't want.

@marco-tranzatto
Copy link
Contributor Author

From Python Documentation:

When a module named spam is imported, the interpreter first searches for a built-in module with that name. If not found, it then searches for a file named spam.py in a list of directories given by the variable sys.path. sys.path is initialized from these locations: (1) the directory containing the input script (or the current directory), (2) PYTHONPATH (a list of directory names, with the same syntax as the shell variable PATH), (3) the installation-dependent default.

By printing sbp.client.__file__ (__file__ is the pathname of the file from which the module was loaded, if it was loaded from a file), I could double check that, despite of the PYTHONPATH set in .bashrc, the sbp modules are always loaded from /usr/local/lib/python2.7/dist-packages/sbp-2.2.1-py2.7.egg/sbp

@marco-tranzatto
Copy link
Contributor Author

Addressed in PR #24.

Since it is unlikely for a system to use both PiksiV2 and Piksi Multi, the cleanest solution is to use the default path of Python, where SBP module gets installed, and do not modify PYTHONPATH in .bashrc.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant