0
votes

I'm starting to learn python. So the first thing I did was install python, in this case ubuntu 16.04 LTS, since in this system python is already installed.

As a first test, I tried to run a simple program with numpy library, but program n does not run, it displays the following error:

import sitecustomize' failed; use -v for traceback
<type 'numpy.ndarray'>

It seems to me that Spyder failed to import the numpy library, although I've already called it by the terminal and it came, that is, it's installed.

My script is as follows:

# -*- coding: utf-8 -*-
"""
Created on Tue Jan 22 07:58:47 2019

@author: David
"""

import numpy as np
a = np.array([1, 2, 3])   
print(type(a))    

Could someone please help me with this problem? Thanks in advance.

Does stackoverflow.com/questions/17258634/… help you? Also you can simply try issuing import numpy in the interpreter on the right side of the screen to see if it'll complain.hqkhan
Try spyder --reset then spyder --default. Good news is that your script actually works, it's just a Spyder problem!Jacques Gaudin
Thanks @hqkhan and @Jacques Gaudin, the option spyder --reset then spyder --default workdavid