I have installed Poetry via the official shell script. I have by now also reinstalled it several times. which poetry
returns /home/myuser/.local/bin/poetry
. The Poetry version is 2.1.1. The python versions are managed by Pyenv.
When I set up an empty project, I can use poetry without any issues. But if I try to do poetry install
on an existing project that I pull from github, it responds with No module named 'numpy'
. This is the response I get no matter which command I try, even poetry --version
returns the same error.
This has happened on any existing project I have tried. It's not a packaging error - Poetry doesn't get far enough to even try to install packages. I have gone through everything I could find online, it doesn't seem like this error has been discussed before.
I have installed Poetry via the official shell script. I have by now also reinstalled it several times. which poetry
returns /home/myuser/.local/bin/poetry
. The Poetry version is 2.1.1. The python versions are managed by Pyenv.
When I set up an empty project, I can use poetry without any issues. But if I try to do poetry install
on an existing project that I pull from github, it responds with No module named 'numpy'
. This is the response I get no matter which command I try, even poetry --version
returns the same error.
This has happened on any existing project I have tried. It's not a packaging error - Poetry doesn't get far enough to even try to install packages. I have gone through everything I could find online, it doesn't seem like this error has been discussed before.
Share Improve this question asked Mar 17 at 10:57 DarinaDarina 1,63210 silver badges19 bronze badges 3 |1 Answer
Reset to default 0Solved - the issue was never directly with poetry
or with pyproject.toml
. Every repo I tried to install also contained a build.py
file that imported numpy first. Poetry runs this before anything else, hence the error was generated. The solution was to modify build.py
so that it does not import at the top level.
poetry --version
also breaks and that's not reliant on anything contained in the pyproject.toml file – Darina Commented Mar 17 at 13:00