Author Topic: ModuleNotFoundError: No module named 'sklearn'  (Read 30 times)

Haomin

  • Newbie
  • *
  • Posts: 6
ModuleNotFoundError: No module named 'sklearn'
« on: August 08, 2018, 08:49:19 PM »
Dear OVITO users,

I am trying to import scikit-learn in my python script in Ovito. However, it seems that the module is not included and I get an error "ModuleNotFoundError: No module named 'sklearn'". Do you have any suggestions about which directory should I put the package under?

Thanks,
Haomin

Alexander Stukowski

  • Administrator
  • Sr. Member
  • *****
  • Posts: 435
Re: ModuleNotFoundError: No module named 'sklearn'
« Reply #1 on: August 09, 2018, 08:50:43 AM »
Dear Haomin,

The Python interpreter shipping with OVITO doesn't come with the scikit-learn module. Only numpy is included. Thus, you need to install the module as described in the manual here:

http://ovito.org/manual/python/introduction/running.html#third-party-python-modules

Please run this command from the terminal:
Code: [Select]
ovitos -m pip install scipy scikit-learn

if you are using OVITO 2.9.0, you may encounter a pip connection error due to an expired SSL certificate in the Python interpreter. In this case, please upgrade to the current development release of OVITO 3.0.

-Alex

Haomin

  • Newbie
  • *
  • Posts: 6
Re: ModuleNotFoundError: No module named 'sklearn'
« Reply #2 on: August 09, 2018, 07:37:08 PM »
Dear Alex,

Thanks for your instruction. It works successfully now.

Haomin