Pip install pyperclip ошибка

I have been using my raspberry pi 4 model b 32gb to learn to code with python.

I have been using my raspberry pi 4 model b 32gb to learn to code with python.

I am us the «Automate the Boring Stuff» ebook available for free from python.org.

I have made it to chapter 6 which deals with manipulating strings in python and working on the project of creating a multi-clipboard for automatic messages.

I am able to run python scripts from the terminal by typing:
pi@raspberrypi:~$ python ticTacToe.py

It works fine.

But, another script I have tries to import pyperclip. The error I get when trying to run this script is as shows:

pi@raspberrypi:~ $ python
Python 3.8.0 (default, Oct 3 2020, 08:34:01)
[GCC 8.3.0] on linux
Type «help», «copyright», «credits» or «license» for more information.
>>> import pyperclip
Traceback (most recent call last):
File «<stdin>», line 1, in <module>
ModuleNotFoundError: No module named ‘pyperclip’
>>>

Here is my script:

#! python
# mclip.py — A muti-clipboard program

TEXT = {‘agree’: «»»Yes, I agree. That sounds fine to me.»»»,
‘busy’: «»»Sorry, can we do this later this week or next week?»»»,
‘upsell’: «»»Would you consider making this a monthly donation?»»»}
import sys, pyperclip
if len(sys.argv) < 2:
print(‘Usage: python mclip.py [keyphrase] -copy phrase text’)
sys.exit()
keyphrase = sys.argv[1] # first command line arg is the keyphrase
if keyphrase in TEXT:
pyperclip.copy(TEXT[keyphrase])
print(‘Text for ‘ + keyphrase + ‘ copied to clipboard.’)
else:
print(‘There is no text for ‘ + keyphrase)

I have tried to update pip and the odd this is that it still says I am running an older version even after a successful update. Here is how I updated:
python -m pip update —upgrade pip
it shows to be successful. But, when I check my version it still shows the old version. (not sure if this is related)

system info:
pi@raspberrypi:~ $ cat /etc/os-release
PRETTY_NAME=»Raspbian GNU/Linux 10 (buster)»
NAME=»Raspbian GNU/Linux»
VERSION_ID=»10″
VERSION=»10 (buster)»
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL=»http://www.raspbian.org/»
SUPPORT_URL=»http://www.raspbian.org/RaspbianForums»
BUG_REPORT_URL=»http://www.raspbian.org/RaspbianBugs»

Linux raspberrypi 5.10.11-v7l+ #1399 SMP Thu Jan 28 12:09:48 GMT 2021 armv7l GNU/Linux

I am not sure what to try next.

Every difficulty is a challenge in disguise. Every challenge overcome breeds twice as much hope as a failure. Every failure is an opportunity to learn. You learn the most when something is difficult…

C:UsersAlexDownloadspassword_scrambler-masterpassword_scrambler-master>python -m pip install —upgrade pip
Collecting pip
Downloading pip-21.0-py3-none-any.whl (1.5 MB)
|———————————| 1.5 MB 1.6 MB/s
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 20.2.3
Uninstalling pip-20.2.3:
Successfully uninstalled pip-20.2.3
Successfully installed pip-21.0

C:UsersAlexDownloadspassword_scrambler-masterpassword_scrambler-master>pip uninstall Crypto
Found existing installation: crypto 1.4.1
Uninstalling crypto-1.4.1:
Would remove:
c:usersalexappdatalocalprogramspythonpython38-32libsite-packagescrypto-1.4.1.dist-info*
c:usersalexappdatalocalprogramspythonpython38-32libsite-packagescrypto*
c:usersalexappdatalocalprogramspythonpython38-32scriptscrypto.exe
c:usersalexappdatalocalprogramspythonpython38-32scriptsdecrypto.exe
Proceed (y/n)? y
Successfully uninstalled crypto-1.4.1

