anti-SMASH antismash --check-prereqs TRACEBACK and IMPORT ERRORS - python

I am now trying if my recently installed anti-SMASH would work. However, the following lines appear as I type antismash --check-prereqs:
Traceback (most recent call last):
File "/home/promt/asenv/bin/antismash", line 5, in
from antismash.main import entrypoint
File "/home/promt/asenv/lib/python3.9/site-packages/antismash/init.py", line 12, in
from antismash.main import run_antismash, get_detection_modules,
File "/home/promt/asenv/lib/python3.9/site-packages/antismash/main.py", line 31, in
from antismash.common import logs, record_processing, serialiser
File "/home/promt/asenv/lib/python3.9/site-packages/antismash/common/record_processing.py", line 19, in
from antismash.common.secmet import Record
File "/home/promt/asenv/lib/python3.9/site-packages/antismash/common/secmet/init.py", line 11, in
from .record import Record
File "/home/promt/asenv/lib/python3.9/site-packages/antismash/common/secmet/record.py", line 25, in
from .features import (
File "/home/promt/asenv/lib/python3.9/site-packages/antismash/common/secmet/features/init.py", line 6, in
from .antismash_domain import AntismashDomain
File "/home/promt/asenv/lib/python3.9/site-packages/antismash/common/secmet/features/antismash_domain.py", line 10, in
from .domain import Domain, generate_protein_location_from_qualifiers
File "/home/promt/asenv/lib/python3.9/site-packages/antismash/common/secmet/features/domain.py", line 13, in
from .feature import Feature, FeatureLocation, Location
File "/home/promt/asenv/lib/python3.9/site-packages/antismash/common/secmet/features/feature.py", line 13, in
from antismash.common.secmet.locations import (
File "/home/promt/asenv/lib/python3.9/site-packages/antismash/common/secmet/locations.py", line 9, in
from Bio.SeqFeature import (
ImportError: cannot import name 'AbstractPosition' from 'Bio.SeqFeature' (/home/promt/asenv/lib/python3.9/site-packages/Bio/SeqFeature.py)
How can I fix it? Thanks!
I also typed the following but to no avail:
antismash --help
antismash --help-showall

Related

Python importing messages module not working

I am trying to parse some protobuf messages and importing the messages module. However getting below error. Not sure what I am missing.
Please advise.
>>> import messages
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.8/dist-packages/messages/__init__.py", line 7, in <module>
from .api import send
File "/usr/local/lib/python3.8/dist-packages/messages/api.py", line 3, in <module>
from .email_ import Email
File "/usr/local/lib/python3.8/dist-packages/messages/email_.py", line 15, in <module>
from ._config import check_config_file
File "/usr/local/lib/python3.8/dist-packages/messages/_config.py", line 12, in <module>
import jsonconfig
File "/usr/local/lib/python3.8/dist-packages/jsonconfig/__init__.py", line 7, in <module>
from .core import Config
File "/usr/local/lib/python3.8/dist-packages/jsonconfig/core.py", line 11, in <module>
from .jsonutils import to_json_file, from_json_file
File "/usr/local/lib/python3.8/dist-packages/jsonconfig/jsonutils.py", line 29, in <module>
to_json = box._to_json
AttributeError: module 'box' has no attribute '_to_json'

Scrapy shell does not open

I have a conda virtual environment called scrape where I have scrapy installed. But whenever I type in the command scrapy shell I get the following error.
$ scrapy shell Traceback (most recent call last): File "C:\Users\Ravi\anaconda3\envs\scrape\Scripts\scrapy-script.py", line 6, in <module> from scrapy.cmdline import execute File "C:\Users\Ravi\anaconda3\envs\scrape\lib\site-packages\scrapy\__init__.py", line 12, in <module> from scrapy.spiders import Spider File "C:\Users\Ravi\anaconda3\envs\scrape\lib\site-packages\scrapy\spiders\__init__.py", line 11, in <module> from scrapy.http import Request File "C:\Users\Ravi\anaconda3\envs\scrape\lib\site-packages\scrapy\http\__init__.py", line 11, in <module> from scrapy.http.request.form import FormRequest File "C:\Users\Ravi\anaconda3\envs\scrape\lib\site-packages\scrapy\http\request\form.py", line 16, in <module> from scrapy.utils.response import get_base_url File "C:\Users\Ravi\anaconda3\envs\scrape\lib\site-packages\scrapy\utils\response.py", line 14, in <module> from twisted.web import http File "C:\Users\Ravi\anaconda3\envs\scrape\lib\site-packages\twisted\web\http.py", line 183, in <module> from twisted.web._http2 import H2Connection File "C:\Users\Ravi\anaconda3\envs\scrape\lib\site-packages\twisted\web\_http2.py", line 27, in <module> import h2.connection File "C:\Users\Ravi\anaconda3\envs\scrape\lib\site-packages\h2\connection.py", line 23, in <module> from .events import ( File "C:\Users\Ravi\anaconda3\envs\scrape\lib\site-packages\h2\events.py", line 14, in <module> from .settings import ChangedSetting, _setting_code_from_int File "C:\Users\Ravi\anaconda3\envs\scrape\lib\site-packages\h2\settings.py", line 25, in <module> class SettingCodes(enum.IntEnum): File "C:\Users\Ravi\anaconda3\envs\scrape\lib\site-packages\h2\settings.py", line 60, in SettingCodes ENABLE_CONNECT_PROTOCOL = SettingsFrame.ENABLE_CONNECT_PROTOCOL AttributeError: type object 'SettingsFrame' has no attribute 'ENABLE_CONNECT_PROTOCOL'
Fixed:
The problem was that Scrapy was either using an older version of h2 or not using one at all. pip install --upgrade h2 fixed it.

super error while programming a discord BOT with python

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.

Test framework quits unexpectedly - IntelliJ python plugin

I'm having a big problem with the testing framework in IntelliJ using with the python plugin.
When I launch my tests, written using unittest, the tests fail with an import error in the _jb_test_runner file.
I surfed the net for a while, but didn't get a useful solution. See the stacktrace below:
/usr/bin/python3.5 /home/davide/.IntelliJIdea2017.1/config/plugins/python/helpers/pycharm/_jb_unittest_runner.py --path /home/davide/Scrivania/musical-store/test/types/test_person.py
Testing started at 12.35 ...
Traceback (most recent call last):
File "/home/davide/.IntelliJIdea2017.1/config/plugins/python/helpers/pycharm/_jb_unittest_runner.py", line 4, in <module>
from unittest import main
File "/usr/lib/python3.5/unittest/__init__.py", line 58, in <module>
from .result import TestResult
File "/usr/lib/python3.5/unittest/result.py", line 5, in <module>
import traceback
File "/usr/lib/python3.5/traceback.py", line 5, in <module>
import linecache
File "/usr/lib/python3.5/linecache.py", line 8, in <module>
import functools
File "/usr/lib/python3.5/functools.py", line 22, in <module>
from types import MappingProxyType
ImportError: cannot import name 'MappingProxyType'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 62, in apport_excepthook
import re, traceback
File "/usr/lib/python3.5/traceback.py", line 5, in <module>
import linecache
File "/usr/lib/python3.5/linecache.py", line 8, in <module>
import functools
File "/usr/lib/python3.5/functools.py", line 22, in <module>
from types import MappingProxyType
ImportError: cannot import name 'MappingProxyType'
Original exception was:
Traceback (most recent call last):
File "/home/davide/.IntelliJIdea2017.1/config/plugins/python/helpers/pycharm/_jb_unittest_runner.py", line 4, in <module>
from unittest import main
File "/usr/lib/python3.5/unittest/__init__.py", line 58, in <module>
from .result import TestResult
File "/usr/lib/python3.5/unittest/result.py", line 5, in <module>
import traceback
File "/usr/lib/python3.5/traceback.py", line 5, in <module>
import linecache
File "/usr/lib/python3.5/linecache.py", line 8, in <module>
import functools
File "/usr/lib/python3.5/functools.py", line 22, in <module>
from types import MappingProxyType
ImportError: cannot import name 'MappingProxyType'
Process finished with exit code 1
The code does not present any syntax error, but the problem started after a refactoring of the whole project I'm working on.
Thanks in advance.

Cannot `import smtplib`

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.

Categories