以下是我在WSL失败之前完成的步骤:
**注意:**使用Python 3.11和rustc 1.74.0-nightly
git clone [email protected]:<username>/polars.git
cd polars
rustup toolchain install nightly --component miri
cd py-polars
make test
日志非常冗长,下面是最新的几行日志:
🍹 Building a mixed python/rust project
🔗 Found pyo3 bindings with abi3 support for Python ≥ 3.8
🐍 Not using a specific python interpreter
Ignoring adbc_driver_sqlite: markers 'extra == "adbc"' don't match your environment
Ignoring cloudpickle: markers 'extra == "cloudpickle"' don't match your environment
Ignoring connectorx: markers 'extra == "connectorx"' don't match your environment
Ignoring deltalake: markers 'extra == "deltalake"' don't match your environment
Ignoring fsspec: markers 'extra == "fsspec"' don't match your environment
Ignoring gevent: markers 'extra == "gevent"' don't match your environment
Ignoring matplotlib: markers 'extra == "matplotlib"' don't match your environment
Ignoring numpy: markers 'extra == "numpy"' don't match your environment
Ignoring openpyxl: markers 'extra == "openpyxl"' don't match your environment
Ignoring pyarrow: markers 'extra == "pandas"' don't match your environment
Ignoring pandas: markers 'extra == "pandas"' don't match your environment
Ignoring pyarrow: markers 'extra == "pyarrow"' don't match your environment
Ignoring pydantic: markers 'extra == "pydantic"' don't match your environment
Ignoring pyiceberg: markers 'extra == "pyiceberg"' don't match your environment
Ignoring pyxlsb: markers 'extra == "pyxlsb"' don't match your environment
Ignoring sqlalchemy: markers 'extra == "sqlalchemy"' don't match your environment
Ignoring pandas: markers 'extra == "sqlalchemy"' don't match your environment
Ignoring backports.zoneinfo: markers 'python_version < "3.9" and extra == "timezone"' don't match your environment
Ignoring tzdata: markers 'platform_system == "Windows" and extra == "timezone"' don't match your environment
Ignoring xlsx2csv: markers 'extra == "xlsx2csv"' don't match your environment
Ignoring xlsxwriter: markers 'extra == "xlsxwriter"' don't match your environment
Ignoring polars: markers 'extra == "all"' don't match your environment
Compiling py-polars v0.19.6 (/home/user/projects/polars/py-polars)
error: linking with `cc` failed: exit status: 1
|
= note: LC_ALL="C" PATH="/home/user/.rustup/toolchains/nightly-2023-08-26-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/home/user/projects/polars/.venv/bin:/home/user/.pyenv/plugins/pyenv-virtualenv/shims:/home/user/.pyenv/shims:/
....
"-Wl,-Bdynamic" "-ldl" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/home/user/.rustup/toolchains/nightly-2023-08-26-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/user/projects/polars/py-polars/target/debug/deps/libpolars.so" "-Wl,--gc-sections" "-shared" "-Wl,-z,relro,-z,now" "-nodefaultlibs"
= note: collect2: fatal error: ld terminated with signal 9 [Killed]
compilation terminated.
error: could not compile `py-polars` (lib) due to previous error
💥 maturin failed
Caused by: Failed to build a native library through cargo
Caused by: Cargo build finished with "exit status: 101": `PYO3_ENVIRONMENT_SIGNATURE="cpython-3.11-64bit" PYO3_PYTHON="/home/user/projects/polars/.venv/bin/python" PYTHON_SYS_EXECUTABLE="/home/user/projects/polars/.venv/bin/python" "cargo" "rustc" "--message-format" "json-render-diagnostics" "--manifest-path" "/home/user/projects/polars/py-polars/Cargo.toml" "--lib"`
make: *** [Makefile:23: build] Error 1
有关操作系统的更多细节,我在Windows 11上使用WSL(ubuntu 20.04)。
1条答案
按热度按时间u5i3ibmn1#
正如@kmdreko所建议的那样,这是一个内存不足的问题。
我需要深入研究WSL允许的默认最大RAM,我发现它默认为Windows总内存的50%或8 GB。
我的电脑只有8 GB的RAM可用,所以在WSL上我默认没有超过4GB的RAM。
我通过在Windows Home文件夹(
C:\Users\<UserName>
)中创建.wslconfig
文件并向其中写入以下内容来修复此问题:然后,
make test
命令成功完成。