我正在尝试在我的USB驱动器上安装pip。按照这个网站上的说明,我下载了get-pip.py
并运行了python get-pip.py
(python
在环境路径中)。不幸的是,脚本遇到了错误。我已经将日志文件上传到这里。错误本身是:
Exception:
Traceback (most recent call last):
File "c:\users\elyashic\appdata\local\temp\tmprkcrtx\pip.zip\pip\_vendor\pkg_resources.py", line 2251, in parsed_version
return self._parsed_version
File "c:\users\elyashic\appdata\local\temp\tmprkcrtx\pip.zip\pip\_vendor\pkg_resources.py", line 2344, in __getattr__
raise AttributeError(attr)
AttributeError: _parsed_version
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\elyashic\appdata\local\temp\tmprkcrtx\pip.zip\pip\_vendor\pkg_resources.py", line 2259, in version
return self._version
File "c:\users\elyashic\appdata\local\temp\tmprkcrtx\pip.zip\pip\_vendor\pkg_resources.py", line 2344, in __getattr__
raise AttributeError(attr)
AttributeError: _version
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\elyashic\appdata\local\temp\tmprkcrtx\pip.zip\pip\basecommand.py", line 122, in main
status = self.run(options, args)
File "c:\users\elyashic\appdata\local\temp\tmprkcrtx\pip.zip\pip\commands\install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "c:\users\elyashic\appdata\local\temp\tmprkcrtx\pip.zip\pip\req.py", line 1420, in install
if existing_distribute in distribute_requirement:
File "c:\users\elyashic\appdata\local\temp\tmprkcrtx\pip.zip\pip\_vendor\pkg_resources.py", line 2643, in __contains__
if self.index: item = item.parsed_version # only get if we need it
File "c:\users\elyashic\appdata\local\temp\tmprkcrtx\pip.zip\pip\_vendor\pkg_resources.py", line 2253, in parsed_version
self._parsed_version = pv = parse_version(self.version)
File "c:\users\elyashic\appdata\local\temp\tmprkcrtx\pip.zip\pip\_vendor\pkg_resources.py", line 2267, in version
"Missing 'Version:' header and/or %s file" % self.PKG_INFO, self
ValueError: ("Missing 'Version:' header and/or PKG-INFO file", distribute [unknown version] (i:\portableapps\portable python 3.2.5.1\app\scripts))
有人能给我解释一下我做错了什么吗?
我使用的是便携式 Python 3.2.5.1,安装后就尝试着安装 pip。
python-3.10.7
进行了尝试,虽然在c:\apps\python-3.10.7\python310._pth
设置文件中使用了相对文件夹,例如.\Lib\site-packages
,以将文件夹添加到 Python syspath 数组中。运行命令C:\apps\python-3.10.7\python.exe -m site
来列出 syspath 设置。例如安装 cryptodome 包C:\apps\python-3.10.7\scripts\pip.exe install pycryptodomex
。 - Whome