Closed nf78 closed 5 years ago
Hey @nf78, thanks for your interest. I am going to guess you are running the repository code directly rather than installing the library through pip
, am I correct?
If so, the Cython code for the decision tree is not yet compiled, and hence that module cannot be found. You can fix this by running this command python setup.py build_ext --inplace
(you need to have Cython and a C compiler for this).
Let me know if this fixes the issue :) If so I will update the readme to include these steps
Thanks for your quick reply!
I did installed the library using pip, however I need to mention I'm using Windows 10, in case this helps.
On the other hand, I have successfully tried this:
1.- downloaded the repository
2.- run the command: python setup.py build_ext --inplace
3.- copied the content to the folder C:\Users\
Unfortunately, now I get the error:
Exception: PMML model does not contain MiningModel.
Which seems to be an unsupported feature, that is included in the PMML file I'm trying to load?
I don't have access to a windows machine, so that will make testing a bit difficult. However, its clearly still an issue with the cython extensions not compiling. As far as I'm aware, pip should always run the setup, which should automatically build all required components.
Could you maybe share the output of pip install sklearn-pmml-model
?
Thanks for your quick reply!
I did installed the library using pip, however I need to mention I'm using Windows 10, in case this helps.
On the other hand, I have successfully tried this:
1.- downloaded the repository
2.- run the command: python setup.py build_ext --inplace
3.- copied the content to the folder C:\Users
Here is the output of the pip install sklearn-pmml-model:
Collecting sklearn_pmml_model
Requirement already satisfied: scipy in c:\users
Ok I was able to reproduce the issue on a windows machine. Turns out that, for some reason, pip on Windows will download a copy of the uncompiled source into the directory you run pip install. Python will import from that uncompiled directory rather than the one that was properly built and put into you site-packages directory. When I remove this directory I was able to import and use the library just fine.
I will investigate why the copy is made, and try to prevent it in the next release.
@nf78 I just released a new version (0.0.9) that solves this issue for my Windows setup. Could you test if this resolves this issue for you too? The best way to test is to uninstall the library first and make sure any 'sklearn_pmml_model' directories are removed, then install the library through pip.
@iamDecode thanks for the new release, I can confirm I have successfully tested the library, with a new pip install of the new version 0.0.9 (after full removal of any 'sklearn_pmml_model' directories and pip uninstall)
@nf78 I just released a new version (0.0.9) that solves this issue for my Windows setup. Could you test if this resolves this issue for you too? The best way to test is to uninstall the library first and make sure any 'sklearn_pmml_model' directories are removed, then install the library through pip.
Hi. I have sklearn-pmml-model 0.0.14.1 on my pc and still get this error message: from sklearn_pmml_model.tree._tree import Tree, NODE_DTYPE, TREE_LEAF, TREE_UNDEFINED ModuleNotFoundError: No module named 'sklearn_pmml_model.tree._tree'
HELP!!!!!!
@Aliciathefrog sorry I wasn't able to get back to you any sooner. I've tried to run the library on Windows 10 (64bit) and was not able to reproduce the error you reported. Can you make sure that you indeed installed the latest version with pip, and have up to date version of sklearn, numpy and pandas? If that doesn't help, please share the exact versions of the libraries you are using (use the command: pip freeze
) and some details about the OS (windows? 32 or 64 bit?), then I'll do my best to help you find the problem.
Hi,
I have installed all dependencies from requirements.txt in a virtualenv, but when trying to run the "minimal working example" code from the README.md, I get this error message:
Traceback (most recent call last): File "test.py", line 6, in
from sklearn_pmml_model.ensemble import PMMLForestClassifier
File "C:\GitKraken\errors-processor\sklearn_pmml_model\ensemble__init.py", line 6, in
from .forest import PMMLForestClassifier
File "C:\GitKraken\errors-processor\sklearn_pmml_model\ensemble\forest.py", line 3, in
from sklearn_pmml_model.tree._tree import Tree, NODE_DTYPE
File "C:\GitKraken\errors-processor\sklearn_pmml_model\tree\ init__.py", line 6, in
from .tree import PMMLTreeClassifier, construct_tree
File "C:\GitKraken\errors-processor\sklearn_pmml_model\tree\tree.py", line 4, in
from sklearn_pmml_model.tree._tree import Tree, NODE_DTYPE, TREE_LEAF, TREE_UNDEFINED
ModuleNotFoundError: No module named 'sklearn_pmml_model.tree._tree'