python >= 3.5
(with dev headers)setuptools
(pip install setuptools
)
Edit local.properties
in the project root:
architecture
- set toarm64
orx86_64
depending on your Python architecture.enable_python_package
- set totrue
for working with Python package.python.include_path
- path to Python include directory where Python.h located. To get this path you can runpython -c "from sysconfig import get_paths as gp; print(gp()['include'])"
.python.bin_path
- path to your Python bin directory. To get this path you can runpython -c "from sysconfig import get_paths as gp; print(gp()['scripts'])"
.
Gradle build
in the sibling project python-package-build
or just run shell command (if the changes are only in the Python code):
python setup.py update_js bdist_wheel
- change dir to
lets-plot/python-package
- create / activate Python environment (if needed)
- run shell command:
pip install --no-index --find-links=dist/ lets-plot --no-deps --force-reinstall
When the "dev" version is built, lets-plot
embeds current "dev" js into Jupyter notebook.
If necessary, this default can be temporarily overwritten by editing dev_xxx
settings in _global_settings.py
The "dev" version of js library can be served from dist
folder of js-package project like:
# Start local web-server to serve dev js script:
$ cd lets-plot
$ python -m http.server 8080
from lets_plot import *
data = dict(time=['Lunch', 'Lunch', 'Dinner', 'Dinner', 'Dinner'])
p = ggplot(data) + geom_bar(aes(x='time', fill='..count..'))
p += scale_fill_hue()
p