Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting pip to work
#1
I get a syntax error trying to use pip. See several attempts below.

Python 3.8.10 (default, Nov 26 2021, 20:14:08) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license()" for more information.
>>> pip install KivyCalendar
SyntaxError: invalid syntax
>>> $ pip install KivyCalendar
SyntaxError: invalid syntax
>>> check pip version
SyntaxError: invalid syntax
>>> pip install camelcase
SyntaxError: invalid syntax
>>> $ pip install camelcase
SyntaxError: invalid syntax
>>> sudo pip install KivyCalendar
SyntaxError: invalid syntax
>>> python -m pip install KivyCalendar
SyntaxError: invalid syntax
>>> pip install kivycalendar3
SyntaxError: invalid syntax
>>> 
Reply
#2
You run pip from the shell, i.e bash or cmd, not from inside Python.
Reply
#3
Thank you for the help
Reply
#4
I am somewhat confused as the header of the window says : 'IDLE Shell 3.8.10'. I am assuming this is not the Python Shell?
Reply
#5
I understand what you were saying. i had to go back to the terminal.
thanks again
Reply
#6
I apologize for another question but it indicated it downloaded successfully but what i downloaded is not recognized. Do i need to do something else to get python to recognize it?

Successfully installed KivyCalendar-0.1.3
mark@mark-Latitude-E7240:~$

from KivyCalendar import CalendarWidget
The error : Import KivyCalendar could not be resolved-Report missing imports
Reply
#7
Sounds like you did not pip the package into the python you are using. To see all the python version installed on my computer I type
Output:
C:\>py --list Installed Pythons found by py Launcher for Windows -3.9-64 * -3.6-64
This shows me I have Python 3.6 and Python 3.9. How many version of python do you have?

If I did "pip install KivyCalendar" it would install KivyCalendar in my Python 3.9. If I ran something using Python 3.6 and tried to import KivyCalendar it would report:
Output:
import KivyCalendar ModuleNotFoundError: No module named 'KivyCalendar'
To install KivyCalendar in my Python 3.6 I would use this pip command.
Output:
python3.6 -m pip install KivyCalendar
Reply
#8
Only one version indicated-3.8.10.
I ran again modifying command as above and it indicated already satisfied. This application is in an Environment i created- does that come into play here?

mark@mark-Latitude-E7240:~$ python3.8 -m pip install KivyCalendar
/usr/lib/python3/dist-packages/secretstorage/dhcrypto.py:15: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead
  from cryptography.utils import int_from_bytes
/usr/lib/python3/dist-packages/secretstorage/util.py:19: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead
  from cryptography.utils import int_from_bytes
Requirement already satisfied: KivyCalendar in ./.local/lib/python3.8/site-packages (0.1.3)
Requirement already satisfied: kivy in ./.local/lib/python3.8/site-packages (from KivyCalendar) (2.0.0)
Requirement already satisfied: pygments in ./.local/lib/python3.8/site-packages (from kivy->KivyCalendar) (2.10.0)
Requirement already satisfied: Kivy-Garden>=0.1.4 in ./.local/lib/python3.8/site-packages (from kivy->KivyCalendar) (0.1.4)
Requirement already satisfied: docutils in ./.local/lib/python3.8/site-packages (from kivy->KivyCalendar) (0.17.1)
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (from Kivy-Garden>=0.1.4->kivy->KivyCalendar) (2.22.0)
Reply
#9
If you have a virtual environment you need to activate it before using pip.
Reply


Forum Jump:

User Panel Messages

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