Cannot move past Import numpy & pandas - AttributeError: module 'numpy' has no attribute 'ndarray'

Viewed 1308

I have been taking online classes and have not done much with my own environment. I realized something was going on when I could not complete a jupyter notebook. Then I went into Sublime text 3 and Bash, which revealed the same. I have done much of what can be found on this site and others. Uninstalling/reinstalling, conda route, pip route. I am at a loss.

Here the the code that I have as testing:

import numpy as np
import pandas as pd

This is the log from the build:

Traceback (most recent call last):
  File "C:\Users\me\Google Drive Ethos\Personal\Codeacademy\Ok Cupid\dating_skeleton.py", line 2, in <module>
    import pandas as pd
  File "C:\Users\me\Anaconda3\envs\cleanpy_1\lib\site-packages\pandas\__init__.py", line 22, in <module>
    from pandas.compat.numpy import (
  File "C:\Users\me\Anaconda3\envs\cleanpy_1\lib\site-packages\pandas\compat\__init__.py", line 15, in <module>
    from pandas._typing import F
  File "C:\Users\me\Anaconda3\envs\cleanpy_1\lib\site-packages\pandas\_typing.py", line 39, in <module>
    AnyArrayLike = TypeVar("AnyArrayLike", "ExtensionArray", "Index", "Series", np.ndarray)
AttributeError: module 'numpy' has no attribute 'ndarray'
[Finished in 0.2s with exit code 1]
1 Answers

Try to update your pip

python -m pip install --upgrade pip
Related