nltk MS Visual Studio C 和 C++ 在安装 pip 时构建失败,

5q4ezhmt  于 5个月前  发布在  其他
关注(0)|答案(2)|浏览(51)

没有提供描述。

wixjitnu

wixjitnu1#

在编译_regex.c时出现了错误,原因是clock_t和一些其他符号没有定义。这导致了后续处理过程中的连锁React。为了解决这个问题,可以尝试安装nltk库并重新编译。

首先,确保已经安装了Python和pip。然后,打开命令提示符或终端,运行以下命令:

pip install nltk

如果已经安装了nltk库,但仍然遇到问题,可以尝试卸载并重新安装:

pip uninstall nltk
pip install nltk

安装或重新安装nltk库后,再次尝试编译_regex.c。

pw9qyyiw

pw9qyyiw2#

为了绕过编译器包含错误,我观察了在使用WSL 2 Ubuntu 22.04时安装的软件包,然后为我正在使用的Windows 10 Python发行版发出pip install命令。以下是操作过程:

Fri 05/10/2024 13:46:29.17
 C:\Users\AverMedia>pip install click
 Collecting click
 Using cached click-8.1.7-py3-none-any.whl.metadata (3.0 kB)
 Collecting colorama (from click)
 Using cached colorama-0.4.6-py2.py3-none-any.whl.metadata (17 kB)
 Using cached click-8.1.7-py3-none-any.whl (97 kB)
 Using cached colorama-0.4.6-py2.py3-none-any.whl (25 kB)
 Installing collected packages: colorama, click
 Successfully installed click-8.1.7 colorama-0.4.6
Fri 05/10/2024 13:47:06.77
 C:\Users\AverMedia>pip install joblib
 Collecting joblib
 Using cached joblib-1.4.2-py3-none-any.whl.metadata (5.4 kB)
 Using cached joblib-1.4.2-py3-none-any.whl (301 kB)
 Installing collected packages: joblib
 Successfully installed joblib-1.4.2
Fri 05/10/2024 13:47:34.59
 C:\Users\AverMedia>pip install regex
 Collecting regex
 Downloading regex-2024.5.10.tar.gz (394 kB)
 ---------------------------------------- 394.8/394.8 kB 911.3 kB/s eta 0:00:00
 Installing build dependencies ... done
 Getting requirements to build wheel ... done
 Installing backend dependencies ... done
 Preparing metadata (pyproject.toml) ... done
 Building wheels for collected packages: regex
 Building wheel for regex (pyproject.toml) ... done
 Created wheel for regex: filename=regex-2024.5.10-cp313-cp313-win_amd64.whl size=268189 sha256=75b349b210635ead3f135c3ca2d7a32219c446e1944e340fb99dcb242a2a3c35
 Stored in directory: c:\users\avermedia\appdata\local\pip\cache\wheels\96\22\d2\26c086e3056a45edd3b04a2d18362e212188dd7e35d6ee1e94
 Successfully built regex
 Installing collected packages: regex
 Successfully installed regex-2024.5.10
Fri 05/10/2024 13:48:40.24
 C:\Users\AverMedia>pip install tqdm
 Collecting tqdm
 Using cached tqdm-4.66.4-py3-none-any.whl.metadata (57 kB)
 Requirement already satisfied: colorama in c:\users\avermedia\appdata\local\programs\python\python313\lib\site-packages (from tqdm) (0.4.6)
 Using cached tqdm-4.66.4-py3-none-any.whl (78 kB)
 Installing collected packages: tqdm
 Successfully installed tqdm-4.66.4
Fri 05/10/2024 13:49:11.74
 C:\Users\AverMedia>pip install nltk
 Collecting nltk
 Using cached nltk-3.8.1-py3-none-any.whl.metadata (2.8 kB)
 Requirement already satisfied: click in c:\users\avermedia\appdata\local\programs\python\python313\lib\site-packages (from nltk) (8.1.7)
 Requirement already satisfied: joblib in c:\users\avermedia\appdata\local\programs\python\python313\lib\site-packages (from nltk) (1.4.2)
 Requirement already satisfied: regex>=2021.8.3 in c:\users\avermedia\appdata\local\programs\python\python313\lib\site-packages (from nltk) (2024.5.10)
 Requirement already satisfied: tqdm in c:\users\avermedia\appdata\local\programs\python\python313\lib\site-packages (from nltk) (4.66.4)
 Requirement already satisfied: colorama in c:\users\avermedia\appdata\local\programs\python\python313\lib\site-packages (from click->nltk) (0.4.6)
 Using cached nltk-3.8.1-py3-none-any.whl (1.5 MB)
 Installing collected packages: nltk
 Successfully installed nltk-3.8.1
Fri 05/10/2024 13:49:44.53
 C:\Users\AverMedia>

相关问题