diff --git a/conans/client/conan_api.py b/conans/client/conan_api.py
index d96725350..96a7b5744 100644
--- a/conans/client/conan_api.py
+++ b/conans/client/conan_api.py
@@ -111,25 +111,32 @@ def _get_conanfile_path(path, cwd, py):
     """
     param py= True: Must be .py, False: Must be .txt, None: Try .py, then .txt
     """
+    candidate_paths = list()
     path = _make_abs_path(path, cwd)
 
     if os.path.isdir(path):  # Can be a folder
         if py:
             path = os.path.join(path, "conanfile.py")
+            candidate_paths.append(path)
         elif py is False:
             path = os.path.join(path, "conanfile.txt")
+            candidate_paths.append(path)
         else:
             path_py = os.path.join(path, "conanfile.py")
+            candidate_paths.append(path_py)
             if os.path.exists(path_py):
                 path = path_py
             else:
                 path = os.path.join(path, "conanfile.txt")
+                candidate_paths.append(path)
+    else:
+        candidate_paths.append(path)
 
     if not os.path.isfile(path):  # Must exist
-        raise ConanException("Conanfile not found: %s" % path)
+        raise ConanException("Conanfile not found at %s" % " or ".join(candidate_paths))
 
     if py and not path.endswith(".py"):
-        raise ConanException("A conanfile.py is needed (not valid conanfile.txt)")
+        raise ConanException("A conanfile.py is needed, " + path + " is not acceptable")
 
     return path
 

Error message when no conanfile was found is confusing
When no conanfile is found, a message such as 
```
ERROR: Conanfile not found: D:\Foo\conanfile.txt
```
is displayed. There is no reference to a conanfile.py that was considered (and is also missing).

To help us debug your issue please explain:

- [x] I've read the [CONTRIBUTING guide](https://raw.githubusercontent.com/conan-io/conan/develop/.github/CONTRIBUTING.md).
- [x] I've specified the Conan version, operating system version and any tool that can be relevant.
- [x] I've explained the steps to reproduce the error or the motivation/use case of the question/suggestion.


diff --git a/conans/test/command/package_test.py b/conans/test/command/package_test.py
index 2106dc342..7f00d26bc 100644
--- a/conans/test/command/package_test.py
+++ b/conans/test/command/package_test.py
@@ -1,11 +1,11 @@
+import os
 import unittest
 
 from conans import tools
-from conans.test.utils.tools import TestClient
-import os
 from conans.paths import CONANFILE
-from conans.util.files import load, mkdir
 from conans.test.utils.test_files import temp_folder
+from conans.test.utils.tools import TestClient
+from conans.util.files import load, mkdir
 from parameterized import parameterized
 
 
@@ -70,14 +70,16 @@ class PackageLocalCommandTest(unittest.TestCase):
         error = client.run("package conanfile.txt --build-folder build2 --install-folder build",
                            ignore_error=True)
         self.assertTrue(error)
-        self.assertIn("A conanfile.py is needed (not valid conanfile.txt)", client.out)
+        self.assertIn(
+            "A conanfile.py is needed, %s is not acceptable" % os.path.join(client.current_folder, "conanfile.txt"),
+            client.out)
 
         # Path with wrong conanfile path
         error = client.run("package not_real_dir/conanfile.py --build-folder build2 --install-folder build",
                            ignore_error=True)
         self.assertTrue(error)
-        self.assertIn("Conanfile not found: %s" % os.path.join(client.current_folder, "not_real_dir",
-                                                               "conanfile.py"), client.out)
+        self.assertIn("Conanfile not found at %s" % os.path.join(client.current_folder, "not_real_dir",
+                                                                 "conanfile.py"), client.out)
 
     def package_with_reference_errors_test(self):
         client = TestClient()
diff --git a/conans/test/command/source_test.py b/conans/test/command/source_test.py
index 9fdba512b..a0e98dbac 100644
--- a/conans/test/command/source_test.py
+++ b/conans/test/command/source_test.py
@@ -93,14 +93,16 @@ class ConanLib(ConanFile):
         # Path with conanfile.txt
         error = client.run("source conanfile.txt --install-folder subdir", ignore_error=True)
         self.assertTrue(error)
-        self.assertIn("A conanfile.py is needed (not valid conanfile.txt)", client.out)
+        self.assertIn(
+            "A conanfile.py is needed, %s is not acceptable" % os.path.join(client.current_folder, "conanfile.txt"),
+            client.out)
 
         # Path with wrong conanfile path
         error = client.run("package not_real_dir/conanfile.py --build-folder build2 --install-folder build",
                            ignore_error=True)
         self.assertTrue(error)
