Як я можу встановити python-dev off apt-get?


12

Я спробував це і це, і це, і це

Ніхто з цих не встановлює python-dev, я отримав свою систему amd64, 14.04 і працює, коли я намагаюся встановити кегль, django cms, я отримую помилку:

     pysass.c:4:20: fatal error: Python.h: No such file or directory

     #include <Python.h>

                        ^

    compilation terminated.

    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
    Cleaning up...
    Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/
    libsass/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace
    ('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-ojWg1O-record/install-
    record.txt --single-version-externally-managed --compile failed with error code 1 in 
    /tmp/pip_build_root/libsass
    Storing debug log for failure in /home/payload/.pip/pip.log

Як я можу це виправити та встановити пакет?

Це через відсутність Python.hзаголовка c, який входить до python-devпакету.

Коли я спробував вищезазначені посилання, він говорить:

apt-get install python-dev

Package python-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  python

E: Package 'python-dev' has no installation candidate

для apt-get install python2.7-dev

Package python2.7-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'python2.7-dev' has no installation candidate

Я досліджував архіви debian і знайшов пакет для, python 2.7.8-1але його неможливо було встановити.

Спробував це і на стартовій панелі, але це не працює.

Відповіді:


20

Ви впевнені, що робите це правильно?

Це мій вихід # apt-get install python2.7-dev

root@olympus:/home/zeus# apt-get install python2.7-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  libexpat1-dev libpython2.7-dev
The following NEW packages will be installed:
  libexpat1-dev libpython2.7-dev python2.7-dev
0 upgraded, 3 newly installed, 0 to remove and 7 not upgraded.
Need to get 22.4 MB of archives.
After this operation, 35.0 MB of additional disk space will be used.
Do you want to continue? [Y/n]

Спробуйте зробити це як root ( su)

Крім того, спробуйте запуститись # apt updateі переконайтеся, що Multiverse і Всесвіт увімкнено (Див. Як увімкнути сховище "Всесвіт"? ). Я також отримав Backports включений в моїй системі, не впевнений , чи робить це розходження в даному випадку.


imgur.com/dI6n3Pq це мій скріншот. як увімкнути мультисвіт і всесвіт?
x0x

4
@John: Введіть таку команду:sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse"
Sylvain Pineau,

2
+1 .. Я отримував подібну помилку при спробі встановлення за допомогою python3.5. Після встановлення python3.5-dev помилка зникла
Саурав Кумар

У мене була така ж #include <Python.h>помилка і запуск sudo apt-get install python-devїї виправлено. Це з python2.7.
Нік Кроуфорд
Використовуючи наш веб-сайт, ви визнаєте, що прочитали та зрозуміли наші Політику щодо файлів cookie та Політику конфіденційності.
Licensed under cc by-sa 3.0 with attribution required.