実現したいこと
Python勉強中で、地図みたいなのを作ってみたいと思い
pyechartsをインストールしたい。
発生している問題・分からないこと
ググったりしてるのですが、原因がわからず困っています。
コマンドプロンプト→ pip install pyecharts
エラーメッセージ
error
1ERROR: Exception: 2Traceback (most recent call last): 3 File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\Lib\site-packages\pip\_vendor\urllib3\response.py", line 438, in _error_catcher 4 yield 5 File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\Lib\site-packages\pip\_vendor\urllib3\response.py", line 561, in read 6 data = self._fp_read(amt) if not fp_closed else b"" 7 ^^^^^^^^^^^^^^^^^^ 8 File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\Lib\site-packages\pip\_vendor\urllib3\response.py", line 527, in _fp_read 9 return self._fp.read(amt) if amt is not None else self._fp.read() 10 ^^^^^^^^^^^^^^^^^^ 11 File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\Lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 98, in read 12 data: bytes = self.__fp.read(amt) 13 ^^^^^^^^^^^^^^^^^^^ 14 File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\Lib\http\client.py", line 473, in read 15 s = self.fp.read(amt) 16 ^^^^^^^^^^^^^^^^^ 17 File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\Lib\socket.py", line 706, in readinto 18 return self._sock.recv_into(b) 19 ^^^^^^^^^^^^^^^^^^^^^^^ 20 File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\Lib\ssl.py", line 1314, in recv_into 21 return self.read(nbytes, buffer) 22 ^^^^^^^^^^^^^^^^^^^^^^^^^ 23 File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\Lib\ssl.py", line 1166, in read 24 return self._sslobj.read(len, buffer) 25 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 26TimeoutError: The read operation timed out 27 28During handling of the above exception, another exception occurred: 29 30Traceback (most recent call last): 31 File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\Lib\site-packages\pip\_internal\cli\base_command.py", line 180, in exc_logging_wrapper 32 status = run_func(*args) 33 ^^^^^^^^^^^^^^^ 34 File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\Lib\site-packages\pip\_internal\cli\req_command.py", line 245, in wrapper 35 return func(self, options, args) 36 ^^^^^^^^^^^^^^^^^^^^^^^^^ 37 File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\Lib\site-packages\pip\_internal\commands\install.py", line 377, in run 38 requirement_set = resolver.resolve( 39 ^^^^^^^^^^^^^^^^^ 40 File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\Lib\site-packages\pip\_internal\resolution\resolvelib\resolver.py", line 179, in resolve 41 self.factory.preparer.prepare_linked_requirements_more(reqs) 42 File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\Lib\site-packages\pip\_internal\operations\prepare.py", line 552, in prepare_linked_requirements_more 43 self._complete_partial_requirements( 44 File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\Lib\site-packages\pip\_internal\operations\prepare.py", line 467, in _complete_partial_requirements 45 for link, (filepath, _) in batch_download: 46 File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\Lib\site-packages\pip\_internal\network\download.py", line 183, in __call__ 47 for chunk in chunks: 48 File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\Lib\site-packages\pip\_internal\cli\progress_bars.py", line 53, in _rich_progress_bar 49 for chunk in iterable: 50 File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\Lib\site-packages\pip\_internal\network\utils.py", line 63, in response_chunks 51 for chunk in response.raw.stream( 52 File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\Lib\site-packages\pip\_vendor\urllib3\response.py", line 622, in stream 53 data = self.read(amt=amt, decode_content=decode_content) 54 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 55 File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\Lib\site-packages\pip\_vendor\urllib3\response.py", line 560, in read 56 with self._error_catcher(): 57 File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\Lib\contextlib.py", line 158, in __exit__ 58 self.gen.throw(typ, value, traceback) 59 File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\Lib\site-packages\pip\_vendor\urllib3\response.py", line 443, in _error_catcher 60 raise ReadTimeoutError(self._pool, None, "Read timed out.") 61pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
該当のソースコード
C:\Users\(個人名)>pip install pyecharts Collecting pyecharts Using cached pyecharts-2.0.7-py3-none-any.whl.metadata (1.4 kB) Collecting jinja2 (from pyecharts) Using cached jinja2-3.1.4-py3-none-any.whl.metadata (2.6 kB) Collecting prettytable (from pyecharts) Downloading prettytable-3.12.0-py3-none-any.whl.metadata (30 kB) Collecting simplejson (from pyecharts) Downloading simplejson-3.19.3-cp311-cp311-win_amd64.whl.metadata (3.2 kB) Collecting MarkupSafe>=2.0 (from jinja2->pyecharts) Downloading MarkupSafe-3.0.2-cp311-cp311-win_amd64.whl.metadata (4.1 kB) Collecting wcwidth (from prettytable->pyecharts) Downloading wcwidth-0.2.13-py2.py3-none-any.whl.metadata (14 kB) Downloading pyecharts-2.0.7-py3-none-any.whl (151 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0.0/151.0 kB ? eta -:--:--
試したこと・調べたこと
- teratailやGoogle等で検索した
- ソースコードを自分なりに変更した
- 知人に聞いた
- その他
上記の詳細・結果
フォルダを変更したり、CMD起動方法を変えても同じだった。
補足
特になし
TimeoutError なので、そのときちょっとネットワークに問題があったとかでダウンロードに失敗したとかの可能性があります。
同じコマンドを何度か実行してみて、それでも同じエラーになるかを確認してみてください。
コメントありがとうございます。
何度か実行しても、同じくTimeourErrorですね、、なのでほかの問題なのかなと思いまして・・
ブラウザで
https://files.pythonhosted.org/
を叩いたら、「This site hosts packages ~」のページは表示されますか?それともエラーになりますか?
はい、下記メッセージが表示されましたね。
補足ですが、PIP~でインストールできるものと、できないものがあります。
This site hosts packages and documentation uploaded by authors of packages on the Python Package Index.
Legal Notice
The Python Software Foundation ("PSF") does not claim ownership of any third-party code or content ("third party content") placed on the web site and has no obligation of any kind with respect to such third party content. Any third party content provided in connection with this web site is provided on a non-confidential basis. The PSF is free to use or disseminate such content on an unrestricted basis for any purpose, and third party content providers grant the PSF and all other users of the web site an irrevocable, worldwide, royalty-free, nonexclusive license to reproduce, distribute, transmit, display, perform, and publish such content, including in digital form.
Third party content providers represent and warrant that they have obtained the proper governmental authorizations for the export and reexport of any software or other content contributed to this web site by the third-party content provider, and further affirm that any United States-sourced cryptographic software is not intended for use by a foreign government end-user. Individuals and organizations are advised that the PyPI website is hosted in the US, with content delivery network points of presence as well as unofficial mirrors in several countries outside the US. Any uploads of packages must comply with United States export controls under the Export Administration Regulations.