2017-09-04 51 views
0

Python 3.6を再インストールしたばかりですが、パッケージをインストールしようとするとエラーが返されます。Windows 10でパッケージをインストールできない

python -m pip install requests 

が、このリターン:その後、私はパッケージrequestsをインストールしようとした

Collecting BeautifulSoup 
    Using cached BeautifulSoup-3.2.1.tar.gz 
    Complete output from command python setup.py egg_info: 
    Traceback (most recent call last): 
     File "<string>", line 1, in <module> 
     File "C:\Users\Robert\AppData\Local\Temp\pip-build-iiyyxs2o\BeautifulSoup\setup.py", line 22 
     print "Unit tests have failed!" 
            ^
    SyntaxError: Missing parentheses in call to 'print' 

    ---------------------------------------- 
Command "python setup.py egg_info" failed with error code 1 in C:\Users\Robert\AppData\Local\Temp\pip-build-iiyyxs2o\BeautifulSoup\ 

:まず私は、WindowsのコマンドプロンプトからパッケージBeautifulSoupをインストールしようとした:

python -m pip install BeautifulSoup 

が、これは次のエラーを返します。

C:\Program Files\Python36>python -m pip install requests 
Collecting requests 
    Using cached requests-2.18.4-py2.py3-none-any.whl 
Collecting certifi>=2017.4.17 (from requests) 
    Using cached certifi-2017.7.27.1-py2.py3-none-any.whl 
Collecting idna<2.7,>=2.5 (from requests) 
    Using cached idna-2.6-py2.py3-none-any.whl 
Collecting chardet<3.1.0,>=3.0.2 (from requests) 
    Using cached chardet-3.0.4-py2.py3-none-any.whl 
Collecting urllib3<1.23,>=1.21.1 (from requests) 
    Using cached urllib3-1.22-py2.py3-none-any.whl 
Installing collected packages: certifi, idna, chardet, urllib3, requests 
Exception: 
Traceback (most recent call last): 
    File "C:\Program Files\Python36\lib\site-packages\pip\basecommand.py", line 215, in main 
    status = self.run(options, args) 
    File "C:\Program Files\Python36\lib\site-packages\pip\commands\install.py", line 342, in run 
    prefix=options.prefix_path, 
    File "C:\Program Files\Python36\lib\site-packages\pip\req\req_set.py", line 784, in install 
    **kwargs 
    File "C:\Program Files\Python36\lib\site-packages\pip\req\req_install.py", line 851, in install 
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix) 
    File "C:\Program Files\Python36\lib\site-packages\pip\req\req_install.py", line 1064, in move_wheel_files 
    isolated=self.isolated, 
    File "C:\Program Files\Python36\lib\site-packages\pip\wheel.py", line 345, in move_wheel_files 
    clobber(source, lib_dir, True) 
    File "C:\Program Files\Python36\lib\site-packages\pip\wheel.py", line 316, in clobber 
    ensure_dir(destdir) 
    File "C:\Program Files\Python36\lib\site-packages\pip\utils\__init__.py", line 83, in ensure_dir 
    os.makedirs(path) 
    File "C:\Program Files\Python36\lib\os.py", line 220, in makedirs 
    mkdir(name, mode) 
PermissionError: [WinError 5] Access is denied: 'C:\\Program Files\\Python36\\Lib\\site-packages\\certifi' 

pipがパッケージを正常にインストールするために必要なことは何ですか?

+1

お試しください:_elevated privileges_(administrator)でコマンドプロンプトを実行してください。それから 'pip install beautifulsoup'(小文字)を使います。また、 'request'もやり直してください。 –

+0

@ Jean-FrançoisFabre管理コマンドプロンプトで、Windowsは' pip install beautifulsoup'の後に同じエラーを報告します。 – Robert

+1

'要求'はどうですか? –

答えて

1

BeautifulSoupはPython 2のみです。 Pythonの3のためにbeautifulsoup4をインストール:

pip install beautifulsoup4 

第二の問題は明らかに思える:あなたはC:\\Program Files\\Python36\\Lib\\site-packagesとサブディレクトリへの書き込みアクセスを持っていません。

+2

あまり明らかではありません。あなたはそれをどのように修正することを提案しますか? –

+1

Pythonを、ユーザが書き込みアクセス権を持つディレクトリにインストールします。 C:\\ Python36は最も標準的な場所です。 – phd

+2

を入力するか、昇格された権限でコマンドプロンプトを実行します。 –

関連する問題