AttributeError module numpy has no attribute version

0 votes

Hi Guys, 

I have NumPy in my system. But I am not able to import the version function from the NumPy module. I got this bellow error.

from numpy import version
AttributeError: module 'numpy' has no attribute '__version__'

How can I solve this error?

Apr 20, 2020 in Python by akhtar
• 38,260 points
21,134 views

1 answer to this question.

0 votes

Hi@akhtar,

To avoid this error you can use the commands one by one.

  • Uninstall previous version of numpy and setuptools

$ pip uninstall -y numpy
$ pip uninstall -y setuptools
  • Reinstall latest version of numpy and setuptools

$ pip install setuptools
$ pip install numpy
answered Apr 20, 2020 by MD
• 95,460 points
Hi !

I have followed the commands and now I have setuptools-44.1.1 and numpy 1.16.6.

However I still get the error

File "/home/gg/.local/lib/python2.7/site-packages/statsmodels/compat/numpy.py", line 46, in <module>
    NP_LT_114 = LooseVersion(np.__version__) < LooseVersion('1.14')
AttributeError: 'module' object has no attribute '__version__'

I have struggled this for three days. Do you happen to know how to solve this?

Thanks,

Yiming

Hi,

I am using the latest version of Setuptools 47.3.1 and the latest version of Numpy 1.19.0. It is totally working fine in my system. If you are using Anaconda, then you can create a new environment and install the software.

Related Questions In Python

0 votes
1 answer

Getting AttributeError: 'module' object (scipy) has no attribute 'misc' in Python. How to solve this?

>>> import scipy >>> scipy.misc Traceback (most recent call ...READ MORE

answered Dec 24, 2018 in Python by Nymeria
• 3,560 points
9,430 views
0 votes
1 answer

Python error "AttributeError: '_Screen' object has no attribute 'mainloop'" python module turtle

Hey @Nagya, replace  wn.mainlopp() with turtle.mainloop() ...READ MORE

answered Jun 19, 2019 in Python by Faiza
7,246 views
+1 vote
1 answer

module 'numpy' has no attribute 'unit8'

Hi@akhtar, You have used unit8 in your code. ...READ MORE

answered Jun 23, 2020 in Python by MD
• 95,460 points
15,689 views
0 votes
1 answer

How to rename columns in pandas (Python)?

You can use the rename function in ...READ MORE

answered Apr 30, 2018 in Data Analytics by DeepCoder786
• 1,720 points

edited Jun 8, 2020 by MD 2,059 views
0 votes
1 answer

What is the Difference in Size and Count in pandas (python)?

The major difference is "size" includes NaN values, ...READ MORE

answered Apr 30, 2018 in Data Analytics by DeepCoder786
• 1,720 points

edited Jun 8, 2020 by Gitika 2,860 views
0 votes
2 answers

Replacing a row in pandas data.frame

key error. I love python READ MORE

answered Feb 18, 2019 in Data Analytics by anonymous
13,743 views
+1 vote
3 answers

AttributeError: 'module' object has no attribute 'listen"

You'll have to install the pyaudio module ...READ MORE

answered Oct 3, 2019 in Python by Liala
7,101 views
0 votes
1 answer

AttributeError: type object 'numpy.ndarray' has no attribute '__array_function__'

Hi@akhtar, I think numpy version is not compatible ...READ MORE

answered Apr 13, 2020 in Python by MD
• 95,460 points
14,720 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP