Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
221 views
in Technique[技术] by (71.8m points)

python - “Unable to locate finder for 'pip._vendor.distlib'” error when using "pip install virtualenv"

I am trying to install virtualenv with Python 3.6 version under Windows 10.When I run "pip install virtualenv" I'm getting this error. I am a newbie to Python.

Collecting virtualenv
  Downloading virtualenv-15.0.3-py2.py3-none-any.whl (3.5MB)
    100% |████████████████████████████████| 3.5MB 256kB/s
Installing collected packages: virtualenv
Exception:
Traceback (most recent call last):
  File "c:userscorey shawappdatalocalprogramspythonpython36libsite-packagespipasecommand.py", line 215, in main
    status = self.run(options, args)
  File "c:userscorey shawappdatalocalprogramspythonpython36libsite-packagespipcommandsinstall.py", line 317, in run
    prefix=options.prefix_path,
  File "c:userscorey shawappdatalocalprogramspythonpython36libsite-packagespip
eq
eq_set.py", line 742, in install
    **kwargs
  File "c:userscorey shawappdatalocalprogramspythonpython36libsite-packagespip
eq
eq_install.py", line 831, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "c:userscorey shawappdatalocalprogramspythonpython36libsite-packagespip
eq
eq_install.py", line 1032, in move_wheel_files
    isolated=self.isolated,
  File "c:userscorey shawappdatalocalprogramspythonpython36libsite-packagespipwheel.py", line 493, in move_wheel_files
    maker.make_multiple(['%s = %s' % kv for kv in console.items()])
  File "c:userscorey shawappdatalocalprogramspythonpython36libsite-packagespip\_vendordistlibscripts.py", line 383, in make_multiple
    filenames.extend(self.make(specification, options))
  File "c:userscorey shawappdatalocalprogramspythonpython36libsite-packagespip\_vendordistlibscripts.py", line 372, in make
    self._make_script(entry, filenames, options=options)
  File "c:userscorey shawappdatalocalprogramspythonpython36libsite-packagespip\_vendordistlibscripts.py", line 276, in _make_script
    self._write_script(scriptnames, shebang, script, filenames, ext)
  File "c:userscorey shawappdatalocalprogramspythonpython36libsite-packagespip\_vendordistlibscripts.py", line 212, in _write_script
    launcher = self._get_launcher('t')
  File "c:userscorey shawappdatalocalprogramspythonpython36libsite-packagespip\_vendordistlibscripts.py", line 351, in _get_launcher
    result = finder(distlib_package).find(name).bytes
  File "c:userscorey shawappdatalocalprogramspythonpython36libsite-packagespip\_vendordistlib
esources.py", line 324, in finder
    raise DistlibException('Unable to locate finder for %r' % package)
pip._vendor.distlib.DistlibException: Unable to locate finder for 'pip._vendor.distlib'
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
  1. uninstall current pip:

    python -m pip uninstall pip setuptools
    
  2. download get-pip.py from https://bootstrap.pypa.io/get-pip.py

  3. execute get-pip script:

    python get-pip.py
    

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...