Python не работает pip windows

I downloaded and installed Python 3.5 from https://www.python.org/downloads/ on my Windows 10 machine with IDLE

I want to install other packages using pip using the following and various other options in the IDLE commandline editor.

>> pip install    packagename
>> pip --install  packagename
>> pip --upgrade  packagename
>> pip upgrade    packagename

Where packagename I have tried various packages available from my installed Python modules Tried all the above options without any packagename a well.
In short, pip doesn’t work and I am stuck.

I get Syntaxerror: invalid syntax

pip is preinstalled in my Python. confirmed this with the command «import pip» and from help(‘modules’).

Need help on how to proceed.

System specs: Windows 10, with login as User (Local Admin privileges). this is the only User on my computer.

Eric Leschinski's user avatar

asked Oct 3, 2016 at 12:55

instead of typing in «python». try using «py».
for ex:

py -m pip install    packagename
py -m pip --install  packagename
py -m pip --upgrade  packagename
py -m pip upgrade    packagename

note: this should be done in the command prompt «cmd» and not in python idle. also FYI pip is installed with python 3.6 automatically.

Dmitry's user avatar

Dmitry

6,77614 gold badges37 silver badges40 bronze badges

answered Oct 15, 2017 at 16:20

BJJ Vegan's user avatar

BJJ VeganBJJ Vegan

5914 silver badges3 bronze badges

1

Make sure the path to scripts folder for the python version is added to the path environment/system variable in order to use pip command directly without the whole path to pip.exe which is inside the scripts folder.

The scripts folder would be inside the python folder for the version that you are using, which by default would be inside c drive or in c:/program files or c:/program files (x86).

Then use commands as mentioned below. You may have to run cmd as administrator to perform these tasks. You can do it by right clicking on cmd icon and selecting run as administrator.

python -m pip install packagename
python -m pip uninstall packagename
python -m pip install --upgrade packagename

In case you have more than one version of python. You may replace python with py -versionnumber for example py -2 for python 2 or you may replace it with the path to the corresponding python.exe file. For example "c:\python27\python".

answered Mar 30, 2018 at 17:57

Nikita Sharma's user avatar

1

It’s a really weird issue and I am posting this after wasting my 2 hours.

You installed Python and added it to PATH. You’ve checked it too(like 64-bit etc). Everything should work but it is not.

what you didn’t do is a terminal/cmd restart

restart your terminal and everything would work like a charm.

I Hope, it helped/might help others.

answered Oct 26, 2019 at 21:32

Mujeeb Ishaque's user avatar

I faced a problem upgrading pip from version 9.0.1 to 9.0.3
The upgrade failed middle way(after uninstalling version 9.0.1 and without installing version 9.0.3).
This usually creates a broken pip file.
Broken pip can be solved by the command—>

easy_install pip

Which usually installs the latest version of pip, and solves the issue.
In order to confirm, type

pip --version

Hope this was helpfull…

answered Mar 25, 2018 at 15:09

J11's user avatar

J11J11

4554 silver badges8 bronze badges

According to pip documentation

pip is already installed if you are using Python 2 >=2.7.9 or Python 3 >=3.4 downloaded from python.org

But I was surprised when I typed pip --version in the Python Launcher and it gave me an error saying that ‘pip’ is not recognized. Then I tried the same in Python IDLE which gave the same error. Then I opened a cmd and typed python pip --version and it said something like «can’t open file».

Solution:

I finally realized that pip commands are properly recognized outside of the python.exe, because pip is a separate executable. So, just open a cmd and type pip --version and it should work as expected. If you call pip inside a Python executable (such as the Launcher, IDLE, or calling python pip), it assumes pip is just a variable and complains that it is not defined.

Note: I made sure that C:\Users\<username>\AppData\Local\Programs\Python\<Python version>\ and C:\Users\<username>\AppData\Local\Programs\Python\<Python version>\Scripts\ are included in the PATH variable.

answered May 14, 2021 at 11:01

dee's user avatar

deedee

1291 silver badge3 bronze badges

