ModuleNotFoundError: No module named 'Paramiko'
Mats Wichmann
mats at wichmann.us
Tue Apr 9 09:50:12 EDT 2024
On 4/7/24 19:31, Wenyong Wei via Python-list wrote:
>
> Dear Sir/Madam,
>
> Recently I encounter a problem that I can't import paramiko in my computer. My PC running on window 10 64 bits. I have investigate this issue via internet, there are a lot of solutions for this issue, after trying most of the steps, I still can't run this module, the major steps I have try are:
>
>
> 1.
> Install python ver 3.7.1 or 3.11.8 by itself or customer installation (changing the installation folder) and check add python to the path.
> 2.
> pip install paramiko, if ver 3.7.1 installed, need to upgrade the pip version.
> 3.
> Checking the environment path, there are two path related to the python, one for python.exe, the other for \Lib\site-packages\paramiko
>
> can you please provide advice on this issue?
Going to be more explicit than the other answers:
===
If an attempted import gives you ModuleNotFound, that *always* means the
package is not installed... not at all, or just not in the paths that
copy of Python is looking in.
===
The problem arises in part because most package installation
instructions take the simplest approach and just tell you to (for example)
pip install paramiko
So it's installed. But where did it go? You can check where it went:
pip show paramiko
That path ("location") needs to be one where your Python interpreter is
looking.
If all goes well, "pip" and "python" are perfectly matched, but in the
current world, there are often several Python interpreters installed
(projects may require a specific version, an IDE may grab its own
version, something may create and setup a virtualenv, alternate worlds
like Conda may set up a Python, the list goes on), and for any given
installation on Windows, python.exe and the pip excutable pip.exe go in
different directories anyway, and the Windows PATH doesn't always
include both, and you easily get mismatches.
As others have said, the way to avoid mismatches is to use pip As A
Module, specifically a module of the Python you want to use. So if
you're using the Python Launcher, that looks like:
py -m pip install paramiko
Hope this helps.
More information about the Python-list
mailing list