Traceback (most recent call last):
File "main.py", line 4, in <module>
from bot import bot
File "/root/musicbot/bot.py", line 7, in <module>
from database import db, text_search
File "/root/musicbot/database.py", line 2, in <module>
import pymongo
File "/usr/local/lib/python3.5/site-packages/pymongo/__init__.py", line 92, in <module>
from pymongo.connection import Connection
File "/usr/local/lib/python3.5/site-packages/pymongo/connection.py", line 39, in <module>
from pymongo.mongo_client import MongoClient
File "/usr/local/lib/python3.5/site-packages/pymongo/mongo_client.py", line 46, in <module>
from pymongo import (auth,
File "/usr/local/lib/python3.5/site-packages/pymongo/pool.py", line 22, in <module>
from pymongo import thread_util
File "/usr/local/lib/python3.5/site-packages/pymongo/thread_util.py", line 31, in <module>
from gevent.lock import BoundedSemaphore as GeventBoundedSemaphore
File "/usr/local/lib/python3.5/site-packages/gevent/__init__.py", line 36, in <module>
from gevent.hub import get_hub, iwait, wait
File "/usr/local/lib/python3.5/site-packages/gevent/hub.py", line 282
except Exception, ex:
^
SyntaxError: invalid syntax
You are using a Python package which is for Python 2.x and uses old Exception syntax (gevent.hub).
You need to upgrade the violating module to Python 3.x compatible version.
If this is not possible then you need to deploy your application on Python 2.x.
Related
Boto3 was running successfully the day before but when i ran today i am getting these errors
import boto3
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/root1/.local/lib/python3.10/site-packages/boto3/__init__.py", line 16, in <module>
from boto3.session import Session
File "/home/root1/.local/lib/python3.10/site-packages/boto3/session.py", line 17, in <module>
import botocore.session
File "/home/root1/.local/lib/python3.10/site-packages/botocore/session.py", line 29, in <module>
import botocore.credentials
File "/home/root1/.local/lib/python3.10/site-packages/botocore/credentials.py", line 35, in <module>
from botocore.config import Config
File "/home/root1/.local/lib/python3.10/site-packages/botocore/config.py", line 16, in <module>
from botocore.endpoint import DEFAULT_TIMEOUT, MAX_POOL_CONNECTIONS
File "/home/root1/.local/lib/python3.10/site-packages/botocore/endpoint.py", line 24, in <module>
from botocore.awsrequest import create_request_object
File "/home/root1/.local/lib/python3.10/site-packages/botocore/awsrequest.py", line 24, in <module>
import botocore.utils
File "/home/root1/.local/lib/python3.10/site-packages/botocore/utils.py", line 32, in <module>
import botocore.httpsession
File "/home/root1/.local/lib/python3.10/site-packages/botocore/httpsession.py", line 28, in <module>
from urllib3.contrib.pyopenssl import orig_util_SSLContext as SSLContext
File "/usr/lib/python3/dist-packages/urllib3/contrib/pyopenssl.py", line 50, in <module>
import OpenSSL.SSL
File "/home/root1/.local/lib/python3.10/site-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import SSL, crypto
File "/home/root1/.local/lib/python3.10/site-packages/OpenSSL/SSL.py", line 19, in <module>
from OpenSSL.crypto import (
File "/home/root1/.local/lib/python3.10/site-packages/OpenSSL/crypto.py", line 3224, in <module>
utils.deprecated(
TypeError: deprecated() got an unexpected keyword argument 'name'
i tried uninstalling and reinstalling also tried out installing specific version
still getting an error
i am using it on ubuntu 22.0
the python version i am running
Python 3.10.6
I'm having some issues running checkov, I'm not familiar with python libraries, anyone can give me some hints?
This is working fine in some machines but not in this one in particular...
Running in CentOS:
$ checkov --directory cdk.out
Traceback (most recent call last):
File "/usr/local/bin/checkov", line 2, in <module>
from checkov.main import run
File "/usr/local/lib/python3.6/site-packages/checkov/main.py", line 22, in <module>
from checkov.terraform.plan_runner import Runner as tf_plan_runner
File "/usr/local/lib/python3.6/site-packages/checkov/terraform/plan_runner.py", line 11, in <module>
from checkov.terraform.context_parsers.registry import parser_registry
File "/usr/local/lib/python3.6/site-packages/checkov/terraform/context_parsers/__init__.py", line 1, in <module>
from checkov.terraform.context_parsers.parsers import *
File "/usr/local/lib/python3.6/site-packages/checkov/terraform/context_parsers/parsers/provider_context_parser.py", line 1, in <module>
import hcl2
File "/usr/local/lib/python3.6/site-packages/hcl2/__init__.py", line 5, in <module>
from .api import load, loads
File "/usr/local/lib/python3.6/site-packages/hcl2/api.py", line 4, in <module>
from hcl2.parser import hcl2
File "/usr/local/lib/python3.6/site-packages/hcl2/parser.py", line 53, in <module>
hcl2 = Lark_StandAlone(transformer=DictTransformer())
File "/usr/local/lib/python3.6/site-packages/hcl2/lark_parser.py", line 8, in Lark_StandAlone
return Lark._load_from_dict(DATA, MEMO, **kwargs)
AttributeError: type object 'Lark' has no attribute '_load_from_dict'
After upgrading python from 3.6 to 3.8 and reinstalling checkov it worked just fine.
I'm new to python, and I was creating a Bot to discord by PyCharm when suddenly there was this giant error below, I already reinstalled python, tried configuring the PATHs for python 3.7 and 3.6, changed IDE and continues giving this error, can anyone help me figure out what's causing this?
error below:
C:\Users\Pichau\AppData\Local\Programs\Python\Python36\python.exe C:/Users/Pichau/Documents/cursos/programacao/Discord/main.py
Traceback (most recent call last):
File "C:/Users/Pichau/Documents/cursos/programacao/Discord/main.py", line 1, in <module>
import discord
File "C:\Users\Pichau\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\__init__.py", line 20, in <module>
from .client import Client, AppInfo, ChannelPermissions
File "C:\Users\Pichau\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\client.py", line 28, in <module>
from .user import User
File "C:\Users\Pichau\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\user.py", line 27, in <module>
from .utils import snowflake_time
File "C:\Users\Pichau\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\utils.py", line 31, in <module>
import asyncio
File "C:\Users\Pichau\AppData\Local\Programs\Python\Python36\lib\asyncio\__init__.py", line 21, in <module>
from .base_events import *
File "C:\Users\Pichau\AppData\Local\Programs\Python\Python36\lib\asyncio\base_events.py", line 17, in <module>
import concurrent.futures
File "C:\Users\Pichau\AppData\Local\Programs\Python\Python36\lib\concurrent\futures\__init__.py", line 8, in <module>
from concurrent.futures._base import (FIRST_COMPLETED,
File "C:\Users\Pichau\AppData\Local\Programs\Python\Python36\lib\concurrent\futures\_base.py", line 7, in <module>
import logging
File "C:\Users\Pichau\AppData\Local\Programs\Python\Python36\lib\logging\__init__.py", line 26, in <module>
import sys, os, time, io, traceback, warnings, weakref, collections
File "C:\Users\Pichau\AppData\Local\Programs\Python\Python36\lib\traceback.py", line 5, in <module>
import linecache
File "C:\Users\Pichau\AppData\Local\Programs\Python\Python36\lib\linecache.py", line 11, in <module>
import tokenize
File "C:\Users\Pichau\AppData\Local\Programs\Python\Python36\lib\tokenize.py", line 41, in <module>
__all__ = token.__all__ + ["COMMENT", "tokenize", "detect_encoding",
AttributeError: module 'token' has no attribute '__all__'
Process finished with exit code 1
Image of error
I would check the code, unless it won’t let you, then you should probably put the code in notepad, and save it then delete the file, and try again. It probably is a computer error more then a coding error.
(pardon my english)
Hello,
I've a problem for a deploy on a gandi server.
After a git push on a gandi server, I'm proceeding a deploy :
ssh [url] deploy default.git
I obtain an "Internal Error Server".
My log/www/uwsgi.log said :
Traceback (most recent call last):
File "/srv/data/web/vhosts/default/wsgi.py", line 1, in <module>
from run import app as application
File "./run.py", line 1, in <module>
from app import app as application
File "./app/__init__.py", line 1, in <module>
from flask import Flask
File "/srv/data/web/vhosts/default/local/lib/python3.6/site-packages/flask/__init__.py", line 19, in <module>
from jinja2 import Markup, escape
File "/srv/data/web/vhosts/default/local/lib/python3.6/site-packages/jinja2/__init__.py", line 82, in <module>
_patch_async()
File "/srv/data/web/vhosts/default/local/lib/python3.6/site-packages/jinja2/__init__.py", line 78, in _patch_async
from jinja2.asyncsupport import patch_all
File "/srv/data/web/vhosts/default/local/lib/python3.6/site-packages/jinja2/asyncsupport.py", line 13, in <module>
import asyncio
File "/opt/python-3.6/usr/lib/python3.6/asyncio/__init__.py", line 21, in <module>
from .base_events import *
File "/opt/python-3.6/usr/lib/python3.6/asyncio/base_events.py", line 17, in <module>
import concurrent.futures
File "/opt/python-3.6/usr/lib/python3.6/concurrent/futures/__init__.py", line 17, in <module>
from concurrent.futures.process import ProcessPoolExecutor
File "/opt/python-3.6/usr/lib/python3.6/concurrent/futures/process.py", line 55, in <module>
from multiprocessing.connection import wait
File "/opt/python-3.6/usr/lib/python3.6/multiprocessing/connection.py", line 23, in <module>
from . import util
File "/opt/python-3.6/usr/lib/python3.6/multiprocessing/util.py", line 17, in <module>
from subprocess import _args_from_interpreter_flags
File "/opt/python-3.6/usr/lib/python3.6/subprocess.py", line 136, in <module>
import _posixsubprocess
ImportError: /srv/data/web/vhosts/default/local/lib/python3.6/lib-dynload/_posixsubprocess.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _Py_set_inheritable_async_safe
I have not idea how can I solve this problem... ?
Anyone understand this problem ? Thank you
When ever I try to import smtplib in the Python interpreter, I get this error:
ImportError: cannot import name fix_eols
How can I fix this?
Edit:
Here is the full stack trace:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/smtplib.py", line 46, in <module>
import email.utils
File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/email/utils.py", line 32, in <module>
from email._parseaddr import quote
File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/email/_parseaddr.py", line 16, in <module>
import time, calendar
File "/Users/aaronblock/Documents/programming/scripts/calendar.py", line 7, in <module>
File "/usr/local/lib/python2.7/site-packages/apiclient/__init__.py", line 19, in <module>
from googleapiclient import discovery
File "/usr/local/lib/python2.7/site-packages/googleapiclient/discovery.py", line 38, in <module>
from email.generator import Generator
File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/email/generator.py", line 15, in <module>
from email.header import Header
File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/email/header.py", line 16, in <module>
import email.quoprimime
File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/email/quoprimime.py", line 49, in <module>
from email.utils import fix_eols
ImportError: cannot import name fix_eols
Just to point out how to detect this kinds of errors (since it does happen from time to time):
Pay attention to the stacktrace. In this example, the problem can be seen in the line:
File "/Users/aaronblock/Documents/programming/scripts/calendar.py", line 7, in <module>
which certainly indicates wrong file being imported when we're trying to import a system-wide library.
I had a file called "calendar.py" which messes up my Python environment because smtplib needs calendar.py in order to work. Deleting calendar.py solved my problem.