Traceback Errors in Python - visual-studio-code

Started coding a python program using BeautifulSoup to track GTA V price on Amazon.
Getting these errors:
Traceback (most recent call last):
File "scraper.py", line 68, in <module>
check_price()
File "scraper.py", line 35, in check_price
send_mail()
File "scraper.py", line 50, in send_mail
server.login('sathwikapps#gmail.com', 'Jaybeatx')
File "D:\Users\sathw\anaconda3\lib\smtplib.py", line 697, in login
"SMTP AUTH extension not supported by server.")
smtplib.SMTPNotSupportedError: SMTP AUTH extension not supported by server.
My github repository is : https://github.com/SathwikChiluveru/GTA-V-Price-Tracker

Try to activate on you gmail smtp access for thirdparty :)

Related

Google Cloud SDK installation - gsutil error

I have installed Google Cloud SDK but having an issue running "gsutil". Here are the error I'm getting:
~/gcloud/google-cloud-sdk#> gsutil
Traceback (most recent call last):
File "/Users/gonyi/Desktop/gonyyi/gcloud/google-cloud-sdk/bin/bootstrapping/gsutil.py", line 13, in <module>
import bootstrapping
File "/Users/gonyi/Desktop/gonyyi/gcloud/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 40, in <module>
from googlecloudsdk.core import execution_utils
File "/Users/gonyi/Desktop/gonyyi/gcloud/google-cloud-sdk/lib/googlecloudsdk/core/execution_utils.py", line 33, in <module>
from googlecloudsdk.core import log
File "/Users/gonyi/Desktop/gonyyi/gcloud/google-cloud-sdk/lib/googlecloudsdk/core/log.py", line 810, in <module>
_log_manager = _LogManager()
File "/Users/gonyi/Desktop/gonyyi/gcloud/google-cloud-sdk/lib/googlecloudsdk/core/log.py", line 526, in __init__
self._file_formatter = _LogFileFormatter()
File "/Users/gonyi/Desktop/gonyyi/gcloud/google-cloud-sdk/lib/googlecloudsdk/core/log.py", line 315, in __init__
super(_LogFileFormatter, self).__init__(fmt=_LogFileFormatter.FORMAT)
TypeError: must be type, not classobj
~/gcloud/google-cloud-sdk#>
I have Python 2.7 installed, also tried to install this with "brew cask" as well as download it directly from Google Cloud site and install, but no luck either.
I googled this error but it seems like I'm the only one with this error..
"gcloud" command works just fine; but it's just "gsutil" that's not working.
Thank you

PyOrient client reports protocol version error when trying to connect to server

I'm getting what appears to be a version mismatch error from client.connect() when using what I believe to be the most recent versions of pyorient and the orientdb server
Protocol version 37 is not supported yet by this client.
Is there a more up-to-date version of pyclient available?
here's the test script
#!/usr/bin/env python
import pyorient
client = pyorient.OrientDB( "localhost", 2424 )
session_id = client.connect( "root", "password" )
Here's the full traceback
Traceback (most recent call last):
File "./test1.py", line 7, in <module>
session_id = client.connect( "root", "D1sOri3nted" )
File "~/.local/lib/python2.7/site-packages/pyorient-1.5.5-py2.7.egg/pyorient/orient.py", line 325, in connect
return self.get_message("ConnectMessage") \
File "~/.local/lib/python2.7/site-packages/pyorient-1.5.5-py2.7.egg/pyorient/orient.py", line 540, in get_message
message_instance = _Message(self._connection)\
File "~/.local/lib/python2.7/site-packages/pyorient-1.5.5-py2.7.egg/pyorient/messages/connection.py", line 17, in __init__
super( ConnectMessage, self ).__init__(_orient_socket)
File "~/.local/lib/python2.7/site-packages/pyorient-1.5.5-py2.7.egg/pyorient/messages/base.py", line 24, in __init__
sock.get_connection()
File "~/.local/lib/python2.7/site-packages/pyorient-1.5.5-py2.7.egg/pyorient/orient.py", line 78, in get_connection
self.connect()
File "~/.local/lib/python2.7/site-packages/pyorient-1.5.5-py2.7.egg/pyorient/orient.py", line 103, in connect
" is not supported yet by this client.", [])
pyorient.exceptions.PyOrientWrongProtocolVersionException: Protocol version 37 is not supported yet by this client.
I'm using the pyorient version from https://github.com/orientechnologies/pyorient
The server comes from the distributed docker image.
I'm uncertain of how to get the server version, but from within the docker container the console reports v3.0.1
Thanks in advance for any help or advice on this!

I tried to use SMTP in python to send gmail, but it failed

here is my script:
from email.mime.text import MIMEText
import smtplib
msg=MIMEText('hi, send by python.....','plain','utf-8')
from_addr='user#gmail.com'
passowrd='psw'
to_addr='user#gmail.com'
s=smtplib.SMTP('smtp.gmail.com',587)
s.login(from_addr,password)
s.sendmail(from_addr, [to_addr], msg.as_string())
when it is running, error occurs:
Traceback (most recent call last):
File "C:\Users\bicuilin\Desktop\begin.py", line 17, in <module>
s.login(from_addr, password)
File "C:\Users\bicuilin\AppData\Local\Programs\Python\Python35\lib\smtplib.py", line 696, in login
"SMTP AUTH extension not supported by server.")
smtplib.SMTPNotSupportedError: SMTP AUTH extension not supported by server.
I try to fix it. I add code below:
...
s.ehlo()
s.starttls()
s.login(from_addr, password)
s.sendmail(from_addr, [to_addr], msg.as_string())
s.quit()
here comes out error I really don't understand:
Traceback (most recent call last):
File "C:\Users\bicuilin\Desktop\begin.py", line 20, in <module>
s.login(from_addr, password)
File "C:\Users\bicuilin\AppData\Local\Programs\Python\Python35\lib\smtplib.py", line 729, in login
raise last_exception
File "C:\Users\bicuilin\AppData\Local\Programs\Python\Python35\lib\smtplib.py", line 720, in login
initial_response_ok=initial_response_ok)
File "C:\Users\bicuilin\AppData\Local\Programs\Python\Python35\lib\smtplib.py", line 641, in auth
raise SMTPAuthenticationError(code, resp)
smtplib.SMTPAuthenticationError: (534, b'5.7.14 <https://accounts.google.com/signin/continue?sarp=1&scc=1&plt=AKgnsbvK\n5.7.14 1h8JVCjH3EdlnG4ye0St7PIWFsYfjtuO_qovrt6r-spvSMGNbeCxbpXuo3HfqK535dgJy2\n5.7.14 Tjz1zrEZI8QqRc0GyXD2t3Xa0rj_MVHbzX5fM1f2zgbFyoP9YUbwCyaRD5guosxyv3HcS8\n5.7.14 fvB_ORP6_djncJPUwGw98BDCTo2pw3RSvgYHAvS_xO-T97Hw2z35g3AKPW9Bb5E9EcpAgg\n5.7.14 pewpsm0VngKqoxhYhtFwHBW_8s1ig> Please log in via your web browser and\n5.7.14 then try again.\n5.7.14 Learn more at\n5.7.14 https://support.google.com/mail/answer/78754 a67sm1686251qkc.24 - gsmtp')
You have to use SMTP_SSL class and it works (tested here). no need to starttls (won't work anyway)
from email.mime.text import MIMEText
import smtplib
msg=MIMEText('hi, send by python.....','plain','utf-8')
from_addr='user#gmail.com'
password='psw'
to_addr='user#gmail.com'
s=smtplib.SMTP_SSL('smtp.gmail.com')
s.login(from_addr,password)
s.sendmail(from_addr, [to_addr], msg.as_string())
Less Secure Apps - gmail
Had the same issue. after allow less secure apps at Gmail, got it working!

outlook mailbox SMTPDataError 550 delivery result banner

I was using smtp service of outlook mailbox in my web app. And it worked well in last several days. However a sudden error occured during a usual test:
File "/usr/lib/python3.4/smtplib.py", line 799, in sendmail
raise SMTPDataError(code, resp)
smtplib.SMTPDataError: (550, b'5.3.4 554-554 5.2.0 STOREDRV.Deliver;delivery result banner')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
self.run()
File "/usr/lib/python3.4/threading.py", line 868, in run
self._target(*self._args, **self._kwargs)
File "/home/lancecopper/code/python/flasky/app/email.py", line 9, in send_async_email
mail.send(msg)
File "/home/lancecopper/code/flasky/venv/lib/python3.4/site-packages/flask_mail.py", line 492, in send
message.send(connection)
File "/home/lancecopper/code/flasky/venv/lib/python3.4/site-packages/flask_mail.py", line 152, in __exit__
self.host.quit()
File "/usr/lib/python3.4/smtplib.py", line 867, in quit
res = self.docmd("quit")
File "/usr/lib/python3.4/smtplib.py", line 403, in docmd
self.putcmd(cmd, args)
File "/usr/lib/python3.4/smtplib.py", line 349, in putcmd
self.send(str)
File "/usr/lib/python3.4/smtplib.py", line 341, in send
raise SMTPServerDisconnected('please run connect() first')
smtplib.SMTPServerDisconnected: please run connect() first
I have little knowledge about underlining mechanism of smtp. Can anybody give me some clue about this kind of error.
By the way, I'm a poor guy living inside GFW(Great Firewall of China).Would it be possible that the error above was caused by interruption of GFW?
I encountered this issues when using mutt to.
login your account and verify mobile phone number and check it again.
You may got message like on your phone:
[TLSG] Microsoft 访问代码:2130

Uploading files to google cloud storage <HttpError 403 "Insufficient Permission">

I am following the example python code for uploading and downloading files from google cloud storage. I can download a file from the cloud without a problem, but using the same python file, when I attempt to upload a file I get the following error. Any thoughts on what might be causing the permission error?
Thanks!
Adam
storage-file-transfer-json-python-master adamkglaser$ python chunked_transfer.py language_id.txt gs://adam_glaser_cloud_storage/test.txt
Authenticating...
Constructing Google Cloud Storage service...
Building upload request...
Uploading file: language_id.txt to bucket: adam_glaser_cloud_storage object: test.txt
Traceback (most recent call last):
File "chunked_transfer.py", line 217, in <module>
upload(sys.argv)
File "chunked_transfer.py", line 148, in upload
progress, response = request.next_chunk()
File "/Users/adamkglaser/anaconda/lib/python2.7/site-packages/oauth2client/util.py", line 132, in positional_wrapper
return wrapped(*args, **kwargs)
File "/Users/adamkglaser/anaconda/lib/python2.7/site-packages/apiclient/http.py", line 808, in next_chunk
raise ResumableUploadError(resp, content)
apiclient.errors.ResumableUploadError: <HttpError 403 "Insufficient Permission">