Bottom Page

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

Hello, I attempted to install this API (https://github.com/LevPasha/Instagram-API-python) recently via PIP. When I enter the PIP install command into the Windows command prompt, I get this error:

Error:
Exception: Traceback (most recent call last): File "c:\program files (x86)\python36-32\lib\site-packages\pip\basecommand.py", line 215, in main status = self.run(options, args) File "c:\program files (x86)\python36-32\lib\site-packages\pip\commands\install.py", line 342, in run prefix=options.prefix_path, File "c:\program files (x86)\python36-32\lib\site-packages\pip\req\req_set.py", line 784, in install **kwargs File "c:\program files (x86)\python36-32\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 (x86)\python36-32\lib\site-packages\pip\req\req_install.py", line 1064, in move_wheel_files isolated=self.isolated, File "c:\program files (x86)\python36-32\lib\site-packages\pip\wheel.py", line 345, in move_wheel_files clobber(source, lib_dir, True) File "c:\program files (x86)\python36-32\lib\site-packages\pip\wheel.py", line 316, in clobber ensure_dir(destdir) File "c:\program files (x86)\python36-32\lib\site-packages\pip\utils\__init__.py", line 83, in ensure_dir os.makedirs(path) File "c:\program files (x86)\python36-32\lib\os.py", 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.
Quote
#2
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.
Quote
#3
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
#4
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
Quote
#5
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."
https://freedns.afraid.org
Quote
#6
Not a typo,
ls -latr
no space required!
Quote
#7
There is no 'ls' command in windows, the closest you have is 'dir'

EDIT___
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
Quote
#8
I ran the pip installation as administrator in CMD, and I get this error now:

Error:
Error [WinError 267] The directory name is invalid while executing command python setup.py egg_info Exception: Traceback (most recent call last): File "c:\program files (x86)\python36-32\lib\site-packages\pip\basecommand.py", line 215, in main status = self.run(options, args) File "c:\program files (x86)\python36-32\lib\site-packages\pip\commands\install.py", line 324, in run requirement_set.prepare_files(finder) File "c:\program files (x86)\python36-32\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files ignore_dependencies=self.ignore_dependencies)) File "c:\program files (x86)\python36-32\lib\site-packages\pip\req\req_set.py", line 518, in _prepare_file abstract_dist.prep_for_dist() File "c:\program files (x86)\python36-32\lib\site-packages\pip\req\req_set.py", 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\req_install.py", line 439, in run_egg_info command_desc='python setup.py egg_info') File "c:\program files (x86)\python36-32\lib\site-packages\pip\utils\__init__.py", line 667, in call_subprocess cwd=cwd, env=env) File "c:\program files (x86)\python36-32\lib\subprocess.py", line 709, in __init__ restore_signals, start_new_session) File "c:\program files (x86)\python36-32\lib\subprocess.py", 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.
Quote
#9
(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+https://github.com/LevPasha/Instagram-API-python.git#egg=InstagramAPI
# Make enviroment
C:\1
λ python -m venv insta_env
C:\1
λ cd insta_env

# Activate
C:\1\insta_env
λ 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+https://github.com/LevPasha/Instagram-API-python.git#egg=InstagramAPI
Obtaining InstagramAPI from git+https://github.com/LevPasha/Instagram-API-python.git#egg=InstagramAPI
Cloning https://github.com/LevPasha/Instagram-API-python.git to c:\1\insta_env\src\instagramapi
Running setup.py (path:c:\1\insta_env\src\instagramapi\setup.py) 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==0.2.3.2 (from instagram-api)
Downloading moviepy-0.2.3.2-py2.py3-none-any.whl (122kB)
100% |████████████████████████████████| 133kB 1.8MB/s
Collecting imageio==2.1.2 (from moviepy==0.2.3.2->instagram-api)
Downloading imageio-2.1.2.zip (3.3MB)
100% |████████████████████████████████| 3.3MB 84kB/s
Collecting numpy (from moviepy==0.2.3.2->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==0.2.3.2->instagram-api)
Downloading decorator-4.0.11-py2.py3-none-any.whl
Collecting tqdm==4.11.2 (from moviepy==0.2.3.2->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==0.2.3.2->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==0.2.3.2->instagram-api)
Downloading olefile-0.44.zip (74kB)
100% |████████████████████████████████| 81kB 1.7MB/s
Installing collected packages: requests, requests-toolbelt, numpy, olefile, pillow, imageio, decorator, tqdm, moviepy, instagram-api
Running setup.py install for olefile ... done
Running setup.py install for imageio ... done
Running setup.py develop for instagram-api
Successfully installed decorator-4.0.11 imageio-2.1.2 instagram-api moviepy-0.2.3.2 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
'https://i.instagram.com/api/v1/'
>>>
alex36540 likes this post
Quote
#10
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.
Quote

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)