Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

Installation fails on python3.7 #204

Open
ChingzhiWU opened this issue Mar 12, 2020 · 7 comments
Open

Installation fails on python3.7 #204

ChingzhiWU opened this issue Mar 12, 2020 · 7 comments

Comments

@ChingzhiWU
Copy link

Dear @jcrudy

I tried several ways to install py-earth but all failed. I have Win10 and a python 3.7 environment.

Firstly, I used the git clone repository method to install, it gives me: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio". I don't want to install visual studio because it's too big (7GB)

Secondly, I used "conda install --channel "conda-forge" sklearn-contrib-py-earth" to install, it gives me: "An HTTP error occurred when trying to retrieve this URL."

Finally, I used I used the "sklearn_contrib_py_earth-0.1.0-cp36-cp36m-in_amd64" to install, it gives me: "ERROR: sklearn_contrib_py_earth-0.1.0-cp36-cp36m-win_amd64.whl is not a supported wheel on this platform."

I am using anaconda, and can you give me guidance on py-earth installation on python 3.7 environments?

Many Thanks

@RenTTing
Copy link

hey, i just solved this problem.
Go to the website :[(https://www.lfd.uci.edu/~gohlke/pythonlibs/)] , find the corresponding py-earth package according to your python version , you can download the package to the pkgs directory.
Switch Anaconda Prompt to the current path of the installation package, input pip install sklearn_contrib_py_earth-0.1.0-cp36-cp36m-win_amd64.whl(my version is 3.6),
In spyder compiler,then import the pyearth. you are done!

@sparkdoc
Copy link

sparkdoc commented Dec 10, 2020

or just clone the repo and replace
python setup.py install
with
python setup.py install --cythonize

see issue 191

@pzivich
Copy link

pzivich commented Sep 8, 2021

@sparkdoc the clone option does not work for me (Python 3.7.9, GCC 8.3.0, cython 0.29.24). The cythonize flag still returns the same traceback as trying to install from PyPI

pyearth/_util.c:8145:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
     tstate->exc_traceback = local_tb;
             ^~~~~~~~~~~~~
             curexc_traceback

@kevin-dietz
Copy link

@pzivich
have you tried

git clone -b issue191 git://github.com/jcrudy/py-earth.git
cd py-earth && python setup.py -q install --cythonize

@pzivich
Copy link

pzivich commented Sep 8, 2021

@kevin-dietz it looks like it installs (ignoring the warnings for unitialized vars or decprecated numpy API). However, when I try to import, I get the following error

>>> from pyearth import Earth
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/mnt/shared/code/PythonLibs/py-earth/pyearth/__init__.py", line 6, in <module>
    from .earth import Earth
  File "/mnt/shared/code/PythonLibs/py-earth/pyearth/earth.py", line 1, in <module>
    from ._forward import ForwardPasser
ModuleNotFoundError: No module named 'pyearth._forward'

@kevin-dietz
Copy link

@pzivich One of two issues come to mind. You may have to manually move the pyearth directory that the install creates (e.g. /Users/pzvivich)/py-earth/pyearth) into your python packages directory.

Or you could have installed it into the wrong python version. You can use the actual python path to be explicit -- e.g. /Users/pzivich/anaconda3/bin/python setup.py -q install --cythonize

@diffent
Copy link

diffent commented Dec 27, 2022

Regarding the below issue of "No module named pyearth._forward" ... I found a solution in stackoverflow somewhere. When you create the example script to test the py-earth build (as in the readme), do not put that example script in the py-earth folder, put it in your home dir or some other dir. Then run it from there.

@kevin-dietz it looks like it installs (ignoring the warnings for unitialized vars or decprecated numpy API). However, when I try to import, I get the following error

>>> from pyearth import Earth
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/mnt/shared/code/PythonLibs/py-earth/pyearth/__init__.py", line 6, in <module>
    from .earth import Earth
  File "/mnt/shared/code/PythonLibs/py-earth/pyearth/earth.py", line 1, in <module>
    from ._forward import ForwardPasser
ModuleNotFoundError: No module named 'pyearth._forward'

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants