Run the test on your machine:
pytest slow.py
Results:
python3 -m venv env # create Python env locally in your project folder
source env/bin/activate # activate
which python # what python are you using
deactivate # leave the local python env
python3 -m pip install -r requirements.txt # install libs from requirements.txt
export PYTHONPATH="${PYTHONPATH}:/home/rust/.local/bin"
Step 1 and 2 is automated by SH script ./build_and_copy_bin.sh
- build rust project in ./pyext-rustlib
cargo build --release
- copy rust library into Python folder
/rusted-python$ cp pyext-rustlib/target/release/librustlib.so rustlib.so
- import rustlib # and use it as any other Python library
error: linker cc not found
->
sudo apt-get update
sudo apt install build-essential
