Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pip install requests exception and pip install beautifulsoup4 exception

I have installed Python 3.4.1 on Windows 7, pip included and during install have selected add python.exe to PATH.

When running pip install requests I get:

    C:\Python34>pip install requests
Requirement already satisfied (use --upgrade to upgrade): requests in c:\python3
4\lib\site-packages
Cleaning up...
  Exception:
Traceback (most recent call last):
  File "C:\Python34\lib\shutil.py", line 370, in _rmtree_unsafe
    os.unlink(fullname)
PermissionError: [WinError 5] Access is denied: 'C:\\Users\\User\\AppData\\Local
\\Temp\\pip_build_User\\pip\\pip\\_vendor\\distlib\\w32.exe'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Python34\lib\site-packages\pip\basecommand.py", line 122, in main
    status = self.run(options, args)
  File "C:\Python34\lib\site-packages\pip\commands\install.py", line 302, in run

    requirement_set.cleanup_files(bundle=self.bundle)
  File "C:\Python34\lib\site-packages\pip\req.py", line 1333, in cleanup_files
    rmtree(dir)
  File "C:\Python34\lib\site-packages\pip\util.py", line 43, in rmtree
    onerror=rmtree_errorhandler)
  File "C:\Python34\lib\shutil.py", line 477, in rmtree
    return _rmtree_unsafe(path, onerror)
  File "C:\Python34\lib\shutil.py", line 367, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  File "C:\Python34\lib\shutil.py", line 367, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  File "C:\Python34\lib\shutil.py", line 367, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  File "C:\Python34\lib\shutil.py", line 367, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  File "C:\Python34\lib\shutil.py", line 372, in _rmtree_unsafe
    onerror(os.unlink, fullname, sys.exc_info())
  File "C:\Python34\lib\site-packages\pip\util.py", line 53, in rmtree_errorhand
ler
    (exctype is PermissionError and value.args[3] == 5) #python3.3
IndexError: tuple index out of range

  Storing debug log for failure in C:\Users\User\pip\pip.log

When running pip install beautifulsoup4 I get:

    C:\Python34>pip install beautifulsoup4
Downloading/unpacking beautifulsoup4
  Running setup.py (path:C:\Users\User\AppData\Local\Temp\pip_build_User\beautif
ulsoup4\setup.py) egg_info for package beautifulsoup4

Installing collected packages: beautifulsoup4
  Running setup.py install for beautifulsoup4
    Skipping implicit fixer: buffer
    Skipping implicit fixer: idioms
    Skipping implicit fixer: set_literal
    Skipping implicit fixer: ws_comma

Successfully installed beautifulsoup4
Cleaning up...
  Exception:
Traceback (most recent call last):
  File "C:\Python34\lib\shutil.py", line 370, in _rmtree_unsafe
    os.unlink(fullname)
PermissionError: [WinError 5] Access is denied: 'C:\\Users\\User\\AppData\\Local
\\Temp\\pip_build_User\\pip\\pip\\_vendor\\distlib\\w32.exe'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Python34\lib\site-packages\pip\basecommand.py", line 122, in main
    status = self.run(options, args)
  File "C:\Python34\lib\site-packages\pip\commands\install.py", line 302, in run

    requirement_set.cleanup_files(bundle=self.bundle)
  File "C:\Python34\lib\site-packages\pip\req.py", line 1333, in cleanup_files
    rmtree(dir)
  File "C:\Python34\lib\site-packages\pip\util.py", line 43, in rmtree
    onerror=rmtree_errorhandler)
  File "C:\Python34\lib\shutil.py", line 477, in rmtree
    return _rmtree_unsafe(path, onerror)
  File "C:\Python34\lib\shutil.py", line 367, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  File "C:\Python34\lib\shutil.py", line 367, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  File "C:\Python34\lib\shutil.py", line 367, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  File "C:\Python34\lib\shutil.py", line 367, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  File "C:\Python34\lib\shutil.py", line 372, in _rmtree_unsafe
    onerror(os.unlink, fullname, sys.exc_info())
  File "C:\Python34\lib\site-packages\pip\util.py", line 53, in rmtree_errorhand
ler
    (exctype is PermissionError and value.args[3] == 5) #python3.3
IndexError: tuple index out of range

  Storing debug log for failure in C:\Users\User\pip\pip.log

C:\Python34>

I am wondering what those Exceptions mean?

Have the packages really successfully installed like given in the log and will they run fine or am I doing something wrong.

Why the exceptions and how do I get rid of them?

like image 838
lowtechsun Avatar asked Sep 07 '14 14:09

lowtechsun


People also ask

What is pip install requests?

Pip install Requests into a Virtual Directory You can use pip to install a specific version of the Requests module into a Virtualenv environment for Python 2 or Venv for Python 3 projects.

Can pip install multiple packages?

To pip install more than one Python package, the packages can be listed in line with the same pip install command as long as they are separated with spaces. Here we are installing both scikit-learn and the statsmodel package in one line of code. You can also upgrade multiple packages in one line of code.

Does Python 3.9 support pip?

Pip3 Installation Python 3.4+ in most operating systems includes pip3 by default. If your python version is less than 3.4, then you should upgrade your Python version which will automatically install pip3. For example, you can install the latest version of Python from ActiveState (Python 3.9), which includes pip3.


1 Answers

All the permission exceptions means that your command prompt has no administrator rights.

Run the command prompt as Administrator (search for cmd in start menu, right click, Run as Administrator). If that doesn't work, try reinstalling pip; the file permissions things might have been screwed up somehow.

like image 87
tyteen4a03 Avatar answered Oct 23 '22 01:10

tyteen4a03