(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)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?
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".
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.10So 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.