Poetry Installed TensorFlow, but Python Says 'ModuleNotFoundError: No module named tensorflow' - Stack Overflow

tensorflow python package installed using poetry is not recognised within python. (poetry version - 2.0

tensorflow python package installed using poetry is not recognised within python. (poetry version - 2.0.1)

Anyone else facing this issue? and how did you solve them?

C:\Users\username\Documents\folder>poetry add tensorflow

Using version ^2.18.0 for tensorflow

Updating dependencies Resolving dependencies... (0.9s)

Package operations: 18 installs, 0 updates, 0 removals

  • Installing markupsafe (3.0.2)
  • Installing grpcio (1.70.0)
  • Installing markdown (3.7)
  • Installing protobuf (5.29.3)
  • Installing setuptools (75.8.0)
  • Installing tensorboard-data-server (0.7.2)
  • Installing werkzeug (3.1.3)
  • Installing wheel (0.45.1)
  • Installing astunparse (1.6.3)
  • Installing gast (0.6.0)
  • Installing libclang (18.1.1)
  • Installing opt-einsum (3.4.0)
  • Installing google-pasta (0.2.0)
  • Installing flatbuffers (25.1.24)
  • Installing termcolor (2.5.0)
  • Installing tensorboard (2.18.0)
  • Installing wrapt (1.17.2)
  • Installing tensorflow (2.18.0)

Writing lock file

C:\Users\username\Documents\folder>poetry run python

Python 3.12.8 (tags/v3.12.8:2dc476b, Dec  3 2024, 19:30:04) [MSC v.1942 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'tensorflow'

tensorflow python package installed using poetry is not recognised within python. (poetry version - 2.0.1)

Anyone else facing this issue? and how did you solve them?

C:\Users\username\Documents\folder>poetry add tensorflow

Using version ^2.18.0 for tensorflow

Updating dependencies Resolving dependencies... (0.9s)

Package operations: 18 installs, 0 updates, 0 removals

  • Installing markupsafe (3.0.2)
  • Installing grpcio (1.70.0)
  • Installing markdown (3.7)
  • Installing protobuf (5.29.3)
  • Installing setuptools (75.8.0)
  • Installing tensorboard-data-server (0.7.2)
  • Installing werkzeug (3.1.3)
  • Installing wheel (0.45.1)
  • Installing astunparse (1.6.3)
  • Installing gast (0.6.0)
  • Installing libclang (18.1.1)
  • Installing opt-einsum (3.4.0)
  • Installing google-pasta (0.2.0)
  • Installing flatbuffers (25.1.24)
  • Installing termcolor (2.5.0)
  • Installing tensorboard (2.18.0)
  • Installing wrapt (1.17.2)
  • Installing tensorflow (2.18.0)

Writing lock file

C:\Users\username\Documents\folder>poetry run python

Python 3.12.8 (tags/v3.12.8:2dc476b, Dec  3 2024, 19:30:04) [MSC v.1942 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'tensorflow'
Share Improve this question edited Feb 3 at 4:17 explorer asked Feb 3 at 3:13 explorerexplorer 1411 silver badge7 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 2

tensorflow-intel has not been installed, which since you are on windows it should be.

Please go to https://github/tensorflow/tensorflow/issues/75415 and encourage the tensorflow folk to put consistent metadata in all of their wheels so that cross-platform resolvers like poetry and uv can reliably derive accurate information.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745250772a4618665.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信