question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

scikit-learn .libs directory error

See original GitHub issue

The execution of the code listed below result in this error:

Traceback (most recent call last):
File "D:\_DEV\BRANCH\C-LINK~1.0_L\C-2BEA~1\MAIN~1.DIS\main.py", line 5, in <module>
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "D:\_DEV\BRANCH\C-LINK~1.0_L\C-2BEA~1\MAIN~1.DIS\plotter.py", line 5, in <module plotter>
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "D:\_DEV\BRANCH\C-LINK~1.0_L\C-2BEA~1\MAIN~1.DIS\sklearn\__init__.py", line 80, in <module sklearn>
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "D:\_DEV\BRANCH\C-LINK~1.0_L\C-2BEA~1\MAIN~1.DIS\sklearn\_distributor_init.py", line 23, in <module sklearn._distributor_init>
  File "D:\_DEV\BRANCH\C-LINK~1.0_L\C-2BEA~1\MAIN~1.DIS\ctypes\__init__.py", line 374, in __init__
FileNotFoundError: Could not find module 'D:\_DEV\BRANCH\C-LINK~1.0_L\C-2BEA~1\MAIN~1.DIS\sklearn\.libs\vcomp140.dll' (or one of its dependencies). Try using the full path with constructor syntax.

The error message refer to a missing dll named vcomp140.dll but the entire sklearn\.lib directory is missing from the dist directory. I have tried to add manually the .libs directory from C:\Python39\Lib\site-packages\sklearn\.libs in main.dist\sklearn but when i run main.exe again it does not print nothing in stdout and the program exits immediatly .

0.7.7 Commercial: None Python: 3.9.6 (tags/v3.9.6:db3ff76, Jun 28 2021, 15:26:21) [MSC v.1929 64 bit (AMD64)] Flavor: Unknown Executable: C:\Python39\python.exe OS: Windows Arch: x86_64 WindowsRelease: 10

I installed from https://www.python.org/downloads/

I use pip and i dont use any virtual enviroment. Pip version: pip 22.0.4 from c:\python39\lib\site-packages\pip (python 3.9)

Some pip package version: numpy==1.22.3 pandas==1.4.1 scikit-learn==1.0.2 scipy==1.8.0 xgboost==1.6.0 imbalanced-learn==0.9.0

  • Short code example
from operator import index
import pandas as pd
from sklearn.ensemble import RandomForestClassifier,GradientBoostingClassifier,AdaBoostClassifier
from sklearn.svm import LinearSVC
from sklearn.model_selection import train_test_split as sklearn_train_test_split,GroupShuffleSplit
from imblearn.over_sampling  import RandomOverSampler, SMOTE
from imblearn.under_sampling import RandomUnderSampler
from imblearn.combine import SMOTETomek, SMOTEENN
from collections import Counter
from imblearn.ensemble import BalancedRandomForestClassifier
from numpy import zeros
from xgboost import XGBClassifier

print("Hello world")
  • Nuitka options used

python -m nuitka --enable-plugin=numpy --standalone main.py

EDIT After i copy the .libs directory in the dist path and try to debug the EXE with Visual Studio, i obtain this exception: Exception thrown at 0x00007FF76265EA03 in main.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
kayhayencommented, May 21, 2022

This is fixed in the current 0.8 release.

0reactions
kayhayencommented, Jun 1, 2022

@interseba5 posting below closed issues is a surefire way of getting ignored, this time I am pointing out the duplicate #1565

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python programming : sklearn library access denied to folder ...
Basically I get an error "Access is denied." I am guessing that this method call changes permission to directory scikit_learn_data on windows to ......
Read more >
Installing scikit-learn
Installing collected packages: scikit-learn ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: ...
Read more >
Advanced installation instructions - Scikit-learn
This builds the extension in place and creates a link to the development directory (see the pip docs):. pip install --editable . Note....
Read more >
An introduction to machine learning with scikit-learn
Section contents: In this section, we introduce the machine learning vocabulary that we use throughout scikit-learn and give a simple learning example.
Read more >
Frequently Asked Questions — scikit-learn 1.2.0 documentation
The problem is that Python multiprocessing does a fork system call without following it with an exec system call for performance reasons. Many...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found