I'm installing playsound pip install playsound
but it keeps saying No module named playsound
and this error occurs on other packages
I'm installing playsound pip install playsound
but it keeps saying No module named playsound
and this error occurs on other packages
On 1/9/2023 9:40 AM, om om wrote:
I'm installing playsound pip install playsound
but it keeps saying No module named playsound
and this error occurs on other packages
Did the installation by pip succeed? if not, what was the error message?
"It keeps saying ...". What keeps saying that (it's not a standard error message from pip)? What is the code or command that causes this error message?
You would get such a message if you tried to import a package but it had
not been installed. If you used pip to install a package and it
succeeded but you could not import the package (or module), the most
likely reason is that it got installed by a different version of python
than the one that used pip to install it. You may have several
different versions of Python on your computer.
You can check versions by running
pip -V
Then use the command you normally use to run Python (i.e., python3, py, etc.) and run
py_x -m pip -V
(don't type "py_x", use the command name you normally use to run python)
If the two outputs are different, then you will know for sure that your packages got installed to a different version of Python. Re-install
them using "python -m pip install" instead of "pip install" - again,
make sure that you use the actual name for the python command that you normally use.
I wrote
"the most likely reason is that it got installed by a different
version of python than the one that used pip to install it."
That's not quite what I meant to say. Better:
"the most likely reason is that you are trying to import it using a
different version of python than the one that used pip to install it."
On 1/9/2023 11:59 AM, Mats Wichmann wrote:
On 1/9/23 08:30, Thomas Passin wrote:
On 1/9/2023 9:40 AM, om om wrote:
I'm installing playsound pip install playsound
but it keeps saying No module named playsound
and this error occurs on other packages
Did the installation by pip succeed? if not, what was the error message? >>>
"It keeps saying ...". What keeps saying that (it's not a standard
error message from pip)? What is the code or command that causes this
error message?
You would get such a message if you tried to import a package but it
had not been installed. If you used pip to install a package and it
succeeded but you could not import the package (or module), the most
likely reason is that it got installed by a different version of
python than the one that used pip to install it. You may have several
different versions of Python on your computer.
You can check versions by running
pip -V
As described in this reply, but to be more explicit: if a package
installed wtihout error, and then you can't import it in Python, it's
basically always a path problem.
Invoking pip the same way as you did to install, do:
pip show playsound
This will tell you where it put it. If that's not a place your Python is
looking, it won't find it.
Then use the command you normally use to run Python (i.e., python3,
py, etc.) and run
py_x -m pip -V
(don't type "py_x", use the command name you normally use to run python) >>>
If the two outputs are different, then you will know for sure that
your packages got installed to a different version of Python.
Re-install them using "python -m pip install" instead of "pip install"
- again, make sure that you use the actual name for the python command
that you normally use.
"the most likely reason is that it got installed by a different
version of python than the one that used pip to install it."
On 1/9/23 08:30, Thomas Passin wrote:
On 1/9/2023 9:40 AM, om om wrote:
I'm installing playsound pip install playsound
but it keeps saying No module named playsound
and this error occurs on other packages
Did the installation by pip succeed? if not, what was the error message?
"It keeps saying ...". What keeps saying that (it's not a standard
error message from pip)? What is the code or command that causes this
error message?
You would get such a message if you tried to import a package but it
had not been installed. If you used pip to install a package and it
succeeded but you could not import the package (or module), the most
likely reason is that it got installed by a different version of
python than the one that used pip to install it. You may have several
different versions of Python on your computer.
You can check versions by running
pip -V
As described in this reply, but to be more explicit: if a package
installed wtihout error, and then you can't import it in Python, it's basically always a path problem.
Invoking pip the same way as you did to install, do:
pip show playsound
This will tell you where it put it. If that's not a place your Python is looking, it won't find it.
Then use the command you normally use to run Python (i.e., python3,
py, etc.) and run
py_x -m pip -V
(don't type "py_x", use the command name you normally use to run python)
If the two outputs are different, then you will know for sure that
your packages got installed to a different version of Python.
Re-install them using "python -m pip install" instead of "pip install"
- again, make sure that you use the actual name for the python command
that you normally use.
On Windows it's best to use pip via the Python Launcher:
py -m pip show playsound
On 1/9/23, MRAB <python@mrabarnett.plus.com> wrote:
On Windows it's best to use pip via the Python Launcher:
py -m pip show playsound
Python's app distribution on the Microsoft Store doesn't include the
py launcher, and we don't (but should) have a standalone app or
desktop version of the launcher. Unlike the desktop distribution,
however, the app distribution installs a versioned name as a link,
such as "python3.11". (Note that a venv virtual environment only has a "python" command on Windows.)
If "pip" is in PATH, a versioned name such as "pip3.11" should also be available. If multiple versions of the app distribution are installed,
and for some reason the "python" and "pip" links are mapped to
different versions, one can match up the versioned names "pip3.11" and "python3.11" to ensure consistency. Or simply run "python -m pip".
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 446 |
Nodes: | 16 (2 / 14) |
Uptime: | 19:36:17 |
Calls: | 9,234 |
Calls today: | 1 |
Files: | 13,496 |
Messages: | 6,063,226 |