• 1401/10/08

مشکل در نصب pygame :

با سلام

در زمان نصب pygame با ارور زیر روبرو میشم

ممنون میشم راهنمایی کنید

C:\Users\Nima>pip install pygame
Defaulting to user installation because normal site-packages is not writeable
Collecting pygame
  Using cached pygame-2.1.2.tar.gz (10.1 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [92 lines of output]


      WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
      Using WINDOWS configuration...

      Traceback (most recent call last):
        File "C:\Users\Nima\AppData\Roaming\Python\Python311\site-packages\urllib3\connection.py", line 174, in _new_conn
          conn = connection.create_connection(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Nima\AppData\Roaming\Python\Python311\site-packages\urllib3\util\connection.py", line 95, in create_connection
          raise err
        File "C:\Users\Nima\AppData\Roaming\Python\Python311\site-packages\urllib3\util\connection.py", line 85, in create_connection
          sock.connect(sa)
      TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "C:\Users\Nima\AppData\Roaming\Python\Python311\site-packages\urllib3\connectionpool.py", line 703, in urlopen
          httplib_response = self._make_request(
                             ^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Nima\AppData\Roaming\Python\Python311\site-packages\urllib3\connectionpool.py", line 386, in _make_request
          self._validate_conn(conn)
        File "C:\Users\Nima\AppData\Roaming\Python\Python311\site-packages\urllib3\connectionpool.py", line 1042, in _validate_conn
          conn.connect()
        File "C:\Users\Nima\AppData\Roaming\Python\Python311\site-packages\urllib3\connection.py", line 358, in connect
          self.sock = conn = self._new_conn()
                             ^^^^^^^^^^^^^^^^
        File "C:\Users\Nima\AppData\Roaming\Python\Python311\site-packages\urllib3\connection.py", line 179, in _new_conn
          raise ConnectTimeoutError(
      urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.HTTPSConnection object at 0x00000194CA376C50>, 'Connection to www.libsdl.org timed out. (connect timeout=None)')

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "C:\Users\Nima\AppData\Roaming\Python\Python311\site-packages\requests\adapters.py", line 489, in send
          resp = conn.urlopen(
                 ^^^^^^^^^^^^^
        File "C:\Users\Nima\AppData\Roaming\Python\Python311\site-packages\urllib3\connectionpool.py", line 787, in urlopen
          retries = retries.increment(
                    ^^^^^^^^^^^^^^^^^^
        File "C:\Users\Nima\AppData\Roaming\Python\Python311\site-packages\urllib3\util\retry.py", line 592, in increment
          raise MaxRetryError(_pool, url, error or ResponseError(cause))
      urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.libsdl.org', port=443): Max retries exceeded with url: /release/SDL2-devel-2.0.18-VC.zip (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x00000194CA376C50>, 'Connection to www.libsdl.org timed out. (connect timeout=None)'))

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\Nima\AppData\Local\Temp\pip-install-w_fr6s79\pygame_6102683ba4544d4785c5fdac6bb1b658\setup.py", line 359, in <module>
          buildconfig.config.main(AUTO_CONFIG)
        File "C:\Users\Nima\AppData\Local\Temp\pip-install-w_fr6s79\pygame_6102683ba4544d4785c5fdac6bb1b658\buildconfig\config.py", line 225, in main
          deps = CFG.main(**kwds)
                 ^^^^^^^^^^^^^^^^
        File "C:\Users\Nima\AppData\Local\Temp\pip-install-w_fr6s79\pygame_6102683ba4544d4785c5fdac6bb1b658\buildconfig\config_win.py", line 497, in main
          and download_win_prebuilt.ask(**download_kwargs):
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Nima\AppData\Local\Temp\pip-install-w_fr6s79\pygame_6102683ba4544d4785c5fdac6bb1b658\buildconfig\download_win_prebuilt.py", line 290, in ask
          update(x86=x86, x64=x64)
        File "C:\Users\Nima\AppData\Local\Temp\pip-install-w_fr6s79\pygame_6102683ba4544d4785c5fdac6bb1b658\buildconfig\download_win_prebuilt.py", line 273, in update
          download_prebuilts(download_dir, x86=x86, x64=x64)
        File "C:\Users\Nima\AppData\Local\Temp\pip-install-w_fr6s79\pygame_6102683ba4544d4785c5fdac6bb1b658\buildconfig\download_win_prebuilt.py", line 124, in download_prebuilts
          download_sha1_unzip(url, checksum, temp_dir, 1)
        File "C:\Users\Nima\AppData\Local\Temp\pip-install-w_fr6s79\pygame_6102683ba4544d4785c5fdac6bb1b658\buildconfig\download_win_prebuilt.py", line 47, in download_sha1_unzip
          response = requests.get(url)
                     ^^^^^^^^^^^^^^^^^
        File "C:\Users\Nima\AppData\Roaming\Python\Python311\site-packages\requests\api.py", line 73, in get
          return request("get", url, params=params, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Nima\AppData\Roaming\Python\Python311\site-packages\requests\api.py", line 59, in request
          return session.request(method=method, url=url, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Nima\AppData\Roaming\Python\Python311\site-packages\requests\sessions.py", line 587, in request
          resp = self.send(prep, **send_kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Nima\AppData\Roaming\Python\Python311\site-packages\requests\sessions.py", line 701, in send
          r = adapter.send(request, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Nima\AppData\Roaming\Python\Python311\site-packages\requests\adapters.py", line 553, in send
          raise ConnectTimeout(e, request=request)
      requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='www.libsdl.org', port=443): Max retries exceeded with url: /release/SDL2-devel-2.0.18-VC.zip (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x00000194CA376C50>, 'Connection to www.libsdl.org timed out. (connect timeout=None)'))
      Making dir :prebuilt_downloads:
      Downloading... https://www.libsdl.org/release/SDL2-devel-2.0.18-VC.zip ed561079ec622b0bab5a9e02976f5d540b0622da

      ---
      For help with compilation see:
          https://www.pygame.org/wiki/CompileWindows
      To contribute to pygame development see:
          https://www.pygame.org/contribute.html
      ---

      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

 

  • 1401/10/08
  • ساعت 15:17

با سلام.

 

با توجه به توضیحاتی که در متن Error هست، مشکل از pip نیست و Timed out در حین دستیابی به Resource ها بوجود آمده، احتمالاً با VPN مشکل حل شود. لطفاً تست کنید.

 


logo-enamadlogo-samandehi