我是初学者,无法在 PyCharm (M2 MacOS Ventura) 上安装某些特定的软件包,我收到错误

问题描述 投票:0回答:1

命令和以下错误:

(venv) user@Users-Air VIRTUAL INTERVIEW % source /Users/user/Downloads/VIRTUAL INTERVIEW/venv/bin/activate
pip install MeCab==0.996.3
source: no such file or directory: /Users/user/Downloads/VIRTUAL
Collecting MeCab==0.996.3
  Using cached mecab-0.996.3.tar.gz (62 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [14 lines of output]
      /bin/sh: mecab-config: command not found
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/wv/x5b4jqk542lcfctckpt1dkch0000gn/T/pip-install-8u_gf6tb/mecab_3d4bee3e91b04c7fad7d04ba20e36dce/setup.py", line 53, in <module>
          include_dirs=cmd2("mecab-config --inc-dir"),
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/wv/x5b4jqk542lcfctckpt1dkch0000gn/T/pip-install-8u_gf6tb/mecab_3d4bee3e91b04c7fad7d04ba20e36dce/setup.py", line 19, in cmd2
          return cmd1(strings).split()
                 ^^^^^^^^^^^^^
        File "/private/var/folders/wv/x5b4jqk542lcfctckpt1dkch0000gn/T/pip-install-8u_gf6tb/mecab_3d4bee3e91b04c7fad7d04ba20e36dce/setup.py", line 15, in cmd1
          return os.popen(strings).readlines()[0].rstrip()
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
      IndexError: list index out of range
      [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.

我尝试仅单击 PyCharm 提供的默认按钮来安装软件包,但出现错误,它建议我在终端中运行该命令,这就是结果。

python macos package pycharm
1个回答
0
投票

我认为你的问题是 VIRTUAL 和 INTERVIEW 单词之间的空白。

请尝试以下命令

source /Users/user/Downloads/VIRTUAL\ INTERVIEW/venv/bin/activate && pip install MeCab==0.996.3
© www.soinside.com 2019 - 2024. All rights reserved.