-        self.assertIn("Conanfile not found: %s" % os.path.join(client.current_folder, "not_real_dir",
-                                                               "conanfile.py"), client.out)
+        self.assertIn("Conanfile not found at %s" % os.path.join(client.current_folder, "not_real_dir",
+                                                                 "conanfile.py"), client.out)
 
     def source_local_cwd_test(self):
         conanfile = '''
diff --git a/conans/test/command/test_package_test.py b/conans/test/command/test_package_test.py
index ce09f0238..050e78d4a 100644
--- a/conans/test/command/test_package_test.py
+++ b/conans/test/command/test_package_test.py
@@ -109,14 +109,16 @@ class ConanLib(ConanFile):
         # Path with conanfile.txt
         error = client.run("test conanfile.txt other/0.2@user2/channel2", ignore_error=True)
         self.assertTrue(error)
-        self.assertIn("A conanfile.py is needed (not valid conanfile.txt)", client.out)
+        self.assertIn(
+            "A conanfile.py is needed, %s is not acceptable" % os.path.join(client.current_folder, "conanfile.txt"),
+            client.out)
 
         # Path with wrong conanfile path
         error = client.run("test not_real_dir/conanfile.py other/0.2@user2/channel2",
                            ignore_error=True)
         self.assertTrue(error)
-        self.assertIn("Conanfile not found: %s" % os.path.join(client.current_folder, "not_real_dir",
-                                                               "conanfile.py"), client.out)
+        self.assertIn("Conanfile not found at %s" % os.path.join(client.current_folder, "not_real_dir",
+                                                                 "conanfile.py"), client.out)
 
     def build_folder_handling_test(self):
         test_conanfile = '''

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest pytest-cov
apt-get update apt-get install -y gcc
3.6
conans/requirements.txt conans/requirements_server.txt conans/requirements_dev.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
astroid==2.11.7
attrs==22.2.0
beautifulsoup4==4.12.3
bottle==0.12.25
certifi==2021.5.30
charset-normalizer==2.0.12
codecov==2.1.13
colorama==0.3.9
-e git+https://github.com/conan-io/conan.git@9a9a0c4c84b89ce29fa9a5695ba544584d27dd69#egg=conan
coverage==4.2
deprecation==2.0.7
dill==0.3.4
distro==1.1.0
fasteners==0.19
future==0.16.0
idna==3.10
importlib-metadata==4.8.3
iniconfig==1.1.1
isort==5.10.1
lazy-object-proxy==1.7.1
mccabe==0.7.0
mock==1.3.0
node-semver==0.2.0
nose==1.3.7
packaging==21.3
parameterized==0.8.1
patch==1.16
pbr==6.1.1
platformdirs==2.4.0
pluggy==1.0.0
pluginbase==0.7
py==1.11.0
Pygments==2.14.0
PyJWT==1.7.1
pylint==2.13.9
pyparsing==3.1.4
pytest==7.0.1
pytest-cov==4.0.0
PyYAML==3.13
requests==2.27.1
six==1.17.0
soupsieve==2.3.2.post1
tomli==1.2.3
typed-ast==1.5.5
typing_extensions==4.1.1
urllib3==1.26.20
waitress==2.0.0
WebOb==1.8.9
WebTest==2.0.35
wrapt==1.16.0
zipp==3.6.0

name: conan
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - astroid==2.11.7
      - attrs==22.2.0
      - beautifulsoup4==4.12.3
      - bottle==0.12.25
      - charset-normalizer==2.0.12
      - codecov==2.1.13
      - colorama==0.3.9
      - coverage==4.2
      - deprecation==2.0.7
      - dill==0.3.4
      - distro==1.1.0
      - fasteners==0.19
      - future==0.16.0
      - idna==3.10
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - isort==5.10.1
      - lazy-object-proxy==1.7.1
      - mccabe==0.7.0
      - mock==1.3.0
      - node-semver==0.2.0
      - nose==1.3.7
      - packaging==21.3
      - parameterized==0.8.1
      - patch==1.16
      - pbr==6.1.1
      - platformdirs==2.4.0
      - pluggy==1.0.0
      - pluginbase==0.7
      - py==1.11.0
      - pygments==2.14.0
      - pyjwt==1.7.1
      - pylint==2.13.9
      - pyparsing==3.1.4
      - pytest==7.0.1
      - pytest-cov==4.0.0
      - pyyaml==3.13
      - requests==2.27.1
      - six==1.17.0
      - soupsieve==2.3.2.post1
      - tomli==1.2.3
      - typed-ast==1.5.5
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - waitress==2.0.0
      - webob==1.8.9
      - webtest==2.0.35
      - wrapt==1.16.0
      - zipp==3.6.0
prefix: /opt/conda/envs/conan

conans/test/command/test_package_test.py::TestPackageTest::test_with_path_errors_test
conans/test/command/test_package_test.py::TestPackageTest::test_only_test
conans/client/conan_api.py
conans/client/conan_api.py