1

open command prompt

python pip install <package-name> 

This should complete the process

answered Jan 20, 2017 at 13:43

Pavan Nath's user avatar

Pavan NathPavan Nath

1,4941 gold badge14 silver badges23 bronze badges

1

You may have to run cmd as administrator to perform these tasks. You can do it by right clicking on cmd icon and selecting run as administrator.
It’s worked for me.

answered Mar 31, 2018 at 11:06

Igor Osipov's user avatar

Igor OsipovIgor Osipov

1571 silver badge12 bronze badges

I had the same problem on Visual Studio Code. For various reasons several python versions are installed on my computer. I was thus able to easily solve the problem by switching python interpreter.

If like me you have several versions of python on you machine, in Visual Studio Code, you can easily change the interpreter by clicking on the bottom left corner where it says Python…

enter image description here

answered Sep 29, 2020 at 10:08

Americain Naif's user avatar

This command fixed my problem:

pip install --user mpr

answered Apr 24 at 15:03

Tohid Makari's user avatar

Tohid MakariTohid Makari

1,7503 gold badges16 silver badges30 bronze badges

Nolrox

@Nolrox

Python-разработчик

Качаю Python, захожу в консоль, пишу pip install и выдает что «pip» не является внутренней или внешней командой, исполняемой программой или пакетным файлом. Что делать?


  • Вопрос задан

  • 58517 просмотров

Добавить в PATH.
Гугли переменные среды

Или даже будет быстрее переустановить питон и при установке поставить соответствующую галочку.

Если винда, то тут 99% что при установке не поставил галочку добавить пути в PATH.

1. Руками прописать
2. Удалить и поставить заново, не пропустив галочку

Скорее всего, у вас просто не была установлена галочка на работу пипа со всех директорий, или переустановите пайтон, почтавив эту галочку, илм пробуйте выполнять эту команду с директории где находится пайтон

Пригласить эксперта

Нужно обновить pip:
python -m pip install --upgrade pip
Скорее всего вы используете Python 3.9. Но многие мейнтейнеры не успели обновить пакеты. Поэтому установите Python 3.8
Discord.py поддерживается пока питоном 3.5 … 3.8!
И неплохо бы установить Microsoft C++ Build Tools, пригодится для установки некоторых пакетов.

если галочка PATH python не сработала можно: настроить ручную.
здесь объясняют как в ручную настроить PATH для python (для pip достаточно просто указать в PATH адрес к scripts в каталоге python)


  • Показать ещё
    Загружается…

08 окт. 2023, в 23:50

5000 руб./за проект

08 окт. 2023, в 21:59

1000 руб./в час

08 окт. 2023, в 20:00

10000 руб./за проект

Минуточку внимания

I downloaded and installed Python 3.5 from https://www.python.org/downloads/ on my Windows 10 machine with IDLE

I want to install other packages using pip using the following and various other options in the IDLE commandline editor.

>> pip install    packagename
>> pip --install  packagename
>> pip --upgrade  packagename
>> pip upgrade    packagename

Where packagename I have tried various packages available from my installed Python modules Tried all the above options without any packagename a well.
In short, pip doesn’t work and I am stuck.

I get Syntaxerror: invalid syntax

pip is preinstalled in my Python. confirmed this with the command «import pip» and from help(‘modules’).

Need help on how to proceed.

System specs: Windows 10, with login as User (Local Admin privileges). this is the only User on my computer.

Eric Leschinski's user avatar

asked Oct 3, 2016 at 12:55

instead of typing in «python». try using «py».
for ex:

py -m pip install    packagename
py -m pip --install  packagename
py -m pip --upgrade  packagename
py -m pip upgrade    packagename

note: this should be done in the command prompt «cmd» and not in python idle. also FYI pip is installed with python 3.6 automatically.

Dmitry's user avatar

Dmitry

6,77614 gold badges37 silver badges40 bronze badges

answered Oct 15, 2017 at 16:20

BJJ Vegan's user avatar

BJJ VeganBJJ Vegan

