py-earth
py-earth copied to clipboard
Installation of pyearth with python 3.8.10
Good evening I tried to install pyearth with pip3 install sklearn-contrib-py-earth but I got errors. I have installed sklearn with pip3 install -U scikit-learn without problem. What can I do ? How can I install pyearth on python 3.8 ? Thank you to help me. Excuse my bad english (I am french). P. Grandeau
@pgr123 Have you tried building it directly from source? I always have good luck with that. Assuming you are using anaconda in the default location, it would be:
git clone -b issue191 https://github.com/jcrudy/py-earth.git
cd py-earth && ${HOME}/anaconda3/bin/python setup.py -q install --cythonize
rm -Rf ${HOME}/anaconda3/bin/pyearth && mv pyearth ${HOME}/anaconda3/bin/
This project is largely abandoned, and the pip release is out of date. There is a branch here that seems to work for most folks: https://github.com/scikit-learn-contrib/py-earth/issues/210#issuecomment-874390577
This project is largely abandoned, and the pip release is out of date. There is a branch here that seems to work for most folks: #210 (comment)
Are there any reasons for it being abandoned other than time cost to update the package?
@jhogg11 The main author has largely abandoned the project. However, there is nothing to stop someone from forking the repo and taking up the reins
Thank you for your responses. I know the "pip install git+https://github.com/scikit-learn-contrib/[email protected]". It worked with Python 3.8 but it does not work with Python 3.10 (and then with the new Ubuntu 22.04). I don't know why !
@pgr123 Haven't tried it on 3.10 but I can confirm it does work on 3.9. If you want to try it on 3.10, the following code may work for you:
git clone https://github.com/jcrudy/py-earth.git
cd py-earth
python setup.py build_ext --inplace --cythonize
mv pyearth path/to/site-packages/python3.9/site-packages
@pgr123 Haven't tried it on 3.10 but I can confirm it does work on 3.9. If you want to try it on 3.10, the following code may work for you:
git clone https://github.com/jcrudy/py-earth.git cd py-earth python setup.py build_ext --inplace --cythonize mv pyearth path/to/site-packages/python3.9/site-packages
I'm also using 3.9 and this works for me. Thank you!
Thank you but that does not work. I got many errors like : error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’? error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’? error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
and at the end I got : error: Command "x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/lib/python3/dist-packages/numpy/core/include -I/usr/include/python3.10 -c pyearth/_util.c -o build/temp.linux-x86_64-3.10/pyearth/_util.o" failed with exit status 1
Do you think there is a solution ? Have a good day.
@pgr123 the project has been abandoned so if you are dead set on using py-earth then my suggestion would be to use python 3.8 or 3.9
It's a pity ! So, there is no mean to uses MARS (earth) with Python ? And else, how can I downgrade to Python 3.9 ? Thank you.
The problem seems to be with Python 3.10. I installed Python 3.9 but when I try python3.9 -m pip install git+https://github.com/scikit-learn-contrib/[email protected]" I get an error : No module named distutils.cmd I don't know what to do ! That new version of Ubuntu with python 3.10 (bugged) is very difficult and for me, it seems unusable and take me a lot of time. So I think there is for me only one solution : go back to Ubuntu 20.04 which works perfectly !!!! Thank you but that new version is not usable, I'll wait the version 22.04.5 or 22.04.6 !!!!!!!
Even Spyder does not work with Ubuntu 22.04.1 and Python 3.10 !
@pgr123 Haven't tried it on 3.10 but I can confirm it does work on 3.9. If you want to try it on 3.10, the following code may work for you:
git clone https://github.com/jcrudy/py-earth.git cd py-earth python setup.py build_ext --inplace --cythonize mv pyearth path/to/site-packages/python3.9/site-packages
does this work when I'm installing pyEarth on a virtual environment? (i.e a Django environment)
How can I install py-earth on a virtual environment ? I never used virtual environment and I don't know what Django is. Thank you. Have a good day.
The update to Spyder 5.4.0 works with Ubuntu 22.04.1 and Python 3.10.6 but I have actually no solution for py-earth. Someone know how to do a earth model ( MARS : Multivariate Adaptive Regression Splines) with Python under Python 3.10 ? Thank you.
@vea-therese it installs fine using pipenv, so I see no reason why it wouldn’t install in other virtual environment setups
@vea-therese it installs fine using pipenv, so I see no reason why it wouldn’t install in other virtual environment setups
I've tried pip install and cloning but it still won't work. Though I haven't tried downgrading my python version, I currently have 3.10
@vea-therese Others have mentioned it won’t install properly on 3.10 but should install fine on <= 3.9
That is true but how can I change the Python 3.10 do downgrade to Python 3.9. And I must reinstall all my python packages and the problem is that Ubuntu 22.04.1 use Python 3.10.6 so it is used by the OS and I cannot change it. What can I do ? Thank you.
@vea-therese Others have mentioned it won’t install properly on 3.10 but should install fine on <= 3.9
I downgraded my global python to 3.7, it still didn't work. I tried 3.7 because I was able to install pyearth in a conda environment with a 3.7 python weeks ago. That's why I'm wondering if it is possible to connect a virtual environment or the Django project into my conda environment with pyearth.
That is true but how can I change the Python 3.10 do downgrade to Python 3.9. And I must reinstall all my python packages and the problem is that Ubuntu 22.04.1 use Python 3.10.6 so it is used by the OS and I cannot change it. What can I do ? Thank you.
if you're using conda, I just typed: conda install python=3.7 or 3.9 since that's the version that you prefer.
Though if you're referring to the global python, I just uninstalled the 3.10 and installed 3.7. I use Windows, I'm not familiar with Ubuntu.
Thank you, I don't use conda. Maybe, I must install it (or anaconda) but I don't know how install and use it on Ubuntu. And is it sure that py-earth will work with it ? Seen the big changes in Python 3.10, I think it should have been called Python 4 (LOL !)
I downgraded my global python to 3.7, it still didn't work. I tried 3.7 because I was able to install pyearth in a conda environment with a 3.7 python weeks ago. That's why I'm wondering if it is possible to connect a virtual environment or the Django project into my conda environment with pyearth.
@vea-therese Here is a code snippet to try to install it in a virtual environment.
git clone https://github.com/jcrudy/py-earth.git
cd py-earth
pipenv run $(pipenv --venv)/bin/python setup.py build_ext --inplace --cythonize
mv pyearth $(pipenv --venv)/lib/python3.9/site-packages
If that doesn't work, this docker image may help you install py-earth into a virtual environment: https://gitlab.com/gitlab-data/data-science
Thank you, I'll try that tomorrow.
I forgot to thank u @kevin-dietz it worked! We're now presenting our thesis.
Good morning,
I managed to compile py-earth with Python 3.10.
After
git clone https://github.com/jcrudy/py-earth.git
cd py-earth
and we must modify the files utils.c and types.c and changes the "exc_" with "curexc_".
Then the compilation works and the packages works in Python 3.10 !!!! Good news ! And no need of virtual environment !
Thanks to all. Have a good day.
Good morning, I managed to compile py-earth with Python 3.10. After git clone https://github.com/jcrudy/py-earth.git cd py-earth and we must modify the files utils.c and types.c and changes the "exc_" with "curexc_". Then the compilation works and the packages works in Python 3.10 !!!! Good news ! And no need of virtual environment ! Thanks to all. Have a good day.
Thank you! Just an addition, I had to replace "exc_" with "curexc_" for the other .c files as well and using python setup.py install --cythonize
I downgraded my global python to 3.7, it still didn't work. I tried 3.7 because I was able to install pyearth in a conda environment with a 3.7 python weeks ago. That's why I'm wondering if it is possible to connect a virtual environment or the Django project into my conda environment with pyearth.
@vea-therese Here is a code snippet to try to install it in a virtual environment.
git clone https://github.com/jcrudy/py-earth.git cd py-earth pipenv run $(pipenv --venv)/bin/python setup.py build_ext --inplace --cythonize mv pyearth $(pipenv --venv)/lib/python3.9/site-packages
If that doesn't work, this docker image may help you install py-earth into a virtual environment: https://gitlab.com/gitlab-data/data-science
@kevin-dietz the analytics image in your repo seems based on Python 3.7. What is the minor version of 3.9 or cython version you have to make it work? I could not compile on Linux based system. Thanks.
@vancities we have stopped supporting py-earth in our image because the package has not been updated in 5.5 years.
I succeeded in running py-earth with Python 3.10 with few modifs and it works well ! If somebody want to know how to do, tell me. Excuse my bad English. Pascal