Comments (4)
If you use --prefix
, Broker defaults to the "home scheme" type of python module installation and I think that's the intended location for that. It looks like you can use --python-prefix
to override that and install in the location that you want?
from broker.
I've tried to read up on the notion of "home scheme" that says the modules go in ${BROKER_PYTHON_HOME}/lib/python
, but could not find such reference. I've encountered only the other scheme in stackoverflow posts and official docs ${BROKER_PYTHON_PREFIX}/lib/python${pyver}/site-packages)
.
This workaround solves the problem, actually:
export PYTHONPATH="$PREFIX/lib/python"
But I wonder if we can avoid it, given that installing Broker in a Python venv should ideally not require setting this path manually.
from broker.
I've tried to read up on the notion of "home scheme" that says the modules go in ${BROKER_PYTHON_HOME}/lib/python, but could not find such reference.
https://docs.python.org/3.7/install/#alternate-installation-the-home-scheme
It's using this install location just because you gave an explicit --prefix
. That can be an ambiguous situation since the typical install location for python modules in site-packages/
can live outside the --prefix
that was given, so instead it just defaults to using the "home scheme" installation inside the prefix that you asked for.
This workaround solves the problem, actually:
export PYTHONPATH="$PREFIX/lib/python"
But I wonder if we can avoid it, given that installing Broker in a Python venv should ideally not require setting this path manually.
If you don't specify --prefix
, then I expect it installs things in a location where you don't need to set PYTHONPATH
.
There's also the --python-prefix
option I mentioned that I think can be used in combination with --prefix
if you actually want the python install prefix to differ from the typical install prefix.
I'm not quite sure there's a good way to automatically disambiguate what the user wanted in this case case, but if you come up with something feel free to submit a PR, else let me know if --python-prefix
actually doesn't work how you expect.
from broker.
https://docs.python.org/3.7/install/#alternate-installation-the-home-scheme
Thanks, that link cleared up things for me.
My goal is that a user doesn't have to specify PYTHONPATH
because I'm dealing with a virtual env that should be self-contained. To make this work, I needed to add a tiny script sitecustomize.py
to $PREFIX/lib/pythonX.Y/site-packages
:
import os
import site
import sys
home = os.path.join(sys.prefix, 'lib', 'python')
site.addsitedir(home)
It adds the Broker prefix $PREFIX/lib/python
to sys.path
such that setting PYTHONPATH
is no longer needed.
from broker.
Related Issues (20)
- Introduce versioning for the Zeek-layer serialization format
- Generic mechanism to add metadata to Zeek events.
- Websocket API: holes in vectors not preseved HOT 3
- docs/websocket: ISO 8601 discrepancies HOT 1
- Broker metrics port setting overriding BROKER_METRICS_PORT env variable HOT 2
- High caf thread utilization with 512 workers and 96 loggers HOT 10
- caf::actor_control_block::enqueue segfault when running supervisor.config-bare-mode test
- Websocket API: messages truncated to 4KB HOT 13
- Allow WebSocket and native clients on the same socket HOT 5
- clang-tidy fails with version 15+ HOT 2
- Metrics scalability performance issue in 6.0 HOT 12
- Resurrect `broker-cluster-benchmark`
- New Broker WebSocket Python bindings
- Set TLS minimum proto version to 1.2 or greater. HOT 6
- Make broker::data_envelope::deserialize() for JSON format accessible HOT 1
- Missing compatibility list for Zeek HOT 2
- Broker include broken HOT 4
- Convert Broker to use prometheus-cpp registry from Zeek HOT 1
- Broker message provenance tracking HOT 2
- Allow tapping into Broker logs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from broker.