Tôi cố gắng để sử dụng easy_install
để cài đặt một module gọi là yêu cầu bằng cách làmKhông thể sử dụng easy_install để cài đặt module Python
easy_install requests
này làm việc tốt một tuần trước đây khi tôi còn sử dụng Python 2.6.5 nhưng ngày nay Tôi đã cài đặt Python 2.7.2 và sau đó cố gắng để import requests
trong một trong các tập lệnh của tôi nhưng nó không thành công. sau đó tôi đã cố gắng cài đặt lại các yêu cầu với easy_install requests
nhưng đã nhận lỗi này
install_dir /usr/local/lib/python2.6/dist-packages/
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
installation directory:
[Errno 13] Permission denied: '/usr/local/lib/python2.6/dist-packages/test-easy-install-15207.pth'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/usr/local/lib/python2.6/dist-packages/
Perhaps your account does not have write access to this directory? If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account. If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.
For information on other options, you may wish to consult the
documentation at:
http://packages.python.org/distribute/easy_install.html
Please make the appropriate changes for your system and try again.
Vì vậy, tôi đã nói đi cài đặt lại easy_install và tôi đã đi đến http://pypi.python.org/pypi/setuptools và học tôi phải
xóa tất cả setuptools * .egg và setuptools Tệp .pth từ thư mục gói trang web của hệ thống (và bất kỳ thư mục sys.path nào khác) FIRST.
Vì vậy, tôi đã làm điều này. Sau đó tôi đã cài đặt lại các công cụ thiết lập từ setuptools-0.6c11-py2.7.egg
. Dường như thành công nhưng khi tôi chạy easy_install requests
tôi về cơ bản là lỗi tương tự, ngoại trừ thư mục python2.6/dist-gói bây giờ python2.7/site-packages
[email protected]:~$ easy_install requests
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
installation directory:
[Errno 13] Permission denied: '/usr/local/lib/python2.7/site-packages/test-easy-install-16253.write-test'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/usr/local/lib/python2.7/site-packages/
Perhaps your account does not have write access to this directory? If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account. If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.
For information on other options, you may wish to consult the
documentation at:
http://peak.telecommunity.com/EasyInstall.html
Please make the appropriate changes for your system and try again.
Ngoài ra, khi tôi làm tab easy_install
và nhấn I nhận các tùy chọn này
easy_install easy_install-2.6 easy_install-2.7
Làm thế nào để easy_install-2.6 có ở đó?
và
Làm cách nào để cài đặt lại dễ dàng?
vâng tôi đã sudo easy_install requests' nhưng điều đó không làm việc, hoặc. Vấn đề là cái gì đó bị hỏng với đường dẫn Python của tôi có vẻ như vậy. easy_install hoặc Python 2.7.2 đang tìm kiếm trên các đường dẫn sai mà tôi nghĩ. Giống như Python 2.7.2 đang tìm trong thư mục python2.6/dist-packages. Không chắc. – Classer
Tôi cũng đang điều hướng điều này và không có 'sudo' hoặc tôi chỉ sử dụng nó. – Amanda