Problems with Python

Question:

I have so many weird problems with python. I installed moviepy and when I want to run the code using Spyder, it says this no module named moviepy. But, when I run the code on the terminal, everything is fine.

My other problem is that I installed jupyter notebook and jupyter lab, but when I want to open them up using the commands "jupyterlab" or "jupyter-lab" or "jupyter lab" or "jupyter" it says for example:

‘jupyter’ is not recognized as an internal or external command,
operable program or batch file.

can you please help me solve these problems?

Thanks,

Masoud

Also, I just set the environment variable and added:

C:UsersmasouAppDataLocalProgramsPythonPython38-32
and
C:UsersmasouAppDataLocalProgramsPythonPython38-32Scripts

to the path.

Asked By: masoud kavoosi

||

Answers:

For your first problem with moviepy, it sounds like Spyder may not be recognizing the path to the moviepy module. You can try adding the path to the moviepy module to Spyder’s Python path.

To do this, go to the "Python interpreter" section in Spyder’s preferences, and then click on the "Consoles" tab. From there, click on the "Advanced settings" button, and then on the "PYTHONPATH manager" tab. Click on the "Add Path" button and add the path to the folder where moviepy is installed.

For example, if moviepy is installed in the "C:Python38Libsite-packagesmoviepy" folder, you would add "C:Python38Libsite-packages" to Spyder’s Python path.

For your second problem with Jupyter, it sounds like Jupyter may not be added to your system’s PATH environment variable. You can try adding the Jupyter directory to your system’s PATH variable.
To do this on Windows, follow these steps:

  1. Open the Start menu and search for "environment variables".
  2. Click on "Edit the system environment variables".
  3. Click on the "Environment Variables" button.
  4. Under "System Variables", scroll down and find the "Path" variable, then click "Edit".
  5. Click "New" and add the path to the directory containing the Jupyter executable (e.g. "C:UsersYourUserNameAppDataLocalProgramsPythonPython39Scripts").
  6. Click "OK" on all the windows to save the changes.

After adding Jupyter to your PATH, try running the "jupyter" command again in the terminal or command prompt to see if it works.

Answered By: Basir Mahmood
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.