Ipython Prompt commad - python

i am completely ignorant with the prompt command, i don't know anything so be crystal clear when explaining step by step, thanks.
I have installed Python 3.10.4, if i digit python in the command prompt it works.
Then i installed pip using python get-pip.py and it told me it was successfully installed.
I went on ipython website and i downloaded the ipython file. At this point i went on the command prompt and i wrote "pip install ipython" and it installed it.
Now if i write "ipython" in the command prompt it says "ipython is not recognized as an internal or external command". If i try to install it again it says everything is already installed.
Help me i don't know what to do.

Related

Why do I have to use "py" to execute python commands instead of "python"?

I am a newbie in Python and had a problem with installing Python packages on my windows computer.
I installed Python itself and then had to install the packages "Numpy" and "Matplotlib" as well. My teacher told us to do it with the commands:
python -m pip install --upgrade pip
pip install numpy
pip install matplotlib
I managed to install Python but when I run the first command to install pip I got the error message telling me that Python is not found. I found the command py -m pip --version here and it worked. After running it pip got installed and I got the message "pip 22.3 from C:\Users\Kaja\Programs\Python\Python310\lib\site-packages\pip (python 3.10)". I guessed this message means that its working.
I had a similar problem with the commands to install Numpy and Matplotlib. It only worked with this commands
py -m pip install numpy
py -m pip install matplotlib
I searched the internet and found this question telling me to run the command doskey py=python and it did not work. But when I swapped py and python so that the command was doskey python=py I eventually could run my teachers commands.
I checked the windows documentation and they are using the same commands as my teacher. I am very curious to know why I had this problem because on my fellow students computers it worked without the doskey command.
Edit:
Thank you very much #RustyPython.
I checked my environment variables and the path to the python.exe was already there.
Out of curiousity I deleted the python.exe from the path variable and although I did that the commands still worked! Another thing I tried was to remove the doskey macro like discribed in this article but still the commands still run without any errors.
I think its something else.
When you install python on windows it usually comes with the python launcher. This provides a way to easily access all the python versions installed on your computer.
The python launcher uses the py command which access the default python version.
py -0p will show you all the installed versions.
See https://www.infoworld.com/article/3617292/how-to-use-pythons-py-launcher-for-windows.html for more details.
For the python command to work then the relevant directory containing python.exe needs to be added to your user PATH variable.
As has been said looks the the python directory is not on your PATH, but the python launcher is and finds the installed python.exe.
If you want python to work on command line then you'll need to add it to your PATH variable. https://realpython.com/add-python-to-path/#how-to-add-python-to-path-on-windows

Can't launch Spyder after installing with pip

Python beginner here. I would like to use Spyder as my Python IDE. Alas the standalone version does not include pip and I want to work with "Vanilla Python" rather than Anaconda. So I installed Spyder via
pip install spyder, which works fine. However, when running spyder3 in the command window, nothing happens. I get no error, but Spyder does not launch either. While the Spyder website says custom installation may be tricky, it does not provide a guide on how to get it done. Does someone know how? OS is Windows 10.
you need to follow this commands:
python -m venv spyder-env
spyder-env/Scripts/activate.bat
pip install spyder
more info
Update: Tried again with Python 3.10.4. "spyder" now exists in the Scripts folder and does launch when typing spyder in cmd. Works for me now.

pandas work on jupyter but not recognized in cmd or anaconda prompt

I want to run a script in .py with cmd or anaconda prompt but says pandas can't be recognized.
'pandas' in sys.modules
False
the version of python is the correct where these libraries are installed. The correct path is somehow not in connection with the cmd and all the libraries installed with the anaconda are not seen. How to make it work without installing all the modules again?
The solution was to write the word python too.
python hx.py
now it runs if typed in the anaconda prompt.
All nice.
Usually this is fixed with a simple from command line:
python -m pip install pandas
if this doesn't help, I will suggest you to remove all the python packages and do an anaconda reinstall on your system

Unable to download Python on Windows System

I'm having trouble getting python to work on my Windows 10 computer. I downloaded 3.5.2 off the website and ran the exe, but when I try to use
pip install nltk
So I copied and ran get-pip.py, but it still tells me "pip" is not recognized as an internal or external command, operable program or batch file.
python -m pip install pip
tells me that python is also not recognized. What should I do?
EDIT: Have tried reinstalling python, made sure the box to install pip was checked. Tried re-running the pip command in the Python command line (the one titled Python 3.5 (32-bit)) and it gave me an invalid syntax error on the word install.
When installing "the exe", make sure that you tick the checkbox labelled "Add Python 3.5 to PATH". That will solve the issue you mentionned.

PYTHON 2.7 command prompt stuck when using pip to install

I am trying to use pip to install the python docx plugin. However, when I use the line "pip install python-docx" on the windows command prompt, it just stays there, not doing anything. It doesn't crash, nor does it throw an error.
I have modified the PATH so it includes pip, so I don't think that's the problem.
In the end, what happened is that my antivirus was somehow interfering with the installing process. I turned it off for a few minutes, ran the windows command prompt as administrator, and it worked perfectly.

Categories