Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: module 'numpy' has no attribute '__version__' #349

Closed
mehdiHadji opened this issue Dec 21, 2018 · 16 comments
Closed

AttributeError: module 'numpy' has no attribute '__version__' #349

mehdiHadji opened this issue Dec 21, 2018 · 16 comments

Comments

@mehdiHadji
Copy link

am getting the following error message when I attempt to import pandas:

import pandas
AttributeError: module 'numpy' has no attribute 'version'

Following is the full error message:
`---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
in
1 import numpy
----> 2 import pandas
3
4
5 print("hello")

C:\ProgramData\Anaconda3\lib\site-packages\pandas_init_.py in
21
22 # numpy compat
---> 23 from pandas.compat.numpy import *
24
25 try:

C:\ProgramData\Anaconda3\lib\site-packages\pandas\compat\numpy_init_.py in
8
9 # numpy versioning
---> 10 _np_version = np.version
11 _nlv = LooseVersion(_np_version)
12 _np_version_under1p10 = _nlv < LooseVersion('1.10')

AttributeError: module 'numpy' has no attribute 'version'`

@mehdiHadji
Copy link
Author

problem solved with :

1 - pip uninstall -y numpy
2 - pip uninstall -y setuptools
3 - pip install setuptools
4 - pip install numpy

@ressafri
Copy link

worked for me, thanks

@pintu4all
Copy link

Thank you very much. worked for me too

@ilyaas97
Copy link

This hasn't worked for me while running 'import Numpy as np', I as still getting the error
AttributeError: module 'numpy' has no attribute 'version'

@phenomenalDenzel
Copy link

This did not not also work for me on my pycharm. I am still getting the error
AttributeError: module 'numpy' has no attribute 'version'

@CapAllen
Copy link

Thx!

@Aakartion
Copy link

i have an error like this
AttributeError: module 'numpy' has no attribute 'zero'

@ravi7198
Copy link

still getting this
AttributeError: module 'numpy' has no attribute 'version'

@nitindoodhiya
Copy link

problem solved with :

1 - pip uninstall -y numpy
2 - pip uninstall -y setuptools
3 - pip install setuptools or conda install setuptools
4 - pip install bumpy or conda install numpy
Any one will work. Conda/pip

@juanaranguren
Copy link

Guys, this is strange.
I'm getting the error "Importing the numpy c-extensions failed." when running a Pycharm project and the error is raised when app tries to import pandas.

This is kind of funny, coz I'm actually running Jupyter Notebook scripts that use pandas and imports it with no issues.
Any clues on how to solve this will be more than welcome.

@Navjot-Kaur-DA
Copy link

AttributeError Traceback (most recent call last)
in
1 reg_with_pvalues = LinearRegression()
----> 2 reg_with_pvalues.fit(x,y)

in fit(self, X, y, n_jobs)
12 sse = np.sum((self.predict(X)- y) ** 2, axis = 0) / float(X.shape[0]-X.shape[1])
13
---> 14 se = np.array([np.sqrt(np.diagnol(sse*np.linalg.inv(np.dot(X.T,X))))])
15
16 self.t = self.coef_/se

~\anaconda3\lib\site-packages\numpy_init_.py in getattr(attr)
218 else:
219 raise AttributeError("module {!r} has no attribute "
--> 220 "{!r}".format(name, attr))
221
222 def dir():

AttributeError: module 'numpy' has no attribute 'diagnol'
http://localhost:8888/notebooks/Desktop/Navjot/Data%20science%20course/Data%20science%20course%20udmey%202020/Part_5_Advanced_Statistical_Methods_(Machine_Learning)/S34_L217/How%20to%20properly%20includ%20the%20pvalue%20working.ipynb#

@07Agarg
Copy link

07Agarg commented Oct 9, 2020

problem solved with :

1 - pip uninstall -y numpy
2 - pip uninstall -y setuptools
3 - pip install setuptools
4 - pip install numpy

Worked for me too. Thanks!

@sooothkful
Copy link

thx

@prakhargurawa
Copy link

problem solved with :

1 - pip uninstall -y numpy
2 - pip uninstall -y setuptools
3 - pip install setuptools or conda install setuptools
4 - pip install bumpy or conda install numpy
Any one will work. Conda/pip

This solution worked!!

@LatLongCoder
Copy link

AttributeError Traceback (most recent call last)
in
----> 1 import pandas as pd
2 data = pd.read_csv ("F:\python\csv")
3 data

~\AppData\Roaming\Python\Python38\site-packages\pandas_init_.py in
20
21 # numpy compat
---> 22 from pandas.compat.numpy import (
23 _np_version_under1p14,
24 _np_version_under1p15,

~\AppData\Roaming\Python\Python38\site-packages\pandas\compat\numpy_init_.py in
7
8 # numpy versioning
----> 9 _np_version = np.version
10 _nlv = LooseVersion(_np_version)
11 _np_version_under1p14 = _nlv < LooseVersion("1.14")

AttributeError: module 'numpy' has no attribute 'version'

@shivaavvari
Copy link

Thanks ! this still works for me

@ipython ipython locked as resolved and limited conversation to collaborators Jun 7, 2021
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