Not too sure what you're asking. But it sounds like the answer is to bind your key in the major mode's keymap, not in the global-map.
For example, if the keymap for your Python mode is python-mode-map then do this:
(define-key python-mode-map (kbd "C-x C-e") 'python-shell-send-region)
I think this might be close to what you want:
The next-import function leverages font lock to dynamically add these keywords. Then, we add a hook function that runs that.
(defun next-import (limit)
(when (re-search-forward "from \\(\\w+\\) import \\(\\w+\\)" limit t)
`((,(regexp-quote (match-string 2)) 0 font-...
AFAIU that warning only realizes if you call TAB at the end of a symbol, which will try completion.
It's just a warning. If Python3's module pyreadline is not installed. Emacs' own completion will not work in Python3. This warning would not happen if native completion for Python3 is disabled as a member of python-shell-completion-native-disabled-...
Provided that you added the paths to your conda install in Windows' environment variables [*], the following should work :
M-x shell in Emacs
In the shell, run conda activate base. This will load the environment and allow you to use the libraries (like numpy).
In the same shell, run python -i (or ipython -i). The -i forces a prompt. Without it, the shell ...