4

To install scikit-multilearn, I have tried the following commands with no luck:

conda install scikit-multilearn

or,

conda install -c condo-forge scikit-multilearn

The official website of scikit-multilearn propose using pip:

pip install scikit-multilearn

How should I install a python package when I don't find it on Anaconda repository? Would it be OK if I use pip occasionally, while my default package manager is conda?

niedakh
  • 2,819
  • 2
  • 20
  • 19
Sahar
  • 741
  • 1
  • 8
  • 14
  • In general, you should use conda whenever possible, even from a different channel (especially a well-supported channel like conda-forge). See here: https://stackoverflow.com/a/45919845/2449192 for one reason one (disclaimer, that's my answer) – darthbith Aug 28 '17 at 14:30

5 Answers5

4

It's fine for you to use pip along with conda. It's made to work this way. You have to be aware that not every package is on conda but only on pip. If you do conda env export > environment.yml, you will see that there is a mix of conda packages and pip.

Dat Tran
  • 2,368
  • 18
  • 25
  • Re: "It's made to work this way" -> Not necessarily, see here: https://stackoverflow.com/a/45919845/2449192 (disclaimer, that's my answer) – darthbith Aug 28 '17 at 14:29
  • @darthbith the sentence was just to indicate that pip is also able to work along with conda but you're right with your remark:) – Dat Tran Aug 29 '17 at 07:03
4

I eventually installed scikit-multilearn using pip:

pip install scikit-multilearn

However, I got the following import error while trying to import it:

ImportError: No module named builtins

To solve this, I upgraded the future package:

$pip install future --upgrade

Then, I successfully imported scikit-multilearn.

Sahar
  • 741
  • 1
  • 8
  • 14
2

The mentioned command

conda install scikit-multilearn

is correct and has a successful result, if Anaconda has already installed.

Cindy
  • 568
  • 7
  • 20
  • I had Anaconda installed and updated. But as I mentioned above, I eventually had to upgrade the future package. I'm not really sure why it was needed. – Sahar Sep 05 '18 at 21:55
  • skmultilearn is not available on condo yet. See @Edwin above answer which work well. – abdoulsn Aug 11 '20 at 21:35
2

You can effectively install scikit-multilearn in a Conda environment using PIP doing this

import sys

! {sys.executable} -m pip install scikit-multilearn

! {sys.executable} -m pip install liac-arff

I installed and tested it in a Jupyter Notebook by Anaconda

C. S.
  • 103
  • 1
  • 7
1

How should I install a python package when I don't find it on Anaconda repository?

pip install <package-name>

Would it be OK if I use pip occasionally, while my default package manager is conda?

Yes, it is totally fine. When you use import, the package will be found irrespective of the means of installation; conda or pip.

If you want to install a package for future use, or for more than a single project, you might want to install it into the root environment. This will allow you to import the package any time. If you are using it for a specific project, and probably just once, create a new virtual environment, install the required packages in that environment and run your code within it.

Creating a virtual environment: Link

SajidSalim
  • 359
  • 6
  • 19