5914 silver badges3 bronze badges

1

Make sure the path to scripts folder for the python version is added to the path environment/system variable in order to use pip command directly without the whole path to pip.exe which is inside the scripts folder.

The scripts folder would be inside the python folder for the version that you are using, which by default would be inside c drive or in c:/program files or c:/program files (x86).

Then use commands as mentioned below. You may have to run cmd as administrator to perform these tasks. You can do it by right clicking on cmd icon and selecting run as administrator.

python -m pip install packagename
python -m pip uninstall packagename
python -m pip install --upgrade packagename

In case you have more than one version of python. You may replace python with py -versionnumber for example py -2 for python 2 or you may replace it with the path to the corresponding python.exe file. For example "c:\python27\python".

answered Mar 30, 2018 at 17:57

Nikita Sharma's user avatar

1

It’s a really weird issue and I am posting this after wasting my 2 hours.

You installed Python and added it to PATH. You’ve checked it too(like 64-bit etc). Everything should work but it is not.

what you didn’t do is a terminal/cmd restart

restart your terminal and everything would work like a charm.

I Hope, it helped/might help others.

answered Oct 26, 2019 at 21:32

Mujeeb Ishaque's user avatar

I faced a problem upgrading pip from version 9.0.1 to 9.0.3
The upgrade failed middle way(after uninstalling version 9.0.1 and without installing version 9.0.3).
This usually creates a broken pip file.
Broken pip can be solved by the command—>

easy_install pip

Which usually installs the latest version of pip, and solves the issue.
In order to confirm, type

pip --version

Hope this was helpfull…

answered Mar 25, 2018 at 15:09

J11's user avatar

J11J11

4554 silver badges8 bronze badges

According to pip documentation

pip is already installed if you are using Python 2 >=2.7.9 or Python 3 >=3.4 downloaded from python.org

But I was surprised when I typed pip --version in the Python Launcher and it gave me an error saying that ‘pip’ is not recognized. Then I tried the same in Python IDLE which gave the same error. Then I opened a cmd and typed python pip --version and it said something like «can’t open file».

Solution:

I finally realized that pip commands are properly recognized outside of the python.exe, because pip is a separate executable. So, just open a cmd and type pip --version and it should work as expected. If you call pip inside a Python executable (such as the Launcher, IDLE, or calling python pip), it assumes pip is just a variable and complains that it is not defined.

Note: I made sure that C:\Users\<username>\AppData\Local\Programs\Python\<Python version>\ and C:\Users\<username>\AppData\Local\Programs\Python\<Python version>\Scripts\ are included in the PATH variable.

answered May 14, 2021 at 11:01

dee's user avatar

deedee

1291 silver badge3 bronze badges

1

open command prompt

python pip install <package-name> 

This should complete the process

answered Jan 20, 2017 at 13:43

Pavan Nath's user avatar

Pavan NathPavan Nath

1,4941 gold badge14 silver badges23 bronze badges

1

You may have to run cmd as administrator to perform these tasks. You can do it by right clicking on cmd icon and selecting run as administrator.
It’s worked for me.

answered Mar 31, 2018 at 11:06

Igor Osipov's user avatar

Igor OsipovIgor Osipov

1571 silver badge12 bronze badges

I had the same problem on Visual Studio Code. For various reasons several python versions are installed on my computer. I was thus able to easily solve the problem by switching python interpreter.

If like me you have several versions of python on you machine, in Visual Studio Code, you can easily change the interpreter by clicking on the bottom left corner where it says Python…

enter image description here

answered Sep 29, 2020 at 10:08

Americain Naif's user avatar

This command fixed my problem:

pip install --user mpr

answered Apr 24 at 15:03

Tohid Makari's user avatar

Tohid MakariTohid Makari

1,7503 gold badges16 silver badges30 bronze badges

I recently installed Python for Windows 10 and need to use pip command to install the requests package.
However, whenever I try to use pip in cmd it just freezes my command prompt.

Using CTRL + C, CTRL + D or any command like that to cancel it does not work either, the prompt just freezes like its waiting for input or something, but I get no output or any clue about what to do.

