how to download inta profile by python [duplicate] - python

This question already has answers here:
Why does "pip install" inside Python raise a SyntaxError?
(7 answers)
Closed 1 year ago.
I wanted to download an insta profile picture so I used this code
import instaloader
ig = instaloader.instaloader()
dp = input("insta user name :" )
ig.download_profile(dp , profile_pic_only=true)
but I faced this erorr:
Traceback (most recent call last):
File "C:/Users/m.h.gh/AppData/Local/Programs/Python/Python38/1.py", line 1, in
import instaloader
ModuleNotFoundError: No module named 'instaloader'
Then I wrote this code
pip3 install instaloader
and faced:
SyntaxError: invalid syntax
I'm using python 3.8.

The command pip3 install instaloader needs to be run in a commandline, not inside your python script.

Related

Can't import pygame to vs code (mac) [duplicate]

This question already has answers here:
Unable to install Pygame using pip
(27 answers)
ImportError: No module named 'pygame'
(25 answers)
Closed 3 months ago.
I can't seem to import pygame into vs code even though I've confirmed it's installed through the terminal using pip.
This is the error it keeps showing,
I've tried changing the interpreter, uninstalling and reinstalling pygame, used different versions of python. None of them seems to be working.
[Running] python -u "/var/folders/2d/y6ktnt4n38s07x3yyvr5gl9h0000gp/T/tempCodeRunnerFile.python"
Traceback (most recent call last):
File "/var/folders/2d/y6ktnt4n38s07x3yyvr5gl9h0000gp/T/tempCodeRunnerFile.python", line 1, in <module>
import pygame
ImportError: No module named pygame
[Done] exited with code=1 in 0.23 seconds

Cannot Install Ipython [duplicate]

This question already has answers here:
Why does "pip install" inside Python raise a SyntaxError?
(7 answers)
Closed 4 months ago.
I am not able to install ipython. I am sure it is a very simple error that I am making but i can't find a solution anywhere. Below are some examples of code that i have tried to use and the respective errors:
>>> C:\Users\trist\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Python 3.10>pip install ipython
File "<stdin>", line 1
C:\Users\trist\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Python 3.10>pip install ipython
^
SyntaxError: unexpected character after line continuation character
>>> pip install ipython
File "<stdin>", line 1
pip install ipython
^^^^^^^
SyntaxError: invalid syntax
>>>
You're using pip command inside a python session. Quit the session with
quit()
And then run the pip command again

How can I run pip without sudo? [duplicate]

This question already has answers here:
Getting "Permission Denied" when running pip as root on my Mac
(6 answers)
Error after upgrading pip: cannot import name 'main'
(32 answers)
Closed 3 years ago.
Command pip doesn't work without sudo
I was happily using pip with sudo but I have read here that I shouldn't do that.
However, when I try to use pip without sudo I get this:
[souto#~]$ pip install <package-name>
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
from pip import main
ImportError: cannot import name main
I have tried James Sullivan's tip so my .bash_history file has the content below but to no avail.
[souto#~]$ cat .bash_aliases
alias pip=/usr/bin/pip
I am working on WSL, in case this is relevant.

Unable to install django [duplicate]

This question already has answers here:
Why does "pip install" inside Python raise a SyntaxError?
(7 answers)
Closed 5 years ago.
When I install Django-1.8.18 by using pip, it shows:
>>> pip install django
File "<stdin>", line 1
pip install django
^
SyntaxError: invalid syntax
And if I use winpython control panel, it shows:
invalid mode('wb') or filename: 'c:\\users\\lenovo\\appdate\\local\\temp\\wppm_8ohady\\Django_1.8.18\\tests\\staticfiles_tests\\apps\\test\\static\\test\\xe2\\x8a\\x37.txt'
I think you are trying to run it from Python shell.
Run pip install django from the Windows command prompt instead of the Python shell.

Install python pymysql on win7 [duplicate]

This question already has answers here:
Python 3: ImportError "No Module named Setuptools"
(22 answers)
Closed 8 years ago.
So I am completely unfamiliar with python and wanted to install pymysql.
This is the actual command I typed in cmd and the response I got:
C:\>d:\python27\python d:\pymysql\setup.py install
Traceback (most recent call last):
File "d:\pymysql\setup.py", line 2, in <module>
from setuptools import setup, find_packages
ImportError: No module named setuptools
I have python 2.7.8 and MySQL 6.x
I followed the instructions from here.
I haven't tried to search for the error message but have not found anything. Maybe some of you guys can help?
Install setuptools from here first, and then try to install pymysql again.

Categories