C:UsersAlexDownloadspassword_scrambler-masterpassword_scrambler-master>pip3 install Crypto
Collecting Crypto
Using cached crypto-1.4.1-py2.py3-none-any.whl (18 kB)
Requirement already satisfied: Naked in c:usersalexappdatalocalprogramspythonpython38-32libsite-packages (fromCrypto) (0.1.31)
Requirement already satisfied: shellescape in c:usersalexappdatalocalprogramspythonpython38-32libsite-packages(from Crypto) (3.8.1)
Requirement already satisfied: requests in c:usersalexappdatalocalprogramspythonpython38-32libsite-packages (from Naked->Crypto) (2.25.1)
Requirement already satisfied: pyyaml in c:usersalexappdatalocalprogramspythonpython38-32libsite-packages (from Naked->Crypto) (5.4.1)
Requirement already satisfied: chardet<5,>=3.0.2 in c:usersalexappdatalocalprogramspythonpython38-32libsite-packages (from requests->Naked->Crypto) (4.0.0)
Requirement already satisfied: certifi>=2017.4.17 in c:usersalexappdatalocalprogramspythonpython38-32libsite-packages (from requests->Naked->Crypto) (2020.12.5)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:usersalexappdatalocalprogramspythonpython38-32libsite-packages (from requests->Naked->Crypto) (1.26.2)
Requirement already satisfied: idna<3,>=2.5 in c:usersalexappdatalocalprogramspythonpython38-32libsite-packages (from requests->Naked->Crypto) (2.10)
Installing collected packages: Crypto
Successfully installed Crypto-1.4.1

C:UsersAlexDownloadspassword_scrambler-masterpassword_scrambler-master>passcrambler.py —file README.md —login a@dragokas.com
Traceback (most recent call last):
File «C:UsersAlexDownloadspassword_scrambler-masterpassword_scrambler-masterpasscrambler.py», line 10, in <modul
e>
from Crypto.Cipher import AES
ModuleNotFoundError: No module named ‘Crypto’

C:UsersAlexDownloadspassword_scrambler-masterpassword_scrambler-master>pip install Crypto
Requirement already satisfied: Crypto in c:usersalexappdatalocalprogramspythonpython38-32libsite-packages (1.4.1)
Requirement already satisfied: Naked in c:usersalexappdatalocalprogramspythonpython38-32libsite-packages (from Crypto) (0.1.31)
Requirement already satisfied: shellescape in c:usersalexappdatalocalprogramspythonpython38-32libsite-packages (from Crypto) (3.8.1)
Requirement already satisfied: pyyaml in c:usersalexappdatalocalprogramspythonpython38-32libsite-packages (from Naked->Crypto) (5.4.1)
Requirement already satisfied: requests in c:usersalexappdatalocalprogramspythonpython38-32libsite-packages (from Naked->Crypto) (2.25.1)
Requirement already satisfied: idna<3,>=2.5 in c:usersalexappdatalocalprogramspythonpython38-32libsite-packages (from requests->Naked->Crypto) (2.10)
Requirement already satisfied: chardet<5,>=3.0.2 in c:usersalexappdatalocalprogramspythonpython38-32libsite-packages (from requests->Naked->Crypto) (4.0.0)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:usersalexappdatalocalprogramspythonpython38-32libsite-packages (from requests->Naked->Crypto) (1.26.2)
Requirement already satisfied: certifi>=2017.4.17 in c:usersalexappdatalocalprogramspythonpython38-32libsite-packages (from requests->Naked->Crypto) (2020.12.5)

C:UsersAlexDownloadspassword_scrambler-masterpassword_scrambler-master>passcrambler.py —file README.md —login a@dragokas.com
Traceback (most recent call last):
File «C:UsersAlexDownloadspassword_scrambler-masterpassword_scrambler-masterpasscrambler.py», line 10, in <module>
from Crypto.Cipher import AES
ModuleNotFoundError: No module named ‘Crypto’

Изучаю pyyhon 3, для работы с буфером памяти в задании требуется установить piperclip, выполняю через командную строку.
Не получается, обновить pip до последней версии тоже не получается.

Microsoft Windows
© Корпорация Майкрософт (Microsoft Corporation), 2019. Все права защищены.

