Reputation: 313
I am currently using Python 2.7 and Numpy 1.6.2. I want to use the numpy.polyfit()
function with the weights parameter. However, it seems that the weights parameter is not available in numpy 1.6.2. The Sourceforge download link shows 1.6.2 as being the latest version. I have found the updated polynomial.py
file which includes the weights parameter for the polyfit()
function. I simply replaced my current polynomial.py
with the updated one on the website. However, when I try to run my Python program, I get the error:
Traceback (most recent call last):
File "C:\Python27\first.py", line 13, in <module>
import matplotlib
File "C:\Python27\lib\site-packages\matplotlib\__init__.py", line 133, in <module>
from matplotlib.rcsetup import (defaultParams,
File "C:\Python27\lib\site-packages\matplotlib\rcsetup.py", line 19, in <module>
from matplotlib.colors import is_color_like
File "C:\Python27\lib\site-packages\matplotlib\colors.py", line 52, in <module>
import numpy as np
File "C:\Python27\lib\site-packages\numpy\__init__.py", line 153, in <module>
import polynomial
File "C:\Python27\lib\site-packages\numpy\polynomial\__init__.py", line 18, in <module>
from polynomial import Polynomial
ImportError: cannot import name Polynomial
first.py
is simply the file with all my code I'm trying to run
What am I doing wrong? Is there another way to simply get the newest version of Numpy (1.7?) ?
Thank you for your help!
Upvotes: 2
Views: 1536
Reputation: 157484
There are two files called polynomial.py
in NumPy; lib/polynomial.py
and polynomial/polynomial.py
. You've replaced the wrong one.
I'm not aware of any development builds of 1.7.x for Windows; if you're comfortable with building packages yourself then you can download the source using git and build it per instructions from https://github.com/numpy/numpy/blob/master/doc/HOWTO_RELEASE.rst.txt and linked resources.
Upvotes: 2