Based on existing information, I've successfully installed HDBSCAN package in my conda virtual environment using conda install -c conda-forge hdbscan
However, when I try to run this code import hdbscan
It says:
(p.s. before that I typed in 'python' to allow it identify 'import'like this
is that correct?)
I'm using the environment created via Anaconda Navigator 'Project' and my interpreter is the correct one I think:
2. Also, do I have to use env created in anaconda in order to use command like 'conda install' (instead of pip install)? Can I use the virtual environment that I created by myself with the corresponding interpreter like this one?
I've tried 'pip install hdbscan' and fails, 'conda install' works. So naturally I'm expecting that importing hdbscan module should be smooth.
When you install the library with Conda, it is installed in a virtual environment. It seems you didn't activate the environment when trying to import hdbscan. You can activate it with the command conda activate
. Then you can call python and your import as you did.
I think you should look at the documentation to have a complete explanation for the second part. But a short is that, when you use the command conda install
, it install the librairy in the environment that is activate. So you have to use env created in anaconda in order to use command like 'conda install'
You can use conda environment created by the command conda create
or created by vscode