1

I'm trying to install spaCy for NLP tasks but when I follow the first instruction from https://spacy.io/usage (pip install -U pip setuptools wheel) I get the error below. I believe my error may come from me creating two different users for my laptop, my lack of understanding of environment variables, virtual environments, and my path variable. I also do not understand the message about no metadata being found.

Microsoft Windows [Version 10.0.19043.1706]
(c) Microsoft Corporation. All rights reserved.

C:\Python310\Scripts>pip install -U pip setuptools wheel
Requirement already satisfied: pip in c:\users\user\appdata\roaming\python\python310\site-packages (22.0.4)
Collecting pip
  Using cached pip-22.1.2-py3-none-any.whl (2.1 MB)
Requirement already satisfied: setuptools in c:\python310\lib\site-packages (62.3.2)
Requirement already satisfied: wheel in c:\python310\lib\site-packages (0.37.1)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 22.0.4
    Uninstalling pip-22.0.4:
      Successfully uninstalled pip-22.0.4
  WARNING: No metadata found in c:\users\user\appdata\roaming\python\python310\site-packages
  Rolling back uninstall of pip
  Moving to c:\users\user\appdata\roaming\python\python310\scripts\pip.exe
   from C:\Users\User\AppData\Local\Temp\pip-uninstall-on_65qs2\pip.exe
  Moving to c:\users\user\appdata\roaming\python\python310\scripts\pip3.10.exe
   from C:\Users\User\AppData\Local\Temp\pip-uninstall-on_65qs2\pip3.10.exe
  Moving to c:\users\user\appdata\roaming\python\python310\scripts\pip3.exe
   from C:\Users\User\AppData\Local\Temp\pip-uninstall-on_65qs2\pip3.exe
  Moving to c:\users\user\appdata\roaming\python\python310\site-packages\pip-22.0.4.dist-info\
   from C:\Users\User\AppData\Roaming\Python\Python310\site-packages\~ip-22.0.4.dist-info
  Moving to c:\users\user\appdata\roaming\python\python310\site-packages\pip\
   from C:\Users\User\AppData\Roaming\Python\Python310\site-packages\~ip
ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'C:\\Python310\\Lib\\site-packages\\pip\\__init__.py'
Consider using the `--user` option or check the permissions.

WARNING: You are using pip version 22.0.4; however, version 22.1.2 is available.
You should consider upgrading via the 'C:\Python310\python.exe -m pip install --upgrade pip' command.

C:\Python310\Scripts>

Screenshot of error message

enter image description here

Vy Do
  • 46,709
  • 59
  • 215
  • 313
Frank G
  • 49
  • 6
  • 1
    Personally never had that issue with pip, but check out this (https://stackoverflow.com/questions/51115744/access-is-denied-when-trying-to-pip-install-a-package-on-windows) and this (https://stackoverflow.com/questions/31172719/pip-install-access-denied-on-windows) thread. – ewz93 Jun 03 '22 at 16:47
  • Run your CMD as Administrator. Update pip like guide on screen. Let's me know result. – Vy Do Jun 04 '22 at 10:42
  • 1
    I suggest you read through a tutorial on virtual environments. But you can probably get it working by adding `--user` like the error says. – polm23 Jun 05 '22 at 03:32
  • Thank you, I did in fact have to add --user , in my case I also needed to add C:\ProgramData\Anaconda3\Library\bin to my path, I got that from here, https://github.com/conda/conda/issues/9746. Since I was trying to use spacy in Jupyter Notebook, I believe that may be why pip didn't quite work for me, although this is only my novice idea. – Frank G Jun 05 '22 at 03:55

0 Answers0