首頁  >  問答  >  主體

為什麼我無法在Python中安裝btree模組

PS C:\Users\MY PC> pip install btree

    Collecting btree   Using cached btree-0.2.1.tar.gz (40 kB)   Installing build dependencies ... done   Getting requirements to build wheel ... error   error: subprocess-exited-with-error
         × Getting requirements to build wheel did not run successfully.   │ exit code: 1   ╰─> [35 lines of output]
          Traceback (most recent call last):
            File "C:\Users\MY PC\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
              main()
            File "C:\Users\MY PC\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
              json_out['return_val'] = hook(**hook_input['kwargs'])
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "C:\Users\MY PC\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
              return hook(config_settings)
                     ^^^^^^^^^^^^^^^^^^^^^
            File "C:\Users\MY PC\AppData\Local\Temp\pip-build-env-vs7__ft_\overlay\Lib\site-packages\setuptools\build_meta.py", line 341, in get_requires_for_build_wheel
              return self._get_build_requires(config_settings, requirements=['wheel'])
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "C:\Users\MY PC\AppData\Local\Temp\pip-build-env-vs7__ft_\overlay\Lib\site-packages\setuptools\build_meta.py", line 323, in _get_build_requires
              self.run_setup()
            File "C:\Users\MY PC\AppData\Local\Temp\pip-build-env-vs7__ft_\overlay\Lib\site-packages\setuptools\build_meta.py", line 488, in run_setup
              self).run_setup(setup_script=setup_script)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "C:\Users\MY PC\AppData\Local\Temp\pip-build-env-vs7__ft_\overlay\Lib\site-packages\setuptools\build_meta.py", line 338, in run_setup
              exec(code, locals())
            File "<string>", line 6, in <module>
            File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
            File "<frozen importlib._bootstrap>", line 1140, in _find_and_load_unlocked
            File "<frozen importlib._bootstrap>", line 1080, in _find_spec
            File "<frozen importlib._bootstrap_external>", line 1504, in find_spec
            File "<frozen importlib._bootstrap_external>", line 1476, in _get_spec
            File "<frozen zipimport>", line 169, in find_spec
            File "<frozen importlib._bootstrap>", line 435, in spec_from_loader
            File "<frozen importlib._bootstrap_external>", line 798, in spec_from_file_location
            File "<frozen zipimport>", line 228, in get_filename
            File "<frozen zipimport>", line 766, in _get_module_code
            File "<frozen zipimport>", line 695, in _compile_source
            File "paver-minilib.zip\paver\tasks.py", line 69
              print output
              ^^^^^^^^^^^^
          SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
    
    
      note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error
    
    × Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output.

這是我在終端機中遇到的錯誤。

我試圖安裝 btree 模組,但安裝不正確

P粉649990163P粉649990163183 天前462

全部回覆(1)我來回復

  • P粉115840076

    P粉1158400762024-04-01 14:54:22

    將您的版本更改為 2.7 因為您使用的套件使用 2.7 語法

    也嘗試使用 pip2 install

    #

    回覆
    0
  • 取消回覆