-
Hi all!, I'm too confused with this. As I know, actually when you run a #This will fails with no numpy module, in a try will trigger the catch
import numpy
setup(
...
setup_requires(["numpy"]),
...
)
#This one will works fine
import numpy In the case we try to import something before declare it in But... for some reason, doing that on a Debian or Ubuntu distributions this behavior changes, and the imports are allowed without take in consideration I'm very confused with that... can someone explain why plis? Thx! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
I am not sure if I understood your question/example. What is the "catch" that is being triggered? I imagine that if you have an import statement in the beginning of the file and the package is not installed, the entire script should fail, right? Maybe the difference between the distros is the presence of If you want to investigate that further could you please provide a complete (minimal) reproducer, including all the steps to reproduce the problem starting from scratch? If you can make it using a docker container as runtime that would be even better; otherwise a fresh virtual environment would be recommended. Regardless, please avoid using I don't know if you are running |
Beta Was this translation helpful? Give feedback.
-
Oks, lets do with step by step: In Gentoo:
Write this: from setuptools import setup
import numpy
setup() Now:
This fails with:
Which is fine, because there is no While in ubuntu this happens:
is installed correctly.... I don't know why the differences... In the first example:
In the second one:
I also try upgrading setuptools to 68.0.0, but was the same, the module was installed correcly. Why is that difference? |
Beta Was this translation helpful? Give feedback.
Ah, this pypa/pip#10717 is probably the reason for the fallback.