wyz1987
朝夕wyz
采纳率100%
2021-04-19 03:00 阅读 90

Mac安装pip失败,报错信息请看详情,请问这个问题该怎么解决呀?

Searching for pip

Reading https://pypi.python.org/simple/pip/

Best match: pip 21.0.1

Downloading https://files.pythonhosted.org/packages/b7/2d/ad02de84a4c9fd3b1958dc9fb72764de1aa2605a9d7e943837be6ad82337/pip-21.0.1.tar.gz#sha256=99bbde183ec5ec037318e774b0d8ae0a64352fe53b2c7fd630be1d07e94f41e5

Processing pip-21.0.1.tar.gz

Writing /tmp/easy_install-n2IMbU/pip-21.0.1/setup.cfg

Running pip-21.0.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-n2IMbU/pip-21.0.1/egg-dist-tmp-e0uhlg

/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'project_urls'

  warnings.warn(msg)

/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'

  warnings.warn(msg)

warning: no files found matching 'docs/docutils.conf'

warning: no previously-included files found matching '.coveragerc'

warning: no previously-included files found matching '.mailmap'

warning: no previously-included files found matching '.appveyor.yml'

warning: no previously-included files found matching '.travis.yml'

warning: no previously-included files found matching '.readthedocs.yml'

warning: no previously-included files found matching '.pre-commit-config.yaml'

warning: no previously-included files found matching 'tox.ini'

warning: no previously-included files found matching 'noxfile.py'

warning: no files found matching '*.css' under directory 'docs'

warning: no previously-included files found matching 'src/pip/_vendor/six'

warning: no previously-included files found matching 'src/pip/_vendor/six/moves'

warning: no previously-included files matching '*.pyi' found under directory 'src/pip/_vendor'

no previously-included directories found matching '.github'

no previously-included directories found matching '.azure-pipelines'

no previously-included directories found matching 'docs/build'

no previously-included directories found matching 'news'

no previously-included directories found matching 'tasks'

no previously-included directories found matching 'tests'

no previously-included directories found matching 'tools'

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/configuration.py", line 167

    raise ConfigurationError(f"No such key - {key}")

                                                  ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/network/auth.py", line 202

    ), f"Could not load credentials from url: {original_url}"

                                                            ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/network/session.py", line 321

    msg = f'adding trusted host: {host!r}'

                                         ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/network/lazy_wheel.py", line 193

    headers['Range'] = f'bytes={start}-{end}'

                                            ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/utils/logging.py", line 123

    prefix = f"{self.formatTime(record)} "

                                         ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/utils/misc.py", line 117

    return f"{sys.executable} -m pip"

                                    ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/utils/direct_url_helpers.py", line 91

    hash = f"{hash_name}={link.hash}"

                                    ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/utils/temp_dir.py", line 154

    f"Attempted to access deleted path: {self._path}"

                                                    ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/utils/pkg_resources.py", line 27

    e.reason += f" in {name} file"

                                 ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/utils/compatibility_tags.py", line 119

    return f"{implementation}{version}"

                                      ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/utils/hashes.py", line 88

    f'Unknown hash name: {hash_name}'

                                    ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/utils/wheel.py", line 60

    p for p in wheel_zip.namelist() if p.startswith(f"{info_dir}/")

                                                                 ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/utils/unpacking.py", line 276

    f'Cannot determine archive format of {location}'

                                                   ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/models/link.py", line 86

    rp = f' (requires-python:{self.requires_python})'

                                                    ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/models/direct_url.py", line 49

    raise DirectUrlValidationError(f"{key} must have a value")

                                                            ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/models/target_python.py", line 89

    f'{key}={value!r}' for key, value in key_values

                     ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/models/wheel.py", line 33

    f"{filename} is not a valid wheel filename."

                                               ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/cli/cmdoptions.py", line 49

    msg = f'{option} error: {msg}'

                                 ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/cli/parser.py", line 84

    description = f'{label}:\n{description}\n'

                                             ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/cli/base_command.py", line 57

    'prog': f'{get_prog()} {name}',

                                 ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/cli/main_parser.py", line 86

    msg = [f'unknown command "{cmd_name}"']

                                         ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/cli/progress_bars.py", line 155

    return f"eta {self.eta_td}"  # type: ignore

                              ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/cli/main.py", line 60

    sys.stderr.write(f"ERROR: {exc}")

                                   ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/operations/install/legacy.py", line 71

    f"Running setup.py install for {req_name}"

                                             ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/operations/install/wheel.py", line 363

    f'pip{get_major_minor_version()} = {pip_script}'

                                                   ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/operations/freeze.py", line 56

    yield f'-f {link}'

                     ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/operations/build/wheel_legacy.py", line 26

    text = f'Command arguments: {command_desc}\n'

                                                ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/operations/build/metadata_legacy.py", line 29

    f"No .egg-info directory found in {directory}"

                                                 ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/operations/build/wheel.py", line 37

    f'Building wheel for {name} (PEP 517)'

                                         ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/req/req_install.py", line 229

    s += f' (from {comes_from})'

                               ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/req/__init__.py", line 29

    return f"InstallationResult(name={self.name!r})"

                                                   ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/req/req_file.py", line 204

    line_source = f'line {line.lineno} of {line.filename}'

                                                         ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/req/constructors.py", line 113

    if url.lower().startswith(f'{version_control}:'):

                                                  ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/resolution/resolvelib/factory.py", line 429

    req_disp = f'{req} (from {parent.name})'

                                           ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/resolution/resolvelib/requirements.py", line 125

    return f"Python {self.specifier}"

                                    ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/resolution/resolvelib/candidates.py", line 91

    line = f"{project_name} @ {template.link.url}"

                                                 ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/vcs/git.py", line 156

    raise ValueError(f'unexpected show-ref line: {line!r}')

                                                         ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/vcs/versioncontrol.py", line 72

    req = f'{repo_url}@{rev}#egg={egg_project_name}'

                                                   ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/index/collector.py", line 450

    _handle_get_page_fail(link, f"connection error: {exc}")

                                                         ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/index/package_finder.py", line 164

    return (False, f'yanked for reason: {reason}')

                                                ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/exceptions.py", line 219

    return f'    {self._requirement_name()}'

                                           ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/commands/configuration.py", line 224

    env_var = f'PIP_{key.upper()}'

                                 ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/commands/cache.py", line 157

    results.append(f' - {wheel} ({size})')

                                        ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/commands/debug.py", line 70

    f'pip._vendor.{module_name}',

                               ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/commands/help.py", line 35

    msg = [f'unknown command "{cmd_name}"']

                                         ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/distributions/sdist.py", line 55

    f'{installed} is incompatible with {wanted}'

                                               ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/distributions/base.py", line 14

    class AbstractDistribution(metaclass=abc.ABCMeta):

                                        ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/locations.py", line 107

    assert not (user and prefix), f"user={user} prefix={prefix}"

                                                               ^

SyntaxError: invalid syntax

 

  File "build/bdist.macosx-10.14-intel/egg/pip/_internal/self_outdated_check.py", line 184

    pip_cmd = f"{sys.executable} -m pip"

                                       ^

SyntaxError: invalid syntax

 

creating /Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg

Extracting pip-21.0.1-py2.7.egg to /Library/Python/2.7/site-packages

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/configuration.py", line 167

    raise ConfigurationError(f"No such key - {key}")

                                                  ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/exceptions.py", line 219

    return f'    {self._requirement_name()}'

                                           ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/locations.py", line 107

    assert not (user and prefix), f"user={user} prefix={prefix}"

                                                               ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/self_outdated_check.py", line 184

    pip_cmd = f"{sys.executable} -m pip"

                                       ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/network/auth.py", line 202

    ), f"Could not load credentials from url: {original_url}"

                                                            ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/network/session.py", line 321

    msg = f'adding trusted host: {host!r}'

                                         ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/network/lazy_wheel.py", line 193

    headers['Range'] = f'bytes={start}-{end}'

                                            ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/utils/logging.py", line 123

    prefix = f"{self.formatTime(record)} "

                                         ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/utils/misc.py", line 117

    return f"{sys.executable} -m pip"

                                    ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/utils/direct_url_helpers.py", line 91

    hash = f"{hash_name}={link.hash}"

                                    ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/utils/temp_dir.py", line 154

    f"Attempted to access deleted path: {self._path}"

                                                    ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/utils/pkg_resources.py", line 27

    e.reason += f" in {name} file"

                                 ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/utils/compatibility_tags.py", line 119

    return f"{implementation}{version}"

                                      ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/utils/hashes.py", line 88

    f'Unknown hash name: {hash_name}'

                                    ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/utils/wheel.py", line 60

    p for p in wheel_zip.namelist() if p.startswith(f"{info_dir}/")

                                                                 ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/utils/unpacking.py", line 276

    f'Cannot determine archive format of {location}'

                                                   ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/models/link.py", line 86

    rp = f' (requires-python:{self.requires_python})'

                                                    ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/models/direct_url.py", line 49

    raise DirectUrlValidationError(f"{key} must have a value")

                                                            ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/models/target_python.py", line 89

    f'{key}={value!r}' for key, value in key_values

                     ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/models/wheel.py", line 33

    f"{filename} is not a valid wheel filename."

                                               ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/cli/cmdoptions.py", line 49

    msg = f'{option} error: {msg}'

                                 ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/cli/parser.py", line 84

    description = f'{label}:\n{description}\n'

                                             ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/cli/base_command.py", line 57

    'prog': f'{get_prog()} {name}',

                                 ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/cli/main_parser.py", line 86

    msg = [f'unknown command "{cmd_name}"']

                                         ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/cli/progress_bars.py", line 155

    return f"eta {self.eta_td}"  # type: ignore

                              ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/cli/main.py", line 60

    sys.stderr.write(f"ERROR: {exc}")

                                   ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/operations/freeze.py", line 56

    yield f'-f {link}'

                     ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/operations/install/legacy.py", line 71

    f"Running setup.py install for {req_name}"

                                             ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/operations/install/wheel.py", line 363

    f'pip{get_major_minor_version()} = {pip_script}'

                                                   ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/operations/build/wheel_legacy.py", line 26

    text = f'Command arguments: {command_desc}\n'

                                                ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/operations/build/metadata_legacy.py", line 29

    f"No .egg-info directory found in {directory}"

                                                 ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/operations/build/wheel.py", line 37

    f'Building wheel for {name} (PEP 517)'

                                         ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/req/req_install.py", line 229

    s += f' (from {comes_from})'

                               ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/req/__init__.py", line 29

    return f"InstallationResult(name={self.name!r})"

                                                   ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/req/req_file.py", line 204

    line_source = f'line {line.lineno} of {line.filename}'

                                                         ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/req/constructors.py", line 113

    if url.lower().startswith(f'{version_control}:'):

                                                  ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/resolution/resolvelib/factory.py", line 429

    req_disp = f'{req} (from {parent.name})'

                                           ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/resolution/resolvelib/requirements.py", line 125

    return f"Python {self.specifier}"

                                    ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/resolution/resolvelib/candidates.py", line 91

    line = f"{project_name} @ {template.link.url}"

                                                 ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/vcs/git.py", line 156

    raise ValueError(f'unexpected show-ref line: {line!r}')

                                                         ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/vcs/versioncontrol.py", line 72

    req = f'{repo_url}@{rev}#egg={egg_project_name}'

                                                   ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/index/collector.py", line 450

    _handle_get_page_fail(link, f"connection error: {exc}")

                                                         ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/index/package_finder.py", line 164

    return (False, f'yanked for reason: {reason}')

                                                ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/commands/configuration.py", line 224

    env_var = f'PIP_{key.upper()}'

                                 ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/commands/cache.py", line 157

    results.append(f' - {wheel} ({size})')

                                        ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/commands/debug.py", line 70

    f'pip._vendor.{module_name}',

                               ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/commands/help.py", line 35

    msg = [f'unknown command "{cmd_name}"']

                                         ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/distributions/sdist.py", line 55

    f'{installed} is incompatible with {wanted}'

                                               ^

SyntaxError: invalid syntax

 

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/distributions/base.py", line 14

    class AbstractDistribution(metaclass=abc.ABCMeta):

                                        ^

SyntaxError: invalid syntax

 

Adding pip 21.0.1 to easy-install.pth file

Installing pip script to /usr/local/bin

Installing pip2.7 script to /usr/local/bin

Installing pip2 script to /usr/local/bin

 

Installed /Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg

Processing dependencies for pip

Finished processing dependencies for pip

192:~ wangjing$ pip -V

Traceback (most recent call last):

  File "/usr/local/bin/pip", line 9, in <module>

    load_entry_point('pip==21.0.1', 'console_scripts', 'pip')()

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 565, in load_entry_point

    return get_distribution(dist).load_entry_point(group, name)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2697, in load_entry_point

    return ep.load()

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2370, in load

    return self.resolve()

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2376, in resolve

    module = __import__(self.module_name, fromlist=['__name__'], level=0)

  File "/Library/Python/2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/cli/main.py", line 60

    sys.stderr.write(f"ERROR: {exc}")

                                   ^

SyntaxError: invalid syntax

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

2条回答 默认 最新

  • 已采纳
    wyz1987 朝夕wyz 2021-04-20 00:34

    将Pycharm的版本改成3.9以后,详情请看:https://ask.csdn.net/questions/7418503?expend=true,sudo easy_install pip ,这个命令貌似成功了,不再出现上面的错误了。通过pip -V也可以显示出来:pip 20.3.4 from /Users/wangjing/PycharmProjects/pythonProject/WyzQuant/venv/lib/python2.7/site-packages/pip (python 2.7)

    点赞 评论 复制链接分享
  • PY0312 Nick Peng 2021-04-19 17:25

    用阿里的镜像源试试

    index-url = https://mirrors.aliyun.com/pypi/simple

    点赞 评论 复制链接分享

相关推荐