我无法在PyCharmProjects文件夹以外的任何地方创建的项目中安装包。我试着通过PyCharm和没有它在桌面上创建项目,结果是一样的,只是无休止的加载。但是如果你在PyCharmProjects文件夹中创建,那么就没有问题了。
p。所有项目中的s都有一个虚拟环境
的例子:pip install aiogram
ERROR: Operation cancelled by user
Traceback (most recent call last):
File "C:Program FilesPython310libtempfile.py", line 252, in _mkstemp_inner
fd = _os.open(file, flags, 0o600)
PermissionError: [Errno 13] Permission denied: 'c:\users\ali\appdata\local\pip\cache\http\a\1\9\5\3\a19537d3cf37c122db841d6fe4cd322bc10d1a558bb00d146b85cb9a4mlo_4p9.tmp'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:Program FilesPython310librunpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:Program FilesPython310librunpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:UsersAliCodingPythonZapparilvenvScriptspip.exe__main__.py", line 7, in <module>
File "C:UsersAliCodingPythonZapparilvenvlibsite-packagespip_internalclimain.py", line 70, in main
return command.main(cmd_args)
File "C:UsersAliCodingPythonZapparilvenvlibsite-packagespip_internalclibase_command.py", line 98, in main
return self._main(args)
File "C:UsersAliCodingPythonZapparilvenvlibsite-packagespip_internalclibase_command.py", line 214, in _main
self.handle_pip_version_check(options)
File "C:UsersAliCodingPythonZapparilvenvlibsite-packagespip_internalclireq_command.py", line 147, in handle_pip_version_check
pip_self_version_check(session, options)
File "C:UsersAliCodingPythonZapparilvenvlibsite-packagespip_internalself_outdated_check.py", line 152, in pip_self_version_check
best_candidate = finder.find_best_candidate("pip").best_candidate
File "C:UsersAliCodingPythonZapparilvenvlibsite-packagespip_internalindexpackage_finder.py", line 851, in find_best_candidate
candidates = self.find_all_candidates(project_name)
File "C:UsersAliCodingPythonZapparilvenvlibsite-packagespip_internalindexpackage_finder.py", line 798, in find_all_candidates
page_candidates = list(page_candidates_it)
File "C:UsersAliCodingPythonZapparilvenvlibsite-packagespip_internalindexsources.py", line 134, in page_candidates
yield from self._candidates_from_page(self._link)
File "C:UsersAliCodingPythonZapparilvenvlibsite-packagespip_internalindexpackage_finder.py", line 758, in process_project_url
html_page = self._link_collector.fetch_page(project_url)
File "C:UsersAliCodingPythonZapparilvenvlibsite-packagespip_internalindexcollector.py", line 490, in fetch_page
return _get_html_page(location, session=self.session)
File "C:UsersAliCodingPythonZapparilvenvlibsite-packagespip_internalindexcollector.py", line 400, in _get_html_page
resp = _get_html_response(url, session=session)
File "C:UsersAliCodingPythonZapparilvenvlibsite-packagespip_internalindexcollector.py", line 115, in _get_html_response
resp = session.get(
File "C:UsersAliCodingPythonZapparilvenvlibsite-packagespip_vendorrequestssessions.py", line 555, in get
return self.request('GET', url, **kwargs)
File "C:UsersAliCodingPythonZapparilvenvlibsite-packagespip_internalnetworksession.py", line 454, in request
return super().request(method, url, *args, **kwargs)
File "C:UsersAliCodingPythonZapparilvenvlibsite-packagespip_vendorrequestssessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "C:UsersAliCodingPythonZapparilvenvlibsite-packagespip_vendorrequestssessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "C:UsersAliCodingPythonZapparilvenvlibsite-packagespip_vendorcachecontroladapter.py", line 53, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "C:UsersAliCodingPythonZapparilvenvlibsite-packagespip_vendorrequestsadapters.py", line 533, in send
return self.build_response(request, resp)
File "C:UsersAliCodingPythonZapparilvenvlibsite-packagespip_vendorcachecontroladapter.py", line 79, in build_response
cached_response = self.controller.update_cached_response(
File "C:UsersAliCodingPythonZapparilvenvlibsite-packagespip_vendorcachecontrolcontroller.py", line 374, in update_cached_response
self.cache.set(cache_url, self.serializer.dumps(request, cached_response))
File "C:UsersAliCodingPythonZapparilvenvlibsite-packagespip_internalnetworkcache.py", line 61, in set
with adjacent_tmp_file(path) as f:
File "C:Program FilesPython310libcontextlib.py", line 135, in __enter__
return next(self.gen)
File "C:UsersAliCodingPythonZapparilvenvlibsite-packagespip_internalutilsfilesystem.py", line 82, in adjacent_tmp_file
with NamedTemporaryFile(
File "C:Program FilesPython310libtempfile.py", line 549, in NamedTemporaryFile
(fd, name) = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
File "C:Program FilesPython310libtempfile.py", line 252, in _mkstemp_inner
fd = _os.open(file, flags, 0o600)
KeyboardInterrupt
在Windows机器上,pip install
失败的原因有很多(Windows不允许某些程序访问某些文件)。你可能需要给你正在使用的终端管理员权限。