ModuleNotFoundError: No module named 'cookiecutter' - cookiecutter

Just upgraded my Mac to macOS Monterey 12.6, I am trying to use the python to create a project from a cookiecutter, throws this error:
ModuleNotFoundError: No module named 'cookiecutter'

The question has been solved
python3 -m pip install --upgrade pip
python3 -m pip install --user cookiecutter

Related

Unable to install pyserial

PI3B, Buster.
I have installed both python3 and pip3 but when I use pip3 to install pyserial I get a no module error. The wrong directory is being used. How can I fix it please? volumio#pnbvolumio:~$ sudo python -m pip3 install pyserial /usr/bin/python3: No module named pip3 volumio#pnbvolumio:~$ pip3 --version pip 18.1 from /usr/lib/python3/dist-packages/pip (python 3.7)
Using pip with sudo is not a good idea.
Read more here
Try to install pyserial using this command:
python3 -m pip install pyserial
You can also try to instal it for current user only:
python3 -m pip install pyserial --user
Also consider using virtual environmet to manage multiple environments and hassle free module managing.

pip installs modules for python 2.7

I want to install a module with pip, in my case pydub.
However pip install pydub installs pydub in /home/<user>/.local/lib/python2.7/
So when I run my script
python3 myScript.py
it tells me
ModuleNotFoundError: No module named 'pydub'
How do I get pip to install pydub for 3.x rather than 2.7?
Use pip3 install xxx, or better yet, python3 -m pip install xxx. The problem here is that by default pip is aliased to python2's installation.

ImportError: No module named jupyter_core.command

After I uninstalled all python and reinstalled it again jupyter notebook does not work. I have tried:
pip3 install jupyter notebook
pip3 install jupyter
pip3 install notebook
pip3 install jupyterlab
pip3 install ipython
and the pip3 install --user and the pip and pip --user version of all above and still when i type
$ jupyter notebook
in my terminal i get the error
ImportError: No module named jupyter_core.command
i am on mac if that has something to do with it.
thank you
Installed anaconda and it is now magically fixed

pip install not working -- How to install/upgrade PyPi packages with pip v10 and above, using Python?

After upgrading my pip to version 10 using pip3 install --upgrade pip and above I cannot I want to install/upgrade PyPi packages using pip3 install PyPiPackageName as I get the following error:
from pip import main
ImportError: cannot import name main
I wonder how I can install PyPi packages using pip when I'm using new versions of pip? I've seen some people use pyhton3 to do this but doing python3 -m pip install --upgrade pip gave me the following error and I cannot upgrade pip to higher versions:
/usr/bin/python3: No module named pip
Before doing python3 -m pip install --upgrade pip I do python3 -m pip install -U pip and I get the following error:
/usr/bin/python3: No module named pip
So I'm confused on what I need to do to be able to upgrade or install PyPi packages.
In addition to executing the following:
curl https://bootstrap.pypa.io/get-pip.py | python3.6
I also had to make sure python3 is using Python 3.6 otherwise Python 3.5 is used (which does not come with pip by default). So I did the following and things work fine now:
ln -s /usr/bin/python3.6 /usr/local/bin/python3

Dead Jupyter Kernel with python3

I am trying to use jupyter notebook with python3. Then I added the kernel with
python3 -m pip install ipykernel
python3 -m ipykernel install --user
But when I start a notebook it shows a Dead kernel message, and the terminal shows
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'
If I choose python2 kernel it works well. I can run python command in console without any issue.
Try
python3 -m pip install --upgrade pip
python3 -m pip install jupyter
jupyter notebook
It worked for me.

Resources