# Type object 'Dataset' has no attribute 'from\_pandas'

**URL:** <https://discuss.huggingface.co/t/type-object-dataset-has-no-attribute-from-pandas/36830>\
**Category:** 🤗Datasets\
**Created:** [April 17, 2023, 10:02am UTC](https://discuss.huggingface.co/t/type-object-dataset-has-no-attribute-from-pandas/36830 "2023-04-17T10:02:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Qwerty55](https://avatars.discourse-cdn.com/v4/letter/q/d2c977/32.png) [@Qwerty55](https://discuss.huggingface.co/u/Qwerty55)\
**Post date:** [April 17, 2023, 10:02am UTC](https://discuss.huggingface.co/t/type-object-dataset-has-no-attribute-from-pandas/36830/1 "2023-04-17T10:02:52Z")

</div>

I am trying to create a dataset from a `Pandas` dataframe,. follwoing [this](https://huggingface.co/docs/datasets/v2.11.0/tabular_load) documentation  
When I run the code:

```auto
from datasets import Dataset
my_dataset = Dataset.from_pandas(df['text','encodings'])

```

I get this error:

`AttributeError: type object 'Dataset' has no attribute 'from_pandas'`

I would like to know why I have this kind error.

---

<div class="post-metadata">

**Author:** ![mariosasko](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/mariosasko/32/31548_2.png) [@mariosasko](https://discuss.huggingface.co/u/mariosasko)\
**Post date:** [April 17, 2023, 12:57pm UTC](https://discuss.huggingface.co/t/type-object-dataset-has-no-attribute-from-pandas/36830/2 "2023-04-17T12:57:14Z")

</div>

Hi! Which version of `datasets` are you using? You can check this with:

```python
import datasets
print(datasets. __version__ )

```

---

<div class="post-metadata">

**Author:** ![Qwerty55](https://avatars.discourse-cdn.com/v4/letter/q/d2c977/32.png) [@Qwerty55](https://discuss.huggingface.co/u/Qwerty55)\
**Post date:** [April 17, 2023, 3:53pm UTC](https://discuss.huggingface.co/t/type-object-dataset-has-no-attribute-from-pandas/36830/3 "2023-04-17T15:53:33Z")

</div>

I am using `the 2.1.0` version

---

<div class="post-metadata">

**Author:** ![mariosasko](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/mariosasko/32/31548_2.png) [@mariosasko](https://discuss.huggingface.co/u/mariosasko)\
**Post date:** [April 17, 2023, 4:10pm UTC](https://discuss.huggingface.co/t/type-object-dataset-has-no-attribute-from-pandas/36830/4 "2023-04-17T16:10:59Z")

</div>

Version 2.1.0 comes with that method.

If no other code is in between `from datasets import Dataset` and `my_dataset = Dataset.from_pandas(df['text','encodings'])`, e.g., an import, such as Torch `Dataset`, that could overshadow HF `Dataset`, something is off with your environment, so it’s best to delete it and create a new one.
