Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PIP file location
#2
(Dec-01-2024, 11:47 AM)JackG29 Wrote: I've come to a halt because I can not find the third-party script called pyperclip.py. I followed the directions for using pip in the appendix, and the file seems to have been downloaded properly, but I can't find it. Furthermore, I'm not sure where it should reside in order to import the module into my code.
You only need to import pyperclip there is almost never need to go into your_python..\site-packages to look at files that pip install.
Here how to use it.
# Install
G:\div_code
λ pip install pyperclip --upgrade
Requirement already satisfied: pyperclip in c:\python312\lib\site-packages (1.9.0)
# Use it
G:\div_code
λ python
Python 3.12.2 (tags/v3.12.2:6abddd9, Feb  6 2024, 21:26:36) [MSC v.1937 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyperclip
>>>
>>> pyperclip.copy('Python') # Can now eg open notepad and paste into it
>>> pyperclip.paste()
'Python'

# To get file placement as mention not needed to work with it
>>> pyperclip.__file__
'C:\\python312\\Lib\\site-packages\\pyperclip\\__init__.py'
So now everywhere eg in a Editor/Ide import pyperclip will work as long as you point to use the version of Python that pip has installed to.
Gribouillis likes this post
Reply


Messages In This Thread
PIP file location - by JackG29 - Dec-01-2024, 11:47 AM
RE: PIP file location - by snippsat - Dec-01-2024, 12:59 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Changing file location azizrasul 6 2,827 Sep-28-2022, 01:01 AM
Last Post: azizrasul
  find the header location in a .bin file without reading the whole file at a time SANJIB 0 2,992 Mar-05-2021, 04:08 PM
Last Post: SANJIB
  Cannot copy file to another location rcmanu95 1 2,378 Jul-19-2020, 05:16 AM
Last Post: deanhystad
  Saving a file to a specific location finndude 13 10,880 Apr-23-2020, 03:07 PM
Last Post: finndude
  I cant find the location of my csv file Ummusabbar 3 5,687 Jan-04-2018, 05:18 PM
Last Post: buran

Forum Jump:

User Panel Messages

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