Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cannot find PIP
#1
I am brand new to Python, using the "Automate the Boring Stuff" to try to edit a pdf file using module PyPDF2. Cannot even get off the ground in the Python interactive shell. I am using Python 3.6 but cannot even find PIP:

>>> py -m pip install --upgrade pip
SyntaxError: invalid syntax
>>>

Yet if I go to Window Powershell I get the following:

PS C:\Users\stand> py -m pip install --upgrade pip
Requirement already up-to-date: pip in c:\users\stand\appdata\local\programs\python\python36-32\lib\site-packages
PS C:\Users\stand>

I'm confused! Confused
Reply
#2
pip is a program that should be ran in your system's command prompt. So your first attempt was not the right thing to do.
Using Windows command prompt is the right place to execute the command, and it looks like it worked fine! Response tells that your pip is installed and up to date.
Reply
#3
Thanks for your response. Yes, and in command prompt I see that PyPDF2 is indeed installed. But I cannot do anything in
Python interactve shell. Why is that? should I be using some kind of Python IDE?
Reply
#4
Can you tell more specifically, what you cannot do in Python interactive shell?
As far as simply running the Python code goes, IDE doesn't do anything more that shell does.
Did you try to run some code and got errors? In that case, post the code in Python code tags and full error traceback in error tags, and we will look into it.
Reply
#5
Take a look at Python 3.6 and pip installation under Windows
See how i test that pip work and install a module(then test that module/package work).

Here a run from cmd to show how it shoud look and install of PyPDF2:
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. Med enerett.

C:\Windows\System32>cd\

# Check pip
C:\>pip -V
pip 9.0.1 from c:\python36\lib\site-packages (python 3.6)

# Python version
C:\>python -V
Python 3.6.4

# Install PyPDF2
C:\>pip install PyPDF2
Collecting PyPDF2
  Downloading PyPDF2-1.26.0.tar.gz (77kB)
    100% |████████████████████████████████| 81kB 572kB/s
Building wheels for collected packages: PyPDF2
  Running setup.py bdist_wheel for PyPDF2 ... done
  Stored in directory: C:\Users\Tom\AppData\Local\pip\Cache\wheels\86\6a\6a\1ce004a5996894d33d93e1fb1b67c30973dc945cc5875a1dd0
Successfully built PyPDF2
Installing collected packages: PyPDF2
Successfully installed PyPDF2-1.26.0

# Test that PyPDF2 work
C:\>python
Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyPDF2
>>> PyPDF2._version
<module 'PyPDF2._version' from 'C:\\Python36\\lib\\site-packages\\PyPDF2\\_version.py'>
>>> exit()

C:\>
Quote:Yet if I go to Window Powershell I get the following:
cmd and Power-shell are not good at all,look at cmder.
Have a post about it here Python environment Windows.
Reply
#6
Thanks to all for the advice. Seems to be working now in Python interactive after reinstall of Python per the above instructions. Thanks so much for the help.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020