Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 PIP install error

Hello, I attempted to install this API ( recently via PIP. When I enter the PIP install command into the Windows command prompt, I get this error:

Exception: Traceback (most recent call last): File "c:\program files (x86)\python36-32\lib\site-packages\pip\", line 215, in main status =, args) File "c:\program files (x86)\python36-32\lib\site-packages\pip\commands\", line 342, in run prefix=options.prefix_path, File "c:\program files (x86)\python36-32\lib\site-packages\pip\req\", line 784, in install **kwargs File "c:\program files (x86)\python36-32\lib\site-packages\pip\req\", line 851, in install self.move_wheel_files(self.source_dir, root=root, prefix=prefix) File "c:\program files (x86)\python36-32\lib\site-packages\pip\req\", line 1064, in move_wheel_files isolated=self.isolated, File "c:\program files (x86)\python36-32\lib\site-packages\pip\", line 345, in move_wheel_files clobber(source, lib_dir, True) File "c:\program files (x86)\python36-32\lib\site-packages\pip\", line 316, in clobber ensure_dir(destdir) File "c:\program files (x86)\python36-32\lib\site-packages\pip\utils\", line 83, in ensure_dir os.makedirs(path) File "c:\program files (x86)\python36-32\lib\", line 220, in makedirs mkdir(name, mode) PermissionError: [WinError 5] Access is denied: 'c:\\program files (x86)\\python36-32\\Lib\\site-packages\\requests'
If anyone could help, it would be much appreciated.
Has someone changed the write permission on the site-packages directory?
When you use pip to install a package, it needs to write to this directory, and sub directories.
I'm very much new to the programming scene, so I don't know what that means. But, I just reinstalled Python and havent done anything except tried to install the API
Quote:PermissionError: [WinError 5] Access is denied

This is a windows operating system issue.  It's not a bug, just a permission error.
Windows (as do all other Operating Systems) allows you to be able yo write to some directories,
and not to others. The error is saying that pip is not allowed to write to the specified directory, which
is odd because you said you had just installed python.

do the following:
open a windows command prompt (click start, and type cmd)
in the command window type cd c:\program files (x86)\python36-32\Lib\site-packages\
I believe windows now emulates the Linux ls command, so nest type: la -latr
report what you get for results
Note, to copy text in cmd do the following:
  • right click in cmd window
  • select Mark
  • highlight text
  • Press enter
you can then paste to a notepad window with ctrl-v,
and to a forum post with shift-ctrl-v
Open the cmd as administrator. Do the pip stuff

In case you try @Larz60+' way he mistyped the command: it should be ls - latr
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
Not a typo,
ls -latr
no space required!
There is no 'ls' command in windows, the closest you have is 'dir'

You will need administrative privileges in order to use pip. If you created a desktop icon for the command terminal (highly recommended), right click on the icon and select "Run As Administrator", or from the Start Menu, go to Windows System, right click on 'Command Prompt', click 'More', click "Run As Administrator".

Also, make sure you have the most up to date version of 'pip' (currently 9.0.1) by typing pip -V , if it is less than that, type pip install --upgrade pip

Are you sure this program is designed to work on Windows?
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
I ran the pip installation as administrator in CMD, and I get this error now:

Error [WinError 267] The directory name is invalid while executing command python egg_info Exception: Traceback (most recent call last): File "c:\program files (x86)\python36-32\lib\site-packages\pip\", line 215, in main status =, args) File "c:\program files (x86)\python36-32\lib\site-packages\pip\commands\", line 324, in run requirement_set.prepare_files(finder) File "c:\program files (x86)\python36-32\lib\site-packages\pip\req\", line 380, in prepare_files ignore_dependencies=self.ignore_dependencies)) File "c:\program files (x86)\python36-32\lib\site-packages\pip\req\", line 518, in _prepare_file abstract_dist.prep_for_dist() File "c:\program files (x86)\python36-32\lib\site-packages\pip\req\", line 129, in prep_for_dist self.req_to_install.run_egg_info() File "c:\program files (x86)\python36-32\lib\site-packages\pip\req\", line 439, in run_egg_info command_desc='python egg_info') File "c:\program files (x86)\python36-32\lib\site-packages\pip\utils\", line 667, in call_subprocess cwd=cwd, env=env) File "c:\program files (x86)\python36-32\lib\", line 709, in __init__ restore_signals, start_new_session) File "c:\program files (x86)\python36-32\lib\", line 997, in _execute_child startupinfo) NotADirectoryError: [WinError 267] The directory name is invalid
Also, I'm not sure this is designed to work on windows. It does not specify on the API page what operating system it works on.
(Dec-09-2017, 03:30 PM)alex36540 Wrote: I ran the pip installation as administrator in CMD, and I get this error now:
How are you installing?
Look at this for testing pip.

Here a test i use virtual environment that build into 3.6.
pip install -e git+
# Make enviroment
λ python -m venv insta_env
λ cd insta_env

# Activate
λ C:\1\insta_env\Scripts\activate

# Check pip
(insta_env) C:\1\insta_env
λ pip -V
pip 9.0.1 from c:\1\insta_env\lib\site-packages (python 3.6)

# install
(insta_env) C:\1\insta_env
λ pip install -e git+
Obtaining InstagramAPI from git+
Cloning to c:\1\insta_env\src\instagramapi
Running (path:c:\1\insta_env\src\instagramapi\ egg_info for package InstagramAPI produced metadata for project name instagram-api. Fix your #egg=InstagramAPI fragments.
Collecting requests==2.11.1 (from instagram-api)
Downloading requests-2.11.1-py2.py3-none-any.whl (514kB)
100% |████████████████████████████████| 522kB 545kB/s
Collecting requests-toolbelt==0.7.0 (from instagram-api)
Downloading requests_toolbelt-0.7.0-py2.py3-none-any.whl (52kB)
100% |████████████████████████████████| 61kB 2.6MB/s
Collecting moviepy== (from instagram-api)
Downloading moviepy- (122kB)
100% |████████████████████████████████| 133kB 1.8MB/s
Collecting imageio==2.1.2 (from moviepy==>instagram-api)
Downloading (3.3MB)
100% |████████████████████████████████| 3.3MB 84kB/s
Collecting numpy (from moviepy==>instagram-api)
Downloading numpy-1.13.3-2-cp36-none-win32.whl (6.8MB)
100% |████████████████████████████████| 6.8MB 68kB/s
Collecting decorator==4.0.11 (from moviepy==>instagram-api)
Downloading decorator-4.0.11-py2.py3-none-any.whl
Collecting tqdm==4.11.2 (from moviepy==>instagram-api)
Downloading tqdm-4.11.2-py2.py3-none-any.whl (46kB)
100% |████████████████████████████████| 51kB 2.1MB/s
Collecting pillow (from imageio==2.1.2->moviepy==>instagram-api)
Downloading Pillow-4.3.0-cp36-cp36m-win32.whl (1.4MB)
100% |████████████████████████████████| 1.4MB 387kB/s
Collecting olefile (from pillow->imageio==2.1.2->moviepy==>instagram-api)
Downloading (74kB)
100% |████████████████████████████████| 81kB 1.7MB/s
Installing collected packages: requests, requests-toolbelt, numpy, olefile, pillow, imageio, decorator, tqdm, moviepy, instagram-api
Running install for olefile ... done
Running install for imageio ... done
Running develop for instagram-api
Successfully installed decorator-4.0.11 imageio-2.1.2 instagram-api moviepy- numpy-1.13.3 olefile-0.44 pillow-4.3.0 requests-2.11.1 requests-toolbelt-0.7.0 tqdm-4.11.2

# Test that it work
(insta_env) C:\1\insta_env
λ python
Python 3.6.2 (v3.6.2:5fd33b5, Jul 8 2017, 04:14:34) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from InstagramAPI import InstagramAPI
>>> InstagramAPI.API_URL
alex36540 likes this post
Okay, I ran everything that you ran in the environment, and it worked perfectly. Does this mean it's downloaded on my computer now, or is it just in the environment? Also when I said "pip installation" I meant the installation of the API.

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  How to install tensorflow? It shows as error jaroslavtavgen 1 290 Apr-26-2020, 10:09 PM
Last Post: Larz60+
  pip install pandas ERROR pythondudu 6 7,425 Mar-26-2020, 07:49 PM
Last Post: snippsat
  pandas install error loren41 5 1,463 May-20-2019, 06:42 PM
Last Post: loren41

Forum Jump:

Users browsing this thread: 1 Guest(s)