EpistasisLab / EpistasisLab/tpot

Error using TPOT with numpy >= 1.24.0 (or fresh TPOT installs)

Open
#1,281 4 comments 4 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
10.1k
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

## Context of the issue

Newer releases of Numpy (and by extension, fresh installs of TPOT) are not compatible with the latest TPOT code and `requirements.txt`. Several deprecated numpy aliases are [removed in Numpy 1.24.0](https://numpy.org/doc/stable/release/1.24.0-notes.html#expired-deprecations), and _at least_ one (`numpy.float`) is still used in the TPOT code.

## Process to reproduce the issue

1. Install TPOT in a fresh Python environment (virtualenv)
`pip install -r requirements.txt`
2. Run the Python shell and import tpot
```
python
>>> import tpot
```
4. TPOT raises AttributeError
```python
Traceback (most recent call last):
File "", line 1, in
File "/Users/mark.forrer/Documents/code/tpot/tpot/__init__.py", line 27, in
from .tpot import TPOTClassifier, TPOTRegressor
File "/Users/mark.forrer/Documents/code/tpot/tpot/tpot.py", line 31, in
from .base import TPOTBase
File "/Users/mark.forrer/Documents/code/tpot/tpot/base.py", line 71, in
from .builtins import CombineDFs, StackingEstimator
File "/Users/mark.forrer/Documents/code/tpot/tpot/builtins/__init__.py", line 29, in
from .one_hot_encoder import OneHotEncoder, auto_select_categorical_features, _transform_selected
File "/Users/mark.forrer/Documents/code/tpot/tpot/builtins/one_hot_encoder.py", line 136, in
class OneHotEncoder(BaseEstimator, TransformerMixin):
File "/Users/mark.forrer/Documents/code/tpot/tpot/builtins/one_hot_encoder.py", line 216, in OneHotEncoder
def __init__(self, categorical_features='auto', dtype=np.float,
File "/Users/mark.forrer/.pyenv/versions/tpot/lib/python3.8/site-packages/numpy/__init__.py", line 284, in __getattr__
raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'float'
```

## Expected result

Successful TPOT import

## Current result

AtttributeError on TPOT import

## Possible fix

Document the requirement for numpy <1.24.0 until the TPOT code can be updated

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.