简体   繁体   中英

Load Modules in Wing IDE

I am new to Python and am having trouble loading numpy in Wing IDE. I can load the module and use it fine in the command line but not in Wing IDE. Below is what I am seeing:

code:

import numpy as np

a=np.arange(15)

result:

[evaluate numpy.py] Traceback (most recent call last): File "C:\\Users[my name]\\Documents\\Python\\practice\\numpy.py", line 2, in 0 builtins.NameError: name 'arange' is not defined

I have also tried to use the help() command:

code:

help(np)

result:

Help on module numpy:

NAME numpy

FILE c:\\users[my name]\\documents\\python\\practice\\numpy.py

It is probably due to your code being in a file named numpy.py If you do this then 'import numpy' may import your module and not numpy. This depends on what's on the Python Path and possibly current directory, which probably explains why it works outside of Wing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM