2011-10-01 17 views
13

मैंअजगर मॉड्यूल स्थापित करने के लिए

easy_install requests 

करके एक मॉड्यूल अनुरोध कहा जाता है स्थापित करने के लिए easy_install उपयोग करने के लिए यह ठीक एक सप्ताह पहले काम किया जब मैं अजगर 2.6.5 लेकिन आज का उपयोग कर रहा था कोशिश कर रहा हूँ easy_install उपयोग करने में असमर्थ मैंने पायथन 2.7.2 स्थापित किया और फिर मेरी स्क्रिप्ट में से एक में import requests की कोशिश की लेकिन यह असफल रहा। मैं तो easy_install requests अनुरोध फिर से स्थापित करने की कोशिश की लेकिन इस त्रुटि

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. 

तो मैं easy_install को पुनर्स्थापित जाने के लिए कहा था मिल गया और मैं http://pypi.python.org/pypi/setuptools के पास गया और पता चला मैं

पड़ा सब setuptools * .egg और setuptools हटाना आपके सिस्टम की साइट-पैकेज निर्देशिका (और कोई अन्य sys.path निर्देशिका) FIRST से .pth फ़ाइलें।

तो मैंने यह किया। मैंने फिर setuptools-0.6c11-py2.7.egg से setuptools को पुनर्स्थापित किया। यह सफल लग रहा था लेकिन जब मैं easy_install requests भाग गया मैं निर्देशिका python2.6/जिले-संकुल को छोड़कर मूलतः एक ही त्रुटि मिली अब python2.7/साइट-संकुल

[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. 

इसके अलावा, जब मैं easy_install और टैब दबाएं मैं करता हूँ इन विकल्पों को प्राप्त करें

easy_install  easy_install-2.6 easy_install-2.7 

easy_install-2.6 कैसे आते हैं?

और

मैं कैसे आसान स्थापित मिलता है फिर से काम?

उत्तर

16

क्या आपने इस तरह sudo का उपयोग करने का प्रयास किया था?

sudo easy_install requests 

या उस निर्देशिका में स्थापित निर्देशिका निर्दिष्ट करें जिसमें आपके पास विशेषाधिकार हैं।

easy_install --install-dir=/home/foo/bar 

लेकिन क्या तुम सच में PIP बजाय easy_install उपयोग करना चाहिए। यह बहुत बेहतर है और इसमें बहुत अधिक सुविधाएं हैं।

+2

समाधान हो सकता है हाँ मैं 'sudo easy_install requests' लेकिन है कि या तो काम नहीं किया था। मुद्दा यह है कि मेरे पाइथन पथ के साथ कुछ तोड़ दिया गया है। easy_install या पायथन 2.7.2 मुझे लगता है कि गलत रास्ते पर खोज रहा है। पायथन 2.7.2 की तरह python2.6/dist-packages dir में देख रहा है। निश्चित नहीं। – Classer

+0

मैं इसे भी नेविगेट कर रहा हूं, और 'सुडो' नहीं है या मैं इसका उपयोग करूँगा। – Amanda

4

आपको पैकेज-आधारित लिनक्स वितरण पर virtualenv का उपयोग करना चाहिए ताकि पायथन स्क्रिप्ट अन्य पैकेजों या ओएस के पैकेज-मैनेजर के साथ संघर्ष में हस्तक्षेप न करें।

http://workaround.org/easy-install-debian

4

उबंटू 12.10 तो pip easy_install स्थापित करने के साथ मेरे लिए काम किया है:

sudo apt-get install python-virtualenv 
curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py 
sudo python get-pip.py 
2

आप पथ के लिए अपने नए python.framework जोड़ने की कोशिश की है? पहाड़ शेर पर मैंने /Library/Frameworks/Python.framework/Versions/3.3/bin/ से /etc/paths और फिर मैं easy_install-3.3 और pip-3 का उपयोग करने में सक्षम था।3

1

यह आपके सामने "सुडो" गायब होने का एक साधारण मामला हो सकता है। क्या आप इसे सुडो आसान-स्थापित अनुरोधों के साथ आजमा सकते हैं

"सूडो" डालने के लिए आवश्यक अनुमतियां जोड़ दी जाएंगी।

1

easy_install से पहले Sudo का उपयोग करना आपकी समस्या

Sudo easy_install requests 

धन्यवाद

संबंधित मुद्दे