2
I’m starting to learn python. So the first thing I did was to install python, in this case Ubuntu 16.04 LTS, since in this system python is already installed.
As a first test, I tried running a simple program with the library numpy
, but the n program runs, displays the following error:
import sitecustomize' failed; use -v for traceback
<type 'numpy.ndarray'>
It seems Spyder failed to import the library numpy
, although I have already called her by the terminal and she came, ie, is 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))
Would someone please help me with this problem? I thank you in advance.
You should have installed Ubuntu 18.04 LTS since 16.04 is old and has almost 3 years since it was launched. Your problem seems to be the way you are running the script. Try opening a terminal and running the script directly in python by typing
python meuscript.py
– nosklo
It is - Ubuntu has a new version every 6 months, and Python has a version with big changes every 18 months. If you are going to install a system only for Python, put the newest one - Ubuntu 18.10 (and even this one comes with version 3.6 of Python, already outdated).
– jsbueno
Then worry about the language, not an IDE - until you’re familiar with the language
– jsbueno
And finally, see rent tutorial on "virtualenv" - and how to create isolated Python environments with several different versions and libraries, according to each project.
– jsbueno
thanks for the suggestions friend.
– david
Friend, the numpy import you made was by Ubuntu terminal or was by the console the Ipython in Spyder.
– Killdary Aguiar de Santana