I installed a package in my notebook by running in a cell the following command:
!pip install packagename
but when I try to import the package, I'm getting the following error:
import packagename as pn
--> ModuleNotFoundError: No module named 'packagename'
I don't change my kernel between these commands, and also it seems installed correctly since running the install command again detects the installed package. I also tried re-installing it without success. What am I missing here?
To install any package on windows
pip install packagename
MacOS
python3 -m pip install packagename
Linux
sudo apt-get install packagename
Related
I am recently having problems with installing rediscluster. When I run pip install rediscluster, it runs it fine, but after a second, it just shows error ModuleNotFoundError: No module named 'redis._compat'. I have tried running pip install rediscompat, pip install redis.compat, pip install redis._compat and pip install redis_compat, but none of them worked. Anyone know how to get redis._compat?
I appreciate any help! Thanks
I tried running these commands:
pip install rediscompat, pip install redis.compat, pip install redis.\_compat and pip install redis_compat
And this was the result:
ModuleNotFoundError: No module named 'redis._compat'
And I expected this:
(not actually the result, but this is what I expected to happen) Successfully installed rediscluster and many other modules. I have not seen the result, but I atleast think that this would be the result.
I run in the magenta environment on my iMac the python file and I get the error:
ModuleNotFoundError: No module named 'magenta.protobuf'
Though I have tried:
pip install protobuf
pip3 install protobuf
pip install protobuf-compiler
pip3 install protobuf-compiler
Could anyone please help?
you can try this:
pip install note-seq
then
import note_seq.protobuf
I have installed OpenCv library through this line "pip install opencv-python" and it is successfully installed, but I am trying to import it through: "import cv2" and it gives me an error:
ModuleNotFoundError: No module named 'cv2'
please help me!
If your pip is installed with any other python version than conda, it won't work.
Option 1) Install pip with conda python
Run conda create -n venv_name and source activate venv_name, where venv_name is the name of your virtual environment.
Run conda install pip. This will install pip to your venv directory.
Option 2) Run conda install opencv
Even after I have installed the module texttable, I am getting this error.
Since you are using Jupyter, to ensure you are installing the module in the correct python environment, can you try below command in the next Jupyter cell?
!pip install texttable
Download and install pip
Then install texttable calling pip install texttable
I installed TFTPy with both pip and pip3.
Then i followed the example on the TFTPy documentation, which follows:
import tftpy
server = tftpy.TftpServer('/tftpboot')
server.listen('0.0.0.0', 69)
But I get the error
ImportError: No module named tftpy
I also tried using from tftpy import tftpy. I tried using Python 2, Python 2.7 and Python 3, but still get the same error.
All help is appreciated
You can install tftpy by using command pip install tftpy. In case you do not have pip on your device, use the following commands:
yum -y install python-pip
pip install --upgrade pip
pip install tftpy