2016-09-25 18 views
0

なぜインストールにsudoが必要なpymongoですか?そのドキュメントはpipインストールにsudoが必要なpymongoはなぜですか?

(myapp) cchilders:~/projects/app (master) 
$ sudo pip3 uninstall pymongo 
    Successfully uninstalled pymongo-3.3.0 
The directory '/home/cchilders/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. 


(myapp) cchilders:~/projects/app (master) 
$ pip3 install pymongo 
Collecting pymongo 
    Using cached pymongo-3.3.0-cp35-cp35m-manylinux1_x86_64.whl 
Installing collected packages: pymongo 
Exception: 
Traceback (most recent call last): 
    File "/home/cchilders/.local/lib/python3.5/site-packages/pip/basecommand.py", line 215, in main 
    status = self.run(options, args) 
    File "/home/cchilders/.local/lib/python3.5/site-packages/pip/commands/install.py", line 317, in run 
    prefix=options.prefix_path, 
    File "/home/cchilders/.local/lib/python3.5/site-packages/pip/req/req_set.py", line 742, in install 
    **kwargs 
    File "/home/cchilders/.local/lib/python3.5/site-packages/pip/req/req_install.py", line 831, in install 
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix) 
    File "/home/cchilders/.local/lib/python3.5/site-packages/pip/req/req_install.py", line 1032, in move_wheel_files 
    isolated=self.isolated, 
    File "/home/cchilders/.local/lib/python3.5/site-packages/pip/wheel.py", line 346, in move_wheel_files 
    clobber(source, lib_dir, True) 
    File "/home/cchilders/.local/lib/python3.5/site-packages/pip/wheel.py", line 287, in clobber 
    ensure_dir(dest) # common for the 'include' path 
    File "/home/cchilders/.local/lib/python3.5/site-packages/pip/utils/__init__.py", line 83, in ensure_dir 
    os.makedirs(path) 
    File "/usr/lib/python3.5/os.py", line 241, in makedirs 
    mkdir(name, mode) 
PermissionError: [Errno 13] Permission denied: '/usr/lib/python3.5/site-packages' 

(myapp) cchilders:~/projects/app (master) 
$ sudo pip3 install pymongo 
The directory '/home/cchilders/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. 
The directory '/home/cchilders/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. 
Collecting pymongo 
    Downloading pymongo-3.3.0-cp35-cp35m-manylinux1_x86_64.whl (337kB) 
    100% |████████████████████████████████| 337kB 1.5MB/s 
Installing collected packages: pymongo 
Successfully installed pymongo-3.3.0 

パーマ...須藤については何も言及していない、ここで同じとその他のとおりです。

drwxrwxr-x 6 cchilders cchilders 4096 Sep 24 19:42 myapp 
-rw-r--r-- 1 cchilders cchilders 96 Feb 23 2016 initialize 
drwxrwxr-x 6 cchilders cchilders 4096 Apr 21 16:19 knockoutjs_official_tutorial 
drwxrwxr-x 6 cchilders cchilders 4096 Apr 3 10:38 my_scripting_library 
drwxrwxr-x 8 cchilders cchilders 4096 Sep 15 03:41 neo4j_sandbox 

+3

が必要です。一般に、パッケージにはシステム全体のPythonライブラリディレクトリにsudoをインストールする必要があります。もしあなたがそれをしたくなければ、virtualenvを使うことができます。 – BrenBarn

+0

virtualenvがアクティブです.. – codyc4321

+0

質問形式が修正されました – codyc4321

答えて

1

ありがとう仮想環境の所有権を確認してください。あなたがそのパスへの書き込み権限を持っていない場合は、sudo

+0

でも、どうすればいいですか? bin/pythonへのパスのpermを確認しますか? – codyc4321

+0

@ codyc4321あなたの仮想環境をチェックしてください。それは仮想環境を作成するときに入力するパスです。 –

+0

メインフォルダまたはピップ?メインフォルダとピップの両方にユーザーcchildersの書き込みアクセス権があります – codyc4321

関連する問題