Issue
I installed pyemd within my virtual environment. However, when I got to Jupyter Notebook or Python within the command line it says ModuleNotFoundError: No module named 'pyemd'
.
. venv-new/bin/activate #activating environment
(venv-new) pip install pyemd #installing pyemd
Output:
Requirement already satisfied: pyemd in ./venv-new/lib/python3.9/site-packages (0.5.1)
Requirement already satisfied: numpy<2.0.0,>=1.9.0 in ./venv-new/lib/python3.9/site-packages (from pyemd) (1.22.3)
Activating Python:
(venv-new) python
Python 3.9.6 (v3.9.6:db3ff76da1, Jun 28 2021, 11:49:53)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyemd
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pyemd'
I have tried solutions such as specifying the path:
(venv-new) Users/path/to/enviro/venv-new/bin/python -m pip install pyemd
I have tried just:
(venv-new) python -m pip install pyemd
and
(venv-new) python3.9 -m pip install pyemd
All these solutions resulted in the same output when activating Python. I can't use sudo since I don't have the proper permissions.
Solution
Thank you to @Wayne for the answer in the comments! I had been using the following command within Jupyter but didn't know it was outdad.
!pip install pyemd
The solution for me was using
%pip install pyemd
Answered By - mjoy Answer Checked By - Mary Flores (WPSolving Volunteer)