C:Usersя>pip install pyperclip
Collecting pyperclip
Downloading https://files.pythonhosted.org/packages/2d/0f/4eda562dffd085945d57c2d9a5da745cfb5228c02bc90f2c74bbac746243/pyperclip-1.7.0.tar.gz
Installing collected packages: pyperclip
Running setup.py install for pyperclip … error
Exception:
Traceback (most recent call last):
File “c:program filespython36libsite-packagespipcompat__init__.py”, line 73, in console_to_str
return s.decode(sys.__stdout__.encoding)
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xce in position 81: invalid continuation byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “c:program filespython36libsite-packagespipbasecommand.py”, line 215, in main
status = self.run(options, args)
File “c:program filespython36libsite-packagespipcommandsinstall.py”, line 342, in run
prefix=options.prefix_path,
File “c:program filespython36libsite-packagespipreqreq_set.py”, line 784, in install
**kwargs
File “c:program filespython36libsite-packagespipreqreq_install.py”, line 878, in install
spinner=spinner,
File “c:program filespython36libsite-packagespiputils__init__.py”, line 676, in call_subprocess
line = console_to_str(proc.stdout.readline())
File “c:program filespython36libsite-packagespipcompat__init__.py”, line 75, in console_to_str
return s.decode(‘utf_8’)
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xce in position 81: invalid continuation byte
You are using pip version 9.0.1, however version 19.3.1 is available.
You should consider upgrading via the ‘python -m pip install –upgrade pip’ command.

C:Usersя>python -m pip install –upgrade pip
Collecting pip
Downloading https://files.pythonhosted.org/packages/00/b6/9cfa56b4081ad13874b0c6f96af8ce16cfbc1cb06bedf8e9164ce5551ec1/pip-19.3.1-py2.py3-none-any.whl (1.4MB)
100% |████████████████████████████████| 1.4MB 530kB/s
Installing collected packages: pip
Found existing installation: pip 9.0.1
Uninstalling pip-9.0.1:
Exception:
Traceback (most recent call last):
File “C:Program FilesPython36libshutil.py”, line 538, in move
os.rename(src, real_dst)
PermissionError: Отказано в доступе: ‘c:\program files\python36\lib\site-packages\pip-9.0.1.dist-info\description.rst’ -> ‘C:\Users\E0F1~1\AppData\Local\Temp\pip-26uz5vv9-uninstall\program files\python36\lib\site-packages\pip-9.0.1.dist-info\description.rst’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:Program FilesPython36libsite-packagespipbasecommand.py”, line 215, in main
status = self.run(options, args)
File “C:Program FilesPython36libsite-packagespipcommandsinstall.py”, line 342, in run
prefix=options.prefix_path,
File “C:Program FilesPython36libsite-packagespipreqreq_set.py”, line 778, in install
requirement.uninstall(auto_confirm=True)
File “C:Program FilesPython36libsite-packagespipreqreq_install.py”, line 754, in uninstall
paths_to_remove.remove(auto_confirm)
File “C:Program FilesPython36libsite-packagespipreqreq_uninstall.py”, line 115, in remove
renames(path, new_path)
File “C:Program FilesPython36libsite-packagespiputils__init__.py”, line 267, in renames
shutil.move(old, new)
File “C:Program FilesPython36libshutil.py”, line 553, in move
os.unlink(src)
PermissionError: Отказано в доступе: ‘c:\program files\python36\lib\site-packages\pip-9.0.1.dist-info\description.rst’
You are using pip version 9.0.1, however version 19.3.1 is available.
You should consider upgrading via the ‘python -m pip install –upgrade pip’ command.

Догадался что дело в переменной окружения, прописал в Path путь до python.exe

Теперь сообщение

Microsoft Windows
© Корпорация Майкрософт (Microsoft Corporation), 2019. Все права защищены.

C:Usersя>python
Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) on win32
Type “help”, “copyright”, “credits” or “license” for more information.
>>> pip install piperclip
File “<stdin>”, line 1
pip install piperclip
^
SyntaxError: invalid syntax
>>>

Отредактировано Stanislav77 (Янв. 13, 2020 00:40:34)

Понравилась статья? Поделить с друзьями:
  • Pip install pygame ошибка
  • Pioneer deh 1500ub amp error
  • Pioneer avh x2600bt error 10
  • Pip install pygame error
  • Pioneer 725 error 23