2012-10-25 14 views
13

Sto cercando di installare NumPy da http://www.scipy.org/Download.errore di installare NumPy su linux red hat

da git clone git://github.com/numpy/numpy.git numpy

Ma, quando mi sono imbattuto python setup.py install

ho ottenuto:

SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel

Dove ottenere python-dev?

Ho provato:

$ easy_install python-devel 
Searching for python-devel 
Reading http://pypi.python.org/simple/python-devel/ 
Couldn't find index page for 'python-devel' (maybe misspelled?) 
Scanning index of all packages (this may take a while) 
Reading http://pypi.python.org/simple/ 
No local packages or download links found for python-devel 
error: Could not find suitable distribution for Requirement.parse('python-devel') 

e

$ easy_install python-dev 
Searching for python-dev 
Reading http://pypi.python.org/simple/python-dev/ 
Couldn't find index page for 'python-dev' (maybe misspelled?) 
Scanning index of all packages (this may take a while) 
Reading http://pypi.python.org/simple/ 
No local packages or download links found for python-dev 
error: Could not find suitable distribution for Requirement.parse('python-dev') 

Qualsiasi aiuto sarà apprezzato.

Per risolvere il problema di python-dev, ho installato python2.6 nella mia directory locale.

Ma, quando ho usato python setup.py install --user installare NumPy,

ho ottenuto:

$ python setup.py install --user

'sito di importazione' fallito ;

uso -v per traceback Traceback (chiamata più recente scorso): File "setup.py", la linea 18,

in import os ImportError:

No module named os

in python2 0,6

ho ottenuto: >>> import os Traceback (chiamata più recente scorso): File "", la linea 1, in ImportError: No module named os

Qualsiasi aiuto sarà app reciated. grazie

I collegamenti seguenti non sono utili perché non ho il diritto di root e non posso usare sudo.

example1

example2

+0

Quale distro linux stai usando? – Keith

+0

Puoi chiedere a chiunque abbia diritti di amministratore (root) di installare quel pacchetto? – Keith

+0

Linux è 2.6.32. –

risposta

7

python-dev non è un modulo pitone. In realtà è "File di intestazione, una libreria statica e strumenti di sviluppo per costruire moduli Python, estendere l'interprete Python o incorporare Python nelle applicazioni". È possibile installarlo tramite Synaptic Package Manager, Software Center o yum.

+0

Per favore, dimmi come installare python-dev da Synaptic Package Manager, Software Center o yum? Non sono un marciume e non posso usare sudo. Devo installarlo nella mia directory locale. Qualsiasi aiuto sarà apprezzato. –

15

Se siete in Ubuntu (per es. Ubuntu 12.04), è molto facile,

sudo apt-get install python-numpy 

o si può compilare dai sorgenti tramite PIP (credo su RedHat quasi lo stesso):

sudo apt-get install python-dev 
sudo apt-get install python-pip 
pip install numpy 
+4

OP non ha accesso root e si trova su un sistema a cappello rosso (usa 'yum' non' apt-get'). – tacaswell

3

su CentOS, le librerie di sviluppo di Python sono sotto il nome python-devel, non python-dev.

Utilizzare sudo yum install python-devel per installarli sul sistema CentOS.

Problemi correlati