pip install error on local python and also azure ML studio
**Hey, so I'm trying to install this packages but keep getting some errors and solution I've found online didn't work.
When I'm trying to install it locally on Python 3.9.12 with pip install top2vec I'm getting following error:**
pip install top2vec Collecting top2vec Using cached top2vec-1.0.27-py3-none-any.whl (25 kB) Collecting umap-learn>=0.5.1 Using cached umap_learn-0.5.3-py3-none-any.whl Collecting gensim>=4.0.0 Using cached gensim-4.2.0-cp39-cp39-win_amd64.whl (23.9 MB) Collecting wordcloud Using cached wordcloud-1.8.2.2-cp39-cp39-win_amd64.whl (153 kB) Collecting hdbscan>=0.8.27 Using cached hdbscan-0.8.28.tar.gz (5.2 MB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing wheel metadata ... done Collecting numpy>=1.20.0 Using cached numpy-1.23.1-cp39-cp39-win_amd64.whl (14.7 MB) Collecting pandas Using cached pandas-1.4.3-cp39-cp39-win_amd64.whl (10.6 MB) Collecting smart-open>=1.8.1 Using cached smart_open-6.0.0-py3-none-any.whl (58 kB) Collecting scipy>=0.18.1 Using cached scipy-1.9.0-cp39-cp39-win_amd64.whl (38.6 MB) Collecting Cython==0.29.28 Using cached Cython-0.29.28-py2.py3-none-any.whl (983 kB) Collecting scikit-learn>=0.20 Using cached scikit_learn-1.1.2-cp39-cp39-win_amd64.whl (7.4 MB) Collecting joblib>=1.0 Using cached joblib-1.1.0-py2.py3-none-any.whl (306 kB) Collecting threadpoolctl>=2.0.0 Using cached threadpoolctl-3.1.0-py3-none-any.whl (14 kB) Collecting numba>=0.49 Using cached numba-0.56.0-cp39-cp39-win_amd64.whl (2.5 MB) Collecting pynndescent>=0.5 Using cached pynndescent-0.5.7-py3-none-any.whl Requirement already satisfied: tqdm in c:\users\maciej.mical\miniconda3\lib\site-packages (from umap-learn>=0.5.1->top2vec) (4.63.0) Collecting llvmlite<0.40,>=0.39.0dev0 Using cached llvmlite-0.39.0-cp39-cp39-win_amd64.whl (23.2 MB) Collecting numpy>=1.20.0 Using cached numpy-1.22.4-cp39-cp39-win_amd64.whl (14.7 MB) Requirement already satisfied: setuptools in c:\users\maciej.mical\miniconda3\lib\site-packages (from numba>=0.49->umap-learn>=0.5.1->top2vec) (61.2.0) Collecting pytz>=2020.1 Using cached pytz-2022.1-py2.py3-none-any.whl (503 kB) Collecting python-dateutil>=2.8.1 Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB) Requirement already satisfied: six>=1.5 in c:\users\maciej.mical\miniconda3\lib\site-packages (from python-dateutil>=2.8.1->pandas->top2vec) (1.16.0) Requirement already satisfied: colorama in c:\users\maciej.mical\miniconda3\lib\site-packages (from tqdm->umap-learn>=0.5.1->top2vec) (0.4.4) Collecting matplotlib Using cached matplotlib-3.5.3-cp39-cp39-win_amd64.whl (7.2 MB) Collecting pillow Using cached Pillow-9.2.0-cp39-cp39-win_amd64.whl (3.3 MB) Collecting packaging>=20.0 Using cached packaging-21.3-py3-none-any.whl (40 kB) Collecting cycler>=0.10 Using cached cycler-0.11.0-py3-none-any.whl (6.4 kB) Collecting kiwisolver>=1.0.1 Using cached kiwisolver-1.4.4-cp39-cp39-win_amd64.whl (55 kB) Collecting pyparsing>=2.2.1 Using cached pyparsing-3.0.9-py3-none-any.whl (98 kB) Collecting fonttools>=4.22.0 Using cached fonttools-4.34.4-py3-none-any.whl (944 kB) Building wheels for collected packages: hdbscan Building wheel for hdbscan (PEP 517) ... error ERROR: Command errored out with exit status 1: command: 'C:\Users\maciej.mical\Miniconda3\python.exe' 'C:\Users\maciej.mical\Miniconda3\lib\site-packages\pip_vendor\pep517\in_process_in_process.py' build_wheel 'C:\Users\MACIEJ~1.MIC\AppData\Local\Temp\tmp740xdm7_' cwd: C:\Users\maciej.mical\AppData\Local\Temp\pip-install-pupan2m0\hdbscan_b725561c3c114c67ba29deb75faf248c Complete output (40 lines): running bdist_wheel running build running build_py creating build creating build\lib.win-amd64-cpython-39 creating build\lib.win-amd64-cpython-39\hdbscan copying hdbscan\flat.py -> build\lib.win-amd64-cpython-39\hdbscan copying hdbscan\hdbscan_.py -> build\lib.win-amd64-cpython-39\hdbscan copying hdbscan\plots.py -> build\lib.win-amd64-cpython-39\hdbscan copying hdbscan\prediction.py -> build\lib.win-amd64-cpython-39\hdbscan copying hdbscan\robust_single_linkage_.py -> build\lib.win-amd64-cpython-39\hdbscan copying hdbscan\validity.py -> build\lib.win-amd64-cpython-39\hdbscan copying hdbscan_init_.py -> build\lib.win-amd64-cpython-39\hdbscan creating build\lib.win-amd64-cpython-39\hdbscan\tests copying hdbscan\tests\test_flat.py -> build\lib.win-amd64-cpython-39\hdbscan\tests copying hdbscan\tests\test_hdbscan.py -> build\lib.win-amd64-cpython-39\hdbscan\tests copying hdbscan\tests\test_prediction_utils.py -> build\lib.win-amd64-cpython-39\hdbscan\tests copying hdbscan\tests\test_rsl.py -> build\lib.win-amd64-cpython-39\hdbscan\tests copying hdbscan\tests_init_.py -> build\lib.win-amd64-cpython-39\hdbscan\tests running build_ext cythoning hdbscan/_hdbscan_tree.pyx to hdbscan_hdbscan_tree.c C:\Users\maciej.mical\AppData\Local\Temp\pip-build-env-q_8gx9ie\overlay\Lib\site-packages\Cython\Compiler\Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: C:\Users\maciej.mical\AppData\Local\Temp\pip-install-pupan2m0\hdbscan_b725561c3c114c67ba29deb75faf248c\hdbscan_hdbscan_tree.pyx tree = Parsing.p_module(s, pxd, full_module_name) cythoning hdbscan/_hdbscan_linkage.pyx to hdbscan_hdbscan_linkage.c C:\Users\maciej.mical\AppData\Local\Temp\pip-build-env-q_8gx9ie\overlay\Lib\site-packages\Cython\Compiler\Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: C:\Users\maciej.mical\AppData\Local\Temp\pip-install-pupan2m0\hdbscan_b725561c3c114c67ba29deb75faf248c\hdbscan_hdbscan_linkage.pyx tree = Parsing.p_module(s, pxd, full_module_name) cythoning hdbscan/_hdbscan_boruvka.pyx to hdbscan_hdbscan_boruvka.c C:\Users\maciej.mical\AppData\Local\Temp\pip-build-env-q_8gx9ie\overlay\Lib\site-packages\Cython\Compiler\Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: C:\Users\maciej.mical\AppData\Local\Temp\pip-install-pupan2m0\hdbscan_b725561c3c114c67ba29deb75faf248c\hdbscan_hdbscan_boruvka.pyx tree = Parsing.p_module(s, pxd, full_module_name) cythoning hdbscan/_hdbscan_reachability.pyx to hdbscan_hdbscan_reachability.c C:\Users\maciej.mical\AppData\Local\Temp\pip-build-env-q_8gx9ie\overlay\Lib\site-packages\Cython\Compiler\Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: C:\Users\maciej.mical\AppData\Local\Temp\pip-install-pupan2m0\hdbscan_b725561c3c114c67ba29deb75faf248c\hdbscan_hdbscan_reachability.pyx tree = Parsing.p_module(s, pxd, full_module_name) cythoning hdbscan/_prediction_utils.pyx to hdbscan_prediction_utils.c C:\Users\maciej.mical\AppData\Local\Temp\pip-build-env-q_8gx9ie\overlay\Lib\site-packages\Cython\Compiler\Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: C:\Users\maciej.mical\AppData\Local\Temp\pip-install-pupan2m0\hdbscan_b725561c3c114c67ba29deb75faf248c\hdbscan_prediction_utils.pyx tree = Parsing.p_module(s, pxd, full_module_name) cythoning hdbscan/dist_metrics.pyx to hdbscan\dist_metrics.c C:\Users\maciej.mical\AppData\Local\Temp\pip-build-env-q_8gx9ie\overlay\Lib\site-packages\Cython\Compiler\Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: C:\Users\maciej.mical\AppData\Local\Temp\pip-install-pupan2m0\hdbscan_b725561c3c114c67ba29deb75faf248c\hdbscan\dist_metrics.pxd tree = Parsing.p_module(s, pxd, full_module_name) building 'hdbscan._hdbscan_tree' extension error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
ERROR: Failed building wheel for hdbscan Failed to build hdbscan ERROR: Could not build wheels for hdbscan which use PEP 517 and cannot be installed directly
I also tried to do the same on azure ML studio with no success either. Herre the error is:
Requirement already satisfied: top2vec in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (1.0.27) Requirement already satisfied: hdbscan>=0.8.27 in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (from top2vec) (0.8.28) Requirement already satisfied: wordcloud in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (from top2vec) (1.8.1) Requirement already satisfied: pandas in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (from top2vec) (1.1.5) Requirement already satisfied: numpy>=1.20.0 in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (from top2vec) (1.23.1) Requirement already satisfied: gensim>=4.0.0 in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (from top2vec) (4.2.0) Requirement already satisfied: umap-learn>=0.5.1 in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (from top2vec) (0.5.3) Requirement already satisfied: scikit-learn>=0.20 in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (from hdbscan>=0.8.27->top2vec) (0.22.1) Requirement already satisfied: scipy>=1.0 in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (from hdbscan>=0.8.27->top2vec) (1.5.2) Requirement already satisfied: cython>=0.27 in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (from hdbscan>=0.8.27->top2vec) (0.29.17) Requirement already satisfied: joblib>=1.0 in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (from hdbscan>=0.8.27->top2vec) (1.1.0) Requirement already satisfied: pillow in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (from wordcloud->top2vec) (6.2.1) Requirement already satisfied: matplotlib in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (from wordcloud->top2vec) (3.2.1) Requirement already satisfied: python-dateutil>=2.7.3 in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (from pandas->top2vec) (2.8.2) Requirement already satisfied: pytz>=2017.2 in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (from pandas->top2vec) (2019.3) Requirement already satisfied: smart-open>=1.8.1 in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (from gensim>=4.0.0->top2vec) (1.9.0) Requirement already satisfied: tqdm in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (from umap-learn>=0.5.1->top2vec) (4.64.0) Requirement already satisfied: numba>=0.49 in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (from umap-learn>=0.5.1->top2vec) (0.53.1) Requirement already satisfied: pynndescent>=0.5 in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (from umap-learn>=0.5.1->top2vec) (0.5.7) Requirement already satisfied: kiwisolver>=1.0.1 in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (from matplotlib->wordcloud->top2vec) (1.4.2) Requirement already satisfied: cycler>=0.10 in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (from matplotlib->wordcloud->top2vec) (0.11.0) Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (from matplotlib->wordcloud->top2vec) (3.0.9) Requirement already satisfied: six>=1.5 in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (from python-dateutil>=2.7.3->pandas->top2vec) (1.16.0) Requirement already satisfied: boto>=2.32 in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (from smart-open>=1.8.1->gensim>=4.0.0->top2vec) (2.49.0) Requirement already satisfied: requests in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (from smart-open>=1.8.1->gensim>=4.0.0->top2vec) (2.27.1) Requirement already satisfied: boto3 in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (from smart-open>=1.8.1->gensim>=4.0.0->top2vec) (1.20.19) Requirement already satisfied: llvmlite<0.37,>=0.36.0rc1 in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (from numba>=0.49->umap-learn>=0.5.1->top2vec) (0.36.0) Requirement already satisfied: setuptools in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (from numba>=0.49->umap-learn>=0.5.1->top2vec) (49.6.0) Requirement already satisfied: certifi>=2017.4.17 in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (from requests->smart-open>=1.8.1->gensim>=4.0.0->top2vec) (2022.5.18.1) Requirement already satisfied: charset-normalizer~=2.0.0; python_version >= "3" in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (from requests->smart-open>=1.8.1->gensim>=4.0.0->top2vec) (2.0.12) Requirement already satisfied: urllib3<1.27,>=1.21.1 in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (from requests->smart-open>=1.8.1->gensim>=4.0.0->top2vec) (1.26.9) Requirement already satisfied: idna<4,>=2.5; python_version >= "3" in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (from requests->smart-open>=1.8.1->gensim>=4.0.0->top2vec) (3.3) Requirement already satisfied: s3transfer<0.6.0,>=0.5.0 in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (from boto3->smart-open>=1.8.1->gensim>=4.0.0->top2vec) (0.5.2) Requirement already satisfied: botocore<1.24.0,>=1.23.19 in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (from boto3->smart-open>=1.8.1->gensim>=4.0.0->top2vec) (1.23.19) Requirement already satisfied: jmespath<1.0.0,>=0.7.1 in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (from boto3->smart-open>=1.8.1->gensim>=4.0.0->top2vec) (0.10.0) Note: you may need to restart the kernel to use updated packages.
ModuleNotFoundError Traceback (most recent call last) Input In [20], in <cell line: 2>() 1 get_ipython().run_line_magic('pip', 'install top2vec') ----> 2 from top2vec import Top2Vec
File /anaconda/envs/azureml_py38/lib/python3.8/site-packages/top2vec/init.py:1, in
File /anaconda/envs/azureml_py38/lib/python3.8/site-packages/top2vec/Top2Vec.py:7, in
File /anaconda/envs/azureml_py38/lib/python3.8/site-packages/gensim/init.py:11, in
File /anaconda/envs/azureml_py38/lib/python3.8/site-packages/gensim/models/init.py:7, in
File /anaconda/envs/azureml_py38/lib/python3.8/site-packages/gensim/models/coherencemodel.py:37, in
File /anaconda/envs/azureml_py38/lib/python3.8/site-packages/gensim/topic_coherence/probability_estimation.py:11, in
File /anaconda/envs/azureml_py38/lib/python3.8/site-packages/gensim/topic_coherence/text_analysis.py:20, in
File /anaconda/envs/azureml_py38/lib/python3.8/site-packages/gensim/models/word2vec.py:203, in
ModuleNotFoundError: No module named 'smart_open.compression'
The only solution that worked for a couple of people online is using conda install but we're not allowed to use conda in our company, it's totally blocked as we are heavily requlated bank. Doesn any one have any idea hwo to solve that please.
@mmical99 Did you have a solution for this issue? Thank you
Same problem here with AzureML. Has anyone solved this ?