Picture of command promt when its frozen

I have set the PATH variable correctly, and my computer finds pip and launches it, but it just freezes. I have also tried reinstalling Python countless times and manually reinstalling pip but nothing seems to do the trick.

vvvvv's user avatar

vvvvv

26k19 gold badges51 silver badges83 bronze badges

asked Nov 10, 2015 at 19:53

Olof H's user avatar

3

I had exactly the same problem here (Windows 10.0.10240). After typing just «pip» and hitting enter, nothing else happened on the console. This problem was affecting including other .exe compiled python related scripts like mezzanine-project.exe.

The antivirus AVAST was the culprit (in my case) !!!

After disabling AVAST files module (or uninstalling AVAST) pip started working again.

answered Nov 26, 2015 at 0:05

Márcio Moreira's user avatar

5

i didn’t think i had the same issue as @Marcio, but the longer it went on, it turned out i did.

In avast, goto the settings, goto Active PRotection, go to File System Shield and add an exclusion for

C:\Python27\Scripts

should work without a reboot, did for me, I was having issues with the Virtualenv.exe which is in that folder.

answered Feb 4, 2016 at 16:25

bytejunkie's user avatar

bytejunkiebytejunkie

1,00314 silver badges30 bronze badges

Try to use easy-install insted of pip it works in the same way.

vvvvv's user avatar

vvvvv

26k19 gold badges51 silver badges83 bronze badges

answered Nov 10, 2015 at 20:14

Marco Del Toro's user avatar

0

@eryksun provided what I think should be the answer to this question. I also have had the command prompt hang whenever I try to use pip, but I do not want to use easy_install. The solution (from @eryksun) was to use python -m pip install package_name. This works great for managing python packages in windows 10.

answered Nov 13, 2015 at 17:30

jthomas's user avatar

jthomasjthomas

2,4871 gold badge13 silver badges15 bronze badges

Marco’s answer worked perfectly but the actual solution to the problem is that you should write your pip commands using python -m pip instead of just pip
so your command will be python -m pip install requests

answered Nov 22, 2015 at 14:43

omarwaleed's user avatar

omarwaleedomarwaleed

5817 silver badges19 bronze badges

1

Well, when you run python -m pip, it actually starts pip.exe as a child process, so in the end it freezes the same for me, although it runs a bit longer…
Worse is that the pip.exe process is completely zombie, no way to kill it even with ProcExpl….

answered Nov 22, 2015 at 20:20

Greg Ware's user avatar

1

I had the same problem. Just disable your antivirus and it should work.

answered Dec 2, 2015 at 19:19

Sayf Boujan's user avatar

1

Thanks to @Marco Del Toro’s answer, using easy_install worked for me: I could install the packages I needed for my project. I also managed to fix pip using easy_install so pip also works for me now. The solution to fixing pip was: easy_install pip.


This answer was posted as an edit to the question Pip not working on windows 10, freezes command promt by the OP Olof H under CC BY-SA 3.0.

answered Dec 22, 2022 at 20:59

vvvvv's user avatar

vvvvvvvvvv

26k19 gold badges51 silver badges83 bronze badges

If you have a certain network it can block pip for installation. For my case I used my own network without VPN.

answered Nov 9, 2022 at 10:20

HesamJafarian's user avatar

1

Package Installer for Python (PIP) is the preferred package-management system for Python. It’s used to install third-party packages from an online repository called the Python Package Index.

When attempting to install Python packages, you may encounter errors stating PIP is not recognized, command not found, or can’t open the file. In this article, we’ve detailed why such errors occur, as well as how you can fix them.

Table of Contents

Why is the PIP Install Not Working?

The most common reasons for issues with PIP installations is either that an incorrect PIP path is added to the PATH system variable, or the PIP path isn’t added at all. This often happens because users forget or don’t know to include PIP during the Python installation. In case of Linux, PIP isn’t included during the Python installation to start with, so you have to install it separately later.

In most cases, you won’t encounter this error if you use a Python IDE instead of CMD. However, if you don’t want to use an IDE, or you face this error despite using an IDE, you can try the fixes from the section below to resolve the issue.

Include PIP During Installation

First, you should make sure that PIP was actually included during the Python installation. Here are the steps to do so:

  1. Press Win + R, type appwiz.cpl, and press Enter.
  2. Select Python from the list and press Change.
  3. Click on Modify. Ensure pip is selected and press Next > Install.
    install-pip-python-optional-features
  4. After the installation completes, check if you can install the Python packages now.

Add PIP to PATH Variable

As stated, the PIP Install path needs to be added to the PATH system variable for it to work. Otherwise, CMD won’t recognize the command and you’ll encounter the not recognized error. First, you should check if this is the issue with the following steps:

  1. Press Win + R, type cmd, and press CTRL + Shift + Enter.
  2. Type echo %PATH% and press Enter.
    echo-path

Depending on your Python version and install location, you may see a path like C:\Python36\Scripts. This means the PIP path is already added to the PATH variable. If you don’t see it, you can add it via the command line with the following steps:

  1. Execute the following command:
    setx PATH "%PATH%;<PIP Path>"
    setx-path-python
    As stated, the PIP path will differ according to your Python version. We’ve used C:\Python36\Scripts as an example but in your case, the PIP path maybe different. If you aren’t sure what the PIP path is, check the GUI method below.
  2. Start a new instance of command prompt and check if you can install any packages.

The command-line interface method returns a lot of paths at once, which can get confusing. Instead, you can also check the paths via the GUI. Here are the steps to do so:

  1. Press Win + R, type sysdm.cpl, and press Enter.
  2. Switch to the Advanced tab and click on Environment Variables.
    environment-variables
  3. In the System variables section, select Path and press Edit.
  4. Click on New and add the pip installation path. This differs depending on your Python version but for the current latest version (3.10), the path is:
    C:\Users\Username\AppData\Local\Programs\Python\Python310\Scripts.
    add-new-path-variable
  5. Check if you can install a pip package now.

Use Correct PIP and Python Version

The pip install packagename command is generally used to install Python packages. If this command doesn’t work, you can try the commands shown below instead. Don’t forget to replace packagename with the actual package you’re trying to install.

python -m pip install packagename

py -m pip install packagename

pip-install-packagename

If you have multiple python versions, specify the version number as shown below:

py -3 -m pip install packagename

install-pip-package-version-number

Manually Install PIP

Due to failed upgrades and similar issues, your PIP file can get corrupted which can also lead to various problems such as PIP Install Not Working. One easy way to fix this is by removing Python and reinstalling it. You can find the steps to do so in the next section.

Alternatively, you can also manually install PIP with the following steps:

  1. Download get-pip.py and store it in Python’s installation directory.
  2. Enter cd <above directory> to switch to the installation directory in CMD.
    python-install-directory
  3. Type py get-pip.py and press Enter.
    py-get-pip
  4. Once pip is installed, check if you can install any packages.

In case of Linux, pip doesn’t come bundled with Python. You have to manually install it first. You can do so by executing the following command in the terminal:

sudo apt-get -y install python3-pip

install-python-pip-ubuntu

Reinstall Python

The final option is to remove Python entirely and then reinstall it. Any problematic files will be replaced during the process, which should ultimately resolve the issue. Here are the steps to do so:

  1. Press Win + R, type appwiz.cpl, and press Enter.
  2. Select Python from the list, click on Uninstall and follow the on-screen instructions.
  3. Restart your PC and reinstall Python.
  4. Enable the Add Python to Path option and select Customize installation. Also, make sure that PIP is included during the installation.
    install-python-add-python-to-path
  5. After the installation completes, restart your PC once more, then check if you can install any Python packages.

  • Python создать исполняемый файл windows
  • Qbittorrent x64 на русском для windows 10 скачать бесплатно
  • Python приложение для windows exe
  • Python создание виртуального окружения windows
  • Python перекодировать из utf 8 в windows 1251