Tensorflow is not a package: Installing tensorflow on native windows

Hello , I originally made my python sensorflow program in WSL (Ubunutu) everything works great there. But i will soon need to run the program on a windows machine (inference portion of the code). But i am running into problems with my tensorflow/keras imports

PS C:\Users\myuser\Desktop\Code\APP_GUI> & C:/Users/myuser/miniconda3/envs/tf/python.exe c:/Users/myuser/Desktop/Code/APP_GUI/tensorflow.py
Traceback (most recent call last):
  File "c:\Users\myuser\Desktop\Code\APP_GUI\tensorflow.py", line 14, in <module>
    import tensorflow as tf
  File "c:\Users\myuser\Desktop\Code\APP_GUI\tensorflow.py", line 16, in <module>
    from tensorflow.keras.optimizers import RMSprop
ModuleNotFoundError: No module named 'tensorflow.keras'; 'tensorflow' is not a package

Code portion:

import tensorflow as tf
# print(tf.__version__)
from tensorflow.keras.optimizers import RMSprop
from keras.models import Sequential
from keras.layers import Conv2D, MaxPooling2D,Flatten,Dense
from keras.preprocessing import image
from keras.preprocessing.image import ImageDataGenerator
from PIL import ImageFile

I followed this tensorflow install guide for native windows. I do not need GPU support (but if there is a way to have GPU support on the latest tensorflow version on native windows ill be happy to know it) since i will not do anymore training.

When installing tensor flow i got an error

PS C:\Users\myuser\Desktop\Code\APP_GUI> python -m pip install "tensorflow<2.11"
ERROR: Could not find a version that satisfies the requirement tensorflow<2.11 (from versions: 2.12.0rc0, 2.12.0rc1, 2.12.0, 2.12.1, 2.13.0rc0, 2.13.0rc1, 2.13.0rc2, 2.13.0, 2.13.1, 2.14.0rc0, 2.14.0rc1, 2.14.0, 2.14.1, 2.15.0rc0, 2.15.0rc1, 2.15.0)
ERROR: No matching distribution found for tensorflow<2.11

So i just went ahead and installed tensorflow-cpu instead. and thats when i got the error above,

Name: keras
Version: 2.15.0
Summary: Deep learning for humans.
Home-page: https://keras.io/
Author: Keras team
Author-email: keras-users@googlegroups.com
License: Apache 2.0
Location: C:\Users\myuser\miniconda3\Lib\site-packages
Requires:
Required-by: tensorflow-intel

Name: tensorflow-cpu
Version: 2.15.0
Summary: TensorFlow is an open source machine learning framework for everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: packages@tensorflow.org
License: Apache 2.0
Location: C:\Users\myuser\miniconda3\Lib\site-packages
Requires: tensorflow-intel
Required-by:

I even tried installing just ordinary tensor flow

Name: tensorflow
Version: 2.15.0
Summary: TensorFlow is an open source machine learning framework for everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: packages@tensorflow.org
License: Apache 2.0
Location: C:\Users\myuser\miniconda3\Lib\site-packages
Requires: tensorflow-intel
Required-by:

Running the CPU install verification test also throw the exact same error:

PS C:\Users\myuser\Desktop\Code\APP_GUI> python -c "import tensorflow as tf; print(tf.reduce_sum(tf.random.normal([1000, 1000])))"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\myuser\Desktop\Code\APP_GUI\tensorflow.py", line 16, in <module>
    from tensorflow.keras.optimizers import RMSprop
ModuleNotFoundError: No module named 'tensorflow.keras'; 'tensorflow' is not a package

Can anyone help me what am i doing wrong?

Hi @Drake_Jest, Could please confirm if my understanding is correct, You have trained the model in WSL using tensorflow 2.15 (GPU or CPU) and now you want to make the inference in the native windows using tensorflow 2.15 on CPU.

If my understanding is correct, please provide the steps you have followed to install tensorflow in the native windows. Thank You.