Форум сайта python.su
1
Версия пайтона 3.3.2
запускаю код
from grab import Grab g = Grab(log_file='out.html') g.go('yandex.ru') g.search(u'яндекс')
Traceback (most recent call last): File "/home/yura/Документы/python/progi/телефонистки.py", line 2, in <module> g = Grab(log_file='out.html') File "/usr/local/lib/python3.3/dist-packages/grab/base.py", line 240, in __init__ self.setup_transport(transport) File "/usr/local/lib/python3.3/dist-packages/grab/base.py", line 254, in setup_transport mod = __import__(mod_path, globals(), locals(), ['foo']) File "/usr/local/lib/python3.3/dist-packages/grab/transport/curl.py", line 18, in <module> import pycurl ImportError: No module named 'pycurl' Process finished with exit code 1
Офлайн
19
Офлайн
9
Нужно установить модуль pycurl
Офлайн
1
так? pip3 install pycurl
~$ pip3 install pycurl Downloading/unpacking pycurl Downloading pycurl-7.19.3.1.tar.gz (116kB): 116kB downloaded Running setup.py egg_info for package pycurl Traceback (most recent call last): File "/tmp/pip_build_yura/pycurl/setup.py", line 96, in configure_unix stdout=subprocess.PIPE, stderr=subprocess.PIPE) File "/usr/lib/python3.3/subprocess.py", line 824, in __init__ restore_signals, start_new_session) File "/usr/lib/python3.3/subprocess.py", line 1448, in _execute_child raise child_exception_type(errno_num, err_msg) FileNotFoundError: [Errno 2] No such file or directory: 'curl-config' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<string>", line 16, in <module> File "/tmp/pip_build_yura/pycurl/setup.py", line 563, in <module> ext = get_extension() File "/tmp/pip_build_yura/pycurl/setup.py", line 368, in get_extension ext_config = ExtensionConfiguration() File "/tmp/pip_build_yura/pycurl/setup.py", line 65, in __init__ self.configure() File "/tmp/pip_build_yura/pycurl/setup.py", line 100, in configure_unix raise ConfigurationError(msg) __main__.ConfigurationError: Could not run curl-config: [Errno 2] No such file or directory: 'curl-config' Complete output from command python setup.py egg_info: Traceback (most recent call last): File "/tmp/pip_build_yura/pycurl/setup.py", line 96, in configure_unix stdout=subprocess.PIPE, stderr=subprocess.PIPE) File "/usr/lib/python3.3/subprocess.py", line 824, in __init__ restore_signals, start_new_session) File "/usr/lib/python3.3/subprocess.py", line 1448, in _execute_child raise child_exception_type(errno_num, err_msg) FileNotFoundError: [Errno 2] No such file or directory: 'curl-config' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<string>", line 16, in <module> File "/tmp/pip_build_yura/pycurl/setup.py", line 563, in <module> ext = get_extension() File "/tmp/pip_build_yura/pycurl/setup.py", line 368, in get_extension ext_config = ExtensionConfiguration() File "/tmp/pip_build_yura/pycurl/setup.py", line 65, in __init__ self.configure() File "/tmp/pip_build_yura/pycurl/setup.py", line 100, in configure_unix raise ConfigurationError(msg) __main__.ConfigurationError: Could not run curl-config: [Errno 2] No such file or directory: 'curl-config' ---------------------------------------- Cleaning up... Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_yura/pycurl Storing complete log in /home/yura/.pip/pip.log yura@yura:~$
Офлайн
19
Какой у вас дистриб? Если есть пакет ставьте из него.
Офлайн
1
ubuntu 13.10
Офлайн
19
apt-cache search python3-pycurl
sudo apt-get install <имя пакаджа>
Отредактировано PanovSergey (Фев. 22, 2014 18:59:01)
Офлайн
9
ingfa_1981
ubuntu 13.10
apt-get install python-pycurl
Офлайн
1
~$ apt-get install python-pycurl E: Не удалось открыть файл блокировки /var/lib/dpkg/lock - open (13: Отказано в доступе) E: Не удалось выполнить блокировку управляющего каталога (/var/lib/dpkg/); у вас есть права суперпользователя? yura@yura:~$ sudo apt-get install python-pycurl Чтение списков пакетов… Готово Построение дерева зависимостей Чтение информации о состоянии… Готово Уже установлена самая новая версия python-pycurl. Следующие пакеты устанавливались автоматически и больше не требуются: libsvga1 linux-headers-3.11.0-12 linux-headers-3.11.0-12-generic linux-headers-3.11.0-14 linux-headers-3.11.0-14-generic linux-headers-generic linux-image-3.11.0-12-generic linux-image-3.11.0-14-generic linux-image-extra-3.11.0-12-generic linux-image-extra-3.11.0-14-generic linux-image-generic Для их удаления используйте «apt-get autoremove». обновлено 0, установлено 0 новых пакетов, для удаления отмечено 0 пакетов, и 0 пакетов не обновлено. не установлено до конца или удалено 2 пакетов. После данной операции, объём занятого дискового пространства возрастёт на 0 B. Хотите продолжить [Д/н]? y Настраивается пакет update-notifier-common (0.147.1) … File "/usr/lib/update-notifier/package-data-downloader", line 233 print "%s: downloading %s" % (relfile, files[i]) ^ SyntaxError: invalid syntax dpkg: ошибка при обработке параметра update-notifier-common (--configure): подпроцесс установлен сценарий post-installation возвратил код ошибки 1 Отчёты apport не записаны, так достигнут MaxReports dpkg: зависимости пакетов не позволяют настроить пакет flashplugin-installer: flashplugin-installer зависит от update-notifier-common (>= 0.119ubuntu2), однако: Пакет update-notifier-common пока не настроен. dpkg: ошибка при обработке параметра flashplugin-installer (--configure): проблемы зависимостей — оставляем не настроенным Отчёты apport не записаны, так достигнут MaxReports При обработке следующих пакетов произошли ошибки: update-notifier-common flashplugin-installer E: Sub-process /usr/bin/dpkg returned an error code (1) yura@yura:~$ sudo apt-get install python-pycurl Чтение списков пакетов… Готово Построение дерева зависимостей Чтение информации о состоянии… Готово Уже установлена самая новая версия python-pycurl. Следующие пакеты устанавливались автоматически и больше не требуются: libsvga1 linux-headers-3.11.0-12 linux-headers-3.11.0-12-generic linux-headers-3.11.0-14 linux-headers-3.11.0-14-generic linux-headers-generic linux-image-3.11.0-12-generic linux-image-3.11.0-14-generic linux-image-extra-3.11.0-12-generic linux-image-extra-3.11.0-14-generic linux-image-generic Для их удаления используйте «apt-get autoremove». обновлено 0, установлено 0 новых пакетов, для удаления отмечено 0 пакетов, и 0 пакетов не обновлено. не установлено до конца или удалено 2 пакетов. После данной операции, объём занятого дискового пространства возрастёт на 0 B. Хотите продолжить [Д/н]? y Настраивается пакет update-notifier-common (0.147.1) … File "/usr/lib/update-notifier/package-data-downloader", line 233 print "%s: downloading %s" % (relfile, files[i]) ^ SyntaxError: invalid syntax dpkg: ошибка при обработке параметра update-notifier-common (--configure): подпроцесс установлен сценарий post-installation возвратил код ошибки 1 dpkg: зависимости пакетов не позволяют настроить пакет flashplugin-installer: flashplugin-installer зависит от update-notifier-common (>= 0.119ubuntu2), однако: Пакет update-notifier-common пока не настроен. dpkg: ошибка при обработке параметра flashplugin-installer (--configure): проблемы зависимостей — оставляем не настроенным Отчёты apport не записаны, так достигнут MaxReports Отчёты apport не записаны, так достигнут MaxReports При обработке следующих пакетов произошли ошибки: update-notifier-common flashplugin-installer E: Sub-process /usr/bin/dpkg returned an error code (1) yura@yura:~$ sudo apt-get install python-pycurl Чтение списков пакетов… Готово Построение дерева зависимостей Чтение информации о состоянии… Готово Уже установлена самая новая версия python-pycurl. Следующие пакеты устанавливались автоматически и больше не требуются: libsvga1 linux-headers-3.11.0-12 linux-headers-3.11.0-12-generic linux-headers-3.11.0-14 linux-headers-3.11.0-14-generic linux-headers-generic linux-image-3.11.0-12-generic linux-image-3.11.0-14-generic linux-image-extra-3.11.0-12-generic linux-image-extra-3.11.0-14-generic linux-image-generic Для их удаления используйте «apt-get autoremove». обновлено 0, установлено 0 новых пакетов, для удаления отмечено 0 пакетов, и 0 пакетов не обновлено. не установлено до конца или удалено 2 пакетов. После данной операции, объём занятого дискового пространства возрастёт на 0 B. Хотите продолжить [Д/н]? y Настраивается пакет update-notifier-common (0.147.1) … File "/usr/lib/update-notifier/package-data-downloader", line 233 print "%s: downloading %s" % (relfile, files[i]) ^ SyntaxError: invalid syntax dpkg: ошибка при обработке параметра update-notifier-common (--configure): подпроцесс установлен сценарий post-installation возвратил код ошибки 1 Отчёты apport не записаны, так достигнут MaxReports dpkg: зависимости пакетов не позволяют настроить пакет flashplugin-installer: flashplugin-installer зависит от update-notifier-common (>= 0.119ubuntu2), однако: Пакет update-notifier-common пока не настроен. dpkg: ошибка при обработке параметра flashplugin-installer (--configure): проблемы зависимостей — оставляем не настроенным Отчёты apport не записаны, так достигнут MaxReports При обработке следующих пакетов произошли ошибки: update-notifier-common flashplugin-installer E: Sub-process /usr/bin/dpkg returned an error code (1)
Офлайн
19
Во первых надо ставить python3-pycurl
Во вторых надо ставить из под sudo
В третьих код
Настраивается пакет update-notifier-common (0.147.1) …
File "/usr/lib/update-notifier/package-data-downloader", line 233
print "%s: downloading %s" % (relfile, files[i])
Отредактировано PanovSergey (Фев. 22, 2014 19:12:23)
Офлайн