#๐Ÿ”’ numpy error while running python with poetry

5 messages ยท Page 1 of 1 (latest)

midnight path
#

so im tryiing to run a python script on my server, but i get an error from numpy

poetry run python3.12 src/main.py 
The currently activated Python version 3.11.9 is not supported by the project (^3.12).
Trying to find and use a compatible version. 
Using python3.12 (3.12.4)
Traceback (most recent call last):
  File "/media/projects/project/src/main.py", line 12, in <module>
    import pandas as pd
  File "/home/eltala/.cache/pypoetry/virtualenvs/project-XBhAMzVK-py3.12/lib/python3.12/site-packages/pandas/__init__.py", line 19, in <module>
    raise ImportError(
ImportError: Unable to import required dependencies:
numpy: Error importing numpy: you should not try to import numpy from
        its source directory; please exit the numpy source tree, and relaunch
        your python interpreter from there.
brittle locustBOT
#

@midnight path

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

spark locust
#

Further context:

  • running on nixos
  • tried python312 through nix-shell and configuration.nix
  • version python3.12 set using poetry env
brittle locustBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.