Replies: 1 comment
-
I run over and over into the same problem as soon as i try to use nix flakes or devenv.nix to manage the development environment: devenv.nix: { pkgs, lib, config, inputs, ... }: let
in {
languages.python = {
enable = true;
venv.enable = true;
venv.requirements = ''
numpy
'';
};
languages.rust = {
enable = true;
channel = "stable";
};
} rust test: #[test]
fn numpy_import() {
Python::with_gil(|py| {
py.import_bound("numpy").unwrap();
})
} result called `Result::unwrap()` on an `Err` value: PyErr { type: <class 'ImportError'>, value: ImportError('Error importing numpy: you should not try to import numpy from\n its source directory; please exit the numpy source tree, and relaunch\n your python interpreter from there.'), traceback: Some(<traceback object at 0x7ffff6f1af40>) } This is totally unclear what happens here. I can confirm that i run in the test command inside the venv. The venv is able to import numpy correctly when i just run it directly from the interactive python session: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
my code
run the command
PYO3_PYTHON=~/ImageRust/.venv/bin/python cargo r --bin test-path
outpu is
The above is the case when the PYTHONHOME and PYTHONPATH environment variables are not set.
When I set PYTHHOME and PYTHPATH, the output looks like this
My Environmental Information
Beta Was this translation helpful? Give feedback.
All reactions