Skip to content

Troubleshooting

REMitchell edited this page Oct 11, 2022 · 14 revisions

I get a message like: "Pip is not recognized as an internal or external command, operable program or batch file." or "command not found: pip"

I recommend installing pip by downloading the file "get-pip.py" and running it with python get-pip.py See instructions here: https://pip.pypa.io/en/stable/installation/#get-pip-py

I get a message like "'jupyter' is not recognized as an internal or external command" or "command not found: jupyter"

Try running jupyter with python -m notebook instead (on Macs, you may need to use "python3")

When typing the command: "cd Documents/GitHub/python-essential-training..." I get a message like "No such file or directory"

Make sure you are using the file path on your computer that you downloaded the exercise files to, and not copying exactly what was written in the course video! You have probably downloaded the exercise files to a different path than I did.

I get a message like "xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install"

You are missing xcode developer tools on your mac. Run xcode-select --install from the terminal command line

I cannot locate the exercise files or don't know where the files are downloaded to

On both Windows and Macs, files are typically downloaded to your "Downloads" folder. If you navigate to the file, you should be able to right-click and select "Get Info" which should show you the full file path.

I installed termcolor, but get an error "No module named termcolor"

You may have accidentally installed it under a different version of Python than you're currently using to run your program. On macs, you will likely need to use pip3 to install termcolor, and then the corresponding python3 to run programs.

When running jupyter notebook, I get an error like ".ipynb is not trusted"

This can happen when the exercise files you downloaded are "untrusted" and aren't allowed to execute random Python code on your computer. If you choose to trust the exercise files (and please do!), run the command jupyter trust *.ipynb in the exercise files directory.

When running jupyter notebook, I get an error like "command not found:py"

I have not personally seen this error, but one user had some success by upgrading pip to the latest version. If you experience this error, please let me know!

You get a "SyntaxError: invalid syntax" or "NameError: name 'pip' is not defined"

Exit the Python terminal. You should not be seeing >>> when you entering "pip install" commands -- they are not Python code! Make sure you are typing "pip install" directly in your Windows or Mac command terminal.

You installed Jupyter successfully with pip, but get the error "'jupyter' is not recognized as an internal or external command, operable program or batch file"

This may be a case of Windows not being able to "find" Jupyter after it's installed. Follow Step 2 here: https://technolads.com/jupyter-is-not-recognized-as-an-internal-or-external-command/ You can find out where your Python installation is by using the command where python in the terminal. Make sure that you put the path up to the "/scripts" folder under your Python installation!

"ERROR: Could not build wheels for psutil, which is required to install pyproject.toml-based projects"

This can happen when you have a new M1 Mac. Download the latest version of Mambaforge for MacOSX arm64 here: https://conda-forge.org/miniforge/

Install conda by running ./Mambaforge-4.12.0-2-MacOSX-arm64.sh

You may need to change the permissions on the file to be able to run it chmod 755 Mambaforge-4.12.0-2-MacOSX-arm64.sh

Run the file ./Mambaforge-4.12.0-2-MacOSX-arm64.sh

Press enter to continue

image

Type "yes" and hit enter to continue

image

Type "yes" and hit enter to continue

image

Close the terminal and re-open it.

You should have the conda command installed. Use conda install notebook to install Jupyter

Jupyter Notebooks just won't work!

Using Visual Studio Code instead of installing Jupyter

Good news: Visual Studio Code is free, works excellently on Windows and Macs, and it can run Jupyter notebook files! https://code.visualstudio.com/ There are some other fixes in this document, but if you're not picky about what the files look like and where they're run, opening them in Visual Studio is a great workaround!

Using Conda to install Jupyter notebooks

Do you have a problem that hasn't been answered here or on the web? Tired of trying this with pip? There is another method of installing packages, including Jupyter notebooks. See: https://www.linkedin.com/learning/introducing-jupyter/installing-jupyter