Python Forum
Problem installing instaloader
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem installing instaloader
#8
(Oct-27-2019, 02:17 PM)ledgreve Wrote: I dowloaded and installed Python 3.8. I tried to install instaloader in a Jupyter Notebook (Anaconda), but it didn't work: "the Python package manager (pip) can only be used from outside of IPython. Please reissue the pip command in a separate terminal or command prompt". (I work with Windows by the way)
So I opened Python 3.8 itself and typed several variations of "pip install instaloader"/"$ pip install instaloader"/"$ pip3 install instaloader" but NOTHING works. I always get this error: "SyntaxError: invalid syntax".
I think you get confused here,Anaconda or Python(from python.org) can both work fine together on a OS i guess you use Windows?
You get SyntaxError error because you do this in Python shell,all should be done from command line on OS,eg cmd(Windows).
Remember that theses version standalone,so install instaloader on Anaconda dos not make it work on Python(from python.org) and the other way around.
Have install tutorial here Windows | Anaconda.

So if start with Python(from python.org) which is the main version in Windows path.
# Check Python
E:\div_code
λ python -V
Python 3.7.3

# Check pip
E:\div_code
λ pip -V
pip 19.3.1 from c:\python37\lib\site-packages\pip (python 3.7)

# install
E:\div_code
λ pip install instaloader
Collecting instaloader
  Downloading ....
Successfully installed instaloader-4.2.10

# Test that it work
E:\div_code
λ python
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import instaloader

>>> instaloader.__version__
'4.2.10'

>>> L = instaloader.Instaloader()
>>> help(L.download_stories)
Help on method download_stories in module instaloader.instaloader:
download_stories(userids: Union[List[Union[int, instaloader.structures.Profile]] .....

Download available stories from user followees or all stories of users whose ID are given.
Does not mark stories as seen.
To use this, one needs to be logged in
.....

>>> exit()
So now it work on Python(from python.org),but it will not work on Anaconda.
Here i do from Script folder where Anaconda has pip or conda.
# check pip see now that it point to Anaconda folder
G:\Anaconda3\Scripts
λ pip -V
pip 19.0.3 from G:\Anaconda3\lib\site-packages\pip (python 3.7)

G:\Anaconda3\Scripts
λ pip install instaloader
Collecting instaloader .....
Successfully installed instaloader-4.2.10
So if i eg start JupyterLab from Anaconda it will work as i have installed it to Anaconda as shown over.
import sys
import instaloader

print(sys.executable) # Help you see what Python version is used
print(instaloader.__version__)

# Get instance
L = instaloader.Instaloader()

help(L.download_stories)
Output:
G:\Anaconda3\python.exe 4.2.10 Help on method download_stories in module instaloader.instaloader: download_stories(userids: Union[List[Union[int, instaloader.structures.Profile]], NoneType] = None, fast_update: bool = False, filename_target: Union[str, NoneType] = ':stories', storyitem_filter: Union[Callable[[instaloader.structures.StoryItem], bool], NoneType] = None) -> None method of instaloader.instaloader.Instaloader instance Download available stories from user followees or all stories of users whose ID are given. Does not mark stories as seen. To use this, one needs to be logged in :param userids: List of user IDs or Profiles to be processed in terms of downloading their stories :param fast_update: If true, abort when first already-downloaded picture is encountered :param filename_target: Replacement for {target} in dirname_pattern and filename_pattern or None if profile name should be used instead :param storyitem_filter: function(storyitem), which returns True if given StoryItem should be downloaded :raises LoginRequiredException: If called without being logged in.
Reply


Messages In This Thread
Problem installing instaloader - by ledgreve - Oct-27-2019, 12:29 PM
RE: Problem installing instaloader - by Larz60+ - Oct-27-2019, 02:17 PM
RE: Problem installing instaloader - by ledgreve - Oct-28-2019, 08:22 AM
RE: Problem installing instaloader - by Larz60+ - Oct-28-2019, 11:01 AM
RE: Problem installing instaloader - by ledgreve - Oct-29-2019, 08:28 AM
RE: Problem installing instaloader - by Larz60+ - Oct-29-2019, 08:41 AM
RE: Problem installing instaloader - by ledgreve - Oct-29-2019, 09:20 AM
RE: Problem installing instaloader - by snippsat - Oct-29-2019, 12:39 PM
RE: Problem installing instaloader - by ledgreve - Nov-04-2019, 08:53 AM
RE: Problem installing instaloader - by snippsat - Nov-04-2019, 05:04 PM
RE: Problem installing instaloader - by ledgreve - Nov-05-2019, 09:14 AM
RE: Problem installing instaloader - by buran - Nov-05-2019, 09:23 AM
RE: Problem installing instaloader - by ledgreve - Nov-05-2019, 09:47 AM
RE: Problem installing instaloader - by buran - Nov-05-2019, 10:08 AM
RE: Problem installing instaloader - by ledgreve - Nov-05-2019, 10:27 AM
RE: Problem installing instaloader - by baquerik - Nov-05-2019, 10:35 AM
RE: Problem installing instaloader - by ledgreve - Nov-05-2019, 10:38 AM
RE: Problem installing instaloader - by baquerik - Nov-05-2019, 11:03 AM
RE: Problem installing instaloader - by buran - Nov-05-2019, 11:17 AM
RE: Problem installing instaloader - by buran - Nov-05-2019, 11:25 AM
RE: Problem installing instaloader - by snippsat - Nov-05-2019, 01:25 PM
RE: Problem installing instaloader - by ledgreve - Nov-18-2019, 11:28 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Photo Problem installing turtle MasterJediKnight7 17 25,007 Mar-18-2024, 10:22 AM
Last Post: bmohamadyar313
  [WORKED AROUND] Problem installing elitech-datareader, 'cannot import build_py_2to3' NeilUK 4 1,834 Jul-09-2023, 10:01 AM
Last Post: NeilUK
  Problem Installing rasterio gw1500se 1 2,246 Mar-24-2020, 06:28 PM
Last Post: gw1500se
  Problem installing library thunderspeed 2 2,377 Mar-22-2020, 11:04 PM
Last Post: thunderspeed
  Please help: problem installing/importing langdetect module in Jupyter Notebook ledgreve 3 7,398 Dec-30-2019, 08:17 AM
Last Post: LeanbridgeTech
  Problem with installing PyPDF2 Pavel_47 2 6,108 Nov-10-2019, 02:58 PM
Last Post: Pavel_47
  Problem installing numpy and matplotlib achondrite 1 3,181 Jan-16-2019, 11:43 PM
Last Post: snippsat
  Big problem for installing PyCharm sylas 2 3,976 Nov-12-2017, 05:17 PM
Last Post: sylas
  Problem installing urlparse4 package BobLoblaw 2 5,806 Oct-06-2017, 05:16 PM
Last Post: BobLoblaw

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020