λ€μ λ¬Έμ λ₯Ό μ΄λ»κ² ν΄κ²°ν μ μμ΅λκΉ?
pip λͺ
λ Ήμ ν΅ν΄ autograd λ° scikit-learn μ μ€μΉνλ €κ³ νμ΅λλ€. κ·Έλ¬λ μ€λ₯μ ν¨κ» λ μ€μΉ λͺ¨λ μ€ν¨νμ΅λλ€.
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/pip'
λ°λΌμ μ΄λ¬ν μ€λ₯λ pipλ‘ μΈν΄ λ°μν μ μμΌλ―λ‘ μ
λ°μ΄νΈ λͺ
λ Ή 'pip install -U pip'λ‘ pipλ₯Ό ν
μ€νΈνκ³ μλ΅νμ΅λλ€.
IOError: [Errno 13] Permission denied: '/usr/local/bin/pip'
λ΄ κΈ°κ³μ νμ΄ κ³ μ₯λ κ² κ°μ΅λκΉ? μ΄λ€ μ‘°μΈμ΄λ κ°μ¬ν©λλ€. κ°μ¬ν©λλ€.
μλ λμ΄λ 'pip install -U pip' λͺ λ Ή μ€ν λ‘κ·Έ:
Downloading/unpacking pip from https://pypi.python.org/packages/b6/ac/7015eb97dc749283ffdec1c3a88ddb8ae03b8fad0f0e611408f196358da3/pip-9.0.1-py2.py3-none-any.whl#md5=297dbd16ef53bcef0447d245815f5144
Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB): 1.3MB downloaded
Installing collected packages: pip
Found existing installation: pip 1.5.4
Not uninstalling pip at /usr/lib/python2.7/dist-packages, owned by OS
Can't roll back pip; was not uninstalled
Cleaning up...
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1436, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 672, in install
self.move_wheel_files(self.source_dir, root=root)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 902, in move_wheel_files
pycompile=self.pycompile,
File "/usr/lib/python2.7/dist-packages/pip/wheel.py", line 312, in move_wheel_files
generated.extend(maker.make(spec))
File "/usr/share/python-wheels/distlib-0.1.8-py2.py3-none-any.whl/distlib/scripts.py", line 311, in make
self._make_script(entry, filenames, options=options)
File "/usr/share/python-wheels/distlib-0.1.8-py2.py3-none-any.whl/distlib/scripts.py", line 215, in _make_script
self._write_script(scriptnames, shebang, script, filenames, ext)
File "/usr/share/python-wheels/distlib-0.1.8-py2.py3-none-any.whl/distlib/scripts.py", line 195, in _write_script
self._fileop.write_binary_file(outname, script_bytes)
File "/usr/share/python-wheels/distlib-0.1.8-py2.py3-none-any.whl/distlib/util.py", line 384, in write_binary_file
with open(path, 'wb') as f:
IOError: [Errno 13] Permission denied: '/usr/local/bin/pip'
Storing debug log for failure in /home/eric/.pip/pip.log
λ£¨νΈ κΆν μμ΄ μ€μΉνλ €λ©΄ --user
μ΅μ
μ μΆκ°ν΄μΌ ν©λλ€.
μ¬μ©μμκ² μ μ©ν λ©μμ§λ₯Ό μΆκ°ν μ μμ΅λκΉ? μ: "λ£¨νΈ κΆνμ΄ μμΌλ©΄ λμ virtualenvλ₯Ό μ¬μ©νμκ² μ΅λκΉ?"
μλ₯Ό λ€μ΄ R-langμμλ λ€μμ μ»μ΅λλ€.
> install.packages('yaml')
Installing package into β/usr/local/lib/R/site-libraryβ
(as βlibβ is unspecified)
Warning in install.packages("yaml") :
'lib = "/usr/local/lib/R/site-library"' is not writable
Would you like to use a personal library instead? (y/n) y
Would you like to create a personal library
~/R/x86_64-pc-linux-gnu-library/3.0
to install packages into? (y/n) y
κ·Έκ²μ νμ€ν λ§μ μ΄λ³΄μμκ² λμμ΄ λ κ²μ λλ€ ...
@hnykda μ΄λ° μΌμ΄ λ°μνμ λ μ€λ₯ λ©μμ§λ₯Ό κ°μ νκΈ° μν΄ PRμ μμ±νμ΅λλ€(μ’ μ μ λ§λ€μμ΄μΌ ν¨) - #4233.
κ°μ¬ ν΄μ. λλ κ·Έκ²μ μ’μνλ€.
μνΌμ μ λ‘ κ°λλ€. κ·Έ ν 'pip install -U pip'λ₯Ό μ€ννμμμ€.
μ ν¬κ° ν μ μλκ² μμ΄μ νμν©λλ€.
#4233μ΄ νΌλμ μ€μ΄λ λ° λμμ΄ λκΈ°λ₯Ό λ°λλλ€.
--user
μΆκ° μλ! λλ μλνλ€.
add --userλ₯Ό μΆκ°νλ©΄ μ΄λ€ λͺ λ Ήμ΄ λ κΉμ?
pip install --user <package you want to install>
λν μ°Έμ‘°: https://pip.pypa.io/en/stable/reference/pip_install/#cmdoption -user
pipλ₯Ό μ¬μ©νμ¬ urllib3λ₯Ό μ±κ³΅μ μΌλ‘ μ€μΉν΄μ£Όμ μ κ°μ¬ν©λλ€.
μ, --user μλν©λλ€ :)
μμ§ μλ μ€μ
λλ€! κ°μ¬ ν΄μ
pip3 install --user .
URL λ°μ΄ν°λ₯Ό κ²μνκ³ μλ λͺ λ Ήμ μ¬μ©νμ¬ νμΌμ μ°λ νμ΄μ¬ μ€ν¬λ¦½νΈκ° μμ΅λλ€. λ΄ λ‘컬 μ»΄ν¨ν°μμ μ΄ μ€ν¬λ¦½νΈλ₯Ό μ€νν λ μλνμ§λ§ μ ν¨μ€λ₯Ό ν΅ν΄ μ€ννλ©΄ μ€λ₯ 13μ΄ λ°μν©λλ€.
μλ΅ = urllib.urlopen(url)
tmpXml = μλ΅.read()
νμΌ 1λ‘ μ΄κΈ°(/tmp/tempxml1.txt, 'wr'):
file1.write(tmpXml)
μλ΅.λ«κΈ°()
μ ν¨μ€μ νμλλ μ€λ₯ -
IOError: [μλ¬λ
Έ 13] κΆνμ΄ κ±°λΆλμμ΅λλ€: '/tmp/tempxml1.txt'
λλ₯Ό λμμ€ λͺ¨λ μ£Όμ
@WV-no7 : μ¬λλ€μκ² sudo pip
μ μ¬μ©νλΌκ³ μ‘°μΈνμ§ λ§μΈμ. μ΄κ²μ λ§€μ° λμ μ΅κ΄μ
λλ€.
python get-pip.py --user
λͺ
λ Ήμ Ubuntu 18.04μμ μλν©λλ€. μ΄κ²μ νμ΄μ¬μ μ΅μ λ²μ μΌλ‘ μ
λ°μ΄νΈνμ§ μλ μ¬λλ€μκ² κ³μ λ¬Έμ κ° λ κΉμ? Python 2.7μ 2020λ
μ λ μ΄μ μ¬μ©λμ§ μμ κ²μΌλ‘ 보μ
λλ€.
λ£¨νΈ κΆν μμ΄ μ€μΉνλ €λ©΄ --user μ΅μ μ μΆκ°ν΄μΌ ν©λλ€.
κ°μ₯ μ μ©ν λκΈ
λ£¨νΈ κΆν μμ΄ μ€μΉνλ €λ©΄
--user
μ΅μ μ μΆκ°ν΄μΌ ν©λλ€.