Python3.7のpipでライブラリのインストールが出来ない
最初、ensurepipにて、pipをインストールしました。
それからpipでライブラリをインストールのコマンドを実施した所、その時、pipをアップグレードしてくださいとの表記が出たので、その表記通りに、pipをアップグレードしました。
pipのその他のコマンド(listなど)は、正常に動作します。
pipコマンドのinstallを実施すると、下記のエラーが出て、ライブラリのインストールが出来ない状況です。(下記は、pyinstallerをインストールしようとした時のものです。その他のライブラリの時も、同じエラーで、KeyError: 'ライブラリ名'となり、それ以外は同様のエラーメッセージとなります。)
発生している問題・エラーメッセージ
C:\Users\user1>python -m pip install pyinstaller ERROR: Exception: Traceback (most recent call last): File "C:\Users\user1\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 171, in _merge_into_criterion crit = self.state.criteria[name] KeyError: 'pyinstaller' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\user1\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\_internal\cli\base_command.py", line 189, in _main status = self.run(options, args) File "C:\Users\user1\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\_internal\cli\req_command.py", line 178, in wrapper return func(self, options, args) File "C:\Users\user1\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\_internal\commands\install.py", line 317, in run reqs, check_supported_wheels=not options.target_dir File "C:\Users\user1\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\_internal\resolution\resolvelib\resolver.py", line 122, in resolve requirements, max_rounds=try_to_avoid_resolution_too_deep, File "C:\Users\user1\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 453, in resolve state = resolution.resolve(requirements, max_rounds=max_rounds) File "C:\Users\user1\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 318, in resolve name, crit = self._merge_into_criterion(r, parent=None) File "C:\Users\user1\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 173, in _merge_into_criterion crit = Criterion.from_requirement(self._p, requirement, parent) File "C:\Users\user1\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 82, in from_requirement if not cands: File "C:\Users\user1\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\_vendor\resolvelib\structs.py", line 124, in __bool__ return bool(self._sequence) File "C:\Users\user1\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 143, in __bool__ return any(self) File "C:\Users\user1\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 35, in _iter_built for version, func in infos: File "C:\Users\user1\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\_internal\resolution\resolvelib\factory.py", line 223, in iter_index_candidate_infos hashes=hashes, File "C:\Users\user1\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\_internal\index\package_finder.py", line 872, in find_best_candidate candidates = self.find_all_candidates(project_name) File "C:\Users\user1\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\_internal\index\package_finder.py", line 816, in find_all_candidates project_url, link_evaluator=link_evaluator, File "C:\Users\user1\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\_internal\index\package_finder.py", line 783, in process_project_url page_links = list(parse_links(html_page)) File "C:\Users\user1\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\_internal\index\collector.py", line 323, in wrapper_wrapper return list(fn(page)) File "C:\Users\user1\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\_internal\index\collector.py", line 337, in parse_links namespaceHTMLElements=False, File "C:\Users\user1\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\_vendor\html5lib\html5parser.py", line 45, in parse p = HTMLParser(tb, namespaceHTMLElements=namespaceHTMLElements) File "C:\Users\user1\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\_vendor\html5lib\html5parser.py", line 122, in __init__ getPhases(debug).items()} File "C:\Users\user1\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\_vendor\html5lib\_utils.py", line 156, in wrapped cache[key] = func(*args, **kwargs) File "C:\Users\user1\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\_vendor\html5lib\html5parser.py", line 426, in getPhases class Phase(with_metaclass(getMetaclass(debug, log))): File "C:\Users\user1\AppData\Local\Programs\Python\Python37\lib\site-packages\pip\_vendor\six.py", line 851, in __new__ resolved_bases = types.resolve_bases(bases) AttributeError: module 'types' has no attribute 'resolve_bases'
試したこと
pipの前に-m や pipの後ろの3を付けたり、最後に--userを追記したりして、インストール実施してみました。
また、setuptoolsやeasy_installをアップグレードしてみましたが、上述のエラーとなります。
補足情報(FW/ツールのバージョンなど)
Python 3.7.0a2
pip 21.0.1 from C:\Users\user1\AppData\Local\Programs\Python\Python37\lib\site-packages\pip (python 3.7)
回答1件
あなたの回答
tips
プレビュー