D
D
Danya Durov2021-07-04 15:21:23
Python
Danya Durov, 2021-07-04 15:21:23

I decided to work with python, two errors came out [WinError5] and [WinError2], how to solve?

C:\Users\Kakashi19>py -m pip install --upgrade pip
Requirement already satisfied: pip in c:\python39\lib\site-packages (21.1.1)
Collecting pip
Downloading pip-21.1.3-py3-none- any.whl (1.5 MB)
|████████████████████████████████| 1.5 MB 1.1 MB/s
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 21.1.1
Uninstalling pip-21.1.1:
ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: ' c:\\python39\\lib\\site-packages\\pip-21.1.1.dist-info\\entry_points.txt'
Consider using the `--user` option or check the permissions.

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

C:\Users\Kakashi19>pip install vk_api
WARNING: Ignoring invalid distribution -ip (c:\python39\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\python39\lib\site-packages)
Collecting vk_api
Downloading vk_api-11.9.4.tar.gz (39 kB)
Collecting requests
Downloading requests-2.25.1-py2.py3-none-any.whl (61 kB)
|█████████████ ███████████████████| 61 kB 561 kB/s
Collecting six
Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting chardet<5,>=3.0.2
Downloading chardet-4.0.0-py2.py3-none -any.whl (178 kB)
|████████████████████████████████| 178 kB 656 kB/s
Collecting certifi>=2017.4.17
Downloading certifi-2021.5.30-py2.py3-none-any.whl (145 kB)
|████████████████ ████████████████| 145 kB 656 kB/s
Collecting idna<3,>=2.5
Downloading idna-2.10-py2.py3-none-any.whl (58 kB)
|█████████████████ ███████████████| 58 kB 990 kB/s
Collecting urllib3<1.27,>=1.21.1
Downloading urllib3-1.26.6-py2.py3-none-any.whl (138 kB)
|█████████████ ███████████████████| 138 kB 726 kB/s
Using legacy 'setup.py install' for vk-api, since package 'wheel' is not installed.
WARNING: Ignoring invalid distribution -ip (c:\python39\lib\site-packages)
Installing collected packages: urllib3, idna, chardet, certifi, six, requests, vk-api
WARNING: Failed to write executable - trying to use .deleteme logic
ERROR: Could not install packages due to an OSError: [WinError 2] The system cannot find the file specified: 'c:\\python39\\Scripts\\chardetect.exe' -> 'c:\\python39\\Scripts\\chardetect.exe.deleteme'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
deitry, 2022-02-25
@deitry

I stumbled upon the question when I was googling about `ERROR: Could not install packages due to an OSError: [WinError 2] The system cannot find the file specified`.
In my case, VS Code by default tried to install the linter on the python installed via It choco
& C:/Python310/python.exe -m pip install -U flake8
looked like a permissions problem, and yes, manually with the command

& C:/Python310/python.exe -m pip install -U flake8 --user

everything was set up very well.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question