When importing djcelery i am getting the below error. Is there any other method to install?
Traceback (most recent call last):
File "manage.py", line 15, in <module>
import settings
File "/home/c0mrade/Documents/wipi/wishpicker/settings.py", line 7, in <module>
import djcelery
File "/usr/local/lib/python2.7/dist-packages/djcelery/__init__.py", line 22, in <module>
from celery import current_app as celery # noqa
File "/usr/local/lib/python2.7/dist-packages/celery/five.py", line 307, in __getattr__
module = __import__(self._object_origins[name], None, None, [name])
File "/usr/local/lib/python2.7/dist-packages/celery/_state.py", line 20, in <module>
from celery.utils.threads import LocalStack
File "/usr/local/lib/python2.7/dist-packages/celery/utils/__init__.py", line 351, in <module>
from .functional import chunks, noop # noqa
File "/usr/local/lib/python2.7/dist-packages/celery/utils/functional.py", line 18, in <module>
from kombu.utils.functional import lazy, maybe_evaluate, is_list, maybe_list
ImportError: cannot import name lazy
sudo pip install -U django-celery
if you use ubuntu variants. This upgrades all your packages django-celery is dependent on
Related
i have problem with import pandas package on one of my hosting accounts:
Pandas is installed (v 1.5.1)
I've tested import pandas on other hosting accounts
It is shared hosting. I cannot do sudo commands. Anaconda also can't be installed
I'm using python 3.9.0
I've tested it on virtual env ( response listed below ) and also without virtual env
source ~/.virtualenvs/MY_VIRTUAL_ENV_NAME/bin/activate
$ python3
>>> import pandas as pa
and i recive response:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/MY_LOGIN/.virtualenvs/MY_VIRTUAL_ENV_NAME/lib/python3.9/site-packages/pandas/__init__.py", line 48, in <module>
from pandas.core.api import (
File "/home/MY_LOGIN/.virtualenvs/MY_VIRTUAL_ENV_NAME/lib/python3.9/site-packages/pandas/core/api.py", line 47, in <module>
from pandas.core.groupby import (
File "/home/MY_LOGIN/.virtualenvs/MY_VIRTUAL_ENV_NAME/lib/python3.9/site-packages/pandas/core/groupby/__init__.py", line 1, in <module>
from pandas.core.groupby.generic import (
File "/home/MY_LOGIN/.virtualenvs/MY_VIRTUAL_ENV_NAME/lib/python3.9/site-packages/pandas/core/groupby/generic.py", line 76, in <module>
from pandas.core.frame import DataFrame
File "/home/MY_LOGIN/.virtualenvs/MY_VIRTUAL_ENV_NAME/lib/python3.9/site-packages/pandas/core/frame.py", line 170, in <module>
from pandas.core.generic import NDFrame
File "/home/MY_LOGIN/.virtualenvs/MY_VIRTUAL_ENV_NAME/lib/python3.9/site-packages/pandas/core/generic.py", line 147, in <module>
from pandas.core.describe import describe_ndframe
File "/home/MY_LOGIN/.virtualenvs/MY_VIRTUAL_ENV_NAME/lib/python3.9/site-packages/pandas/core/describe.py", line 45, in <module>
from pandas.io.formats.format import format_percentiles
File "/home/MY_LOGIN/.virtualenvs/MY_VIRTUAL_ENV_NAME/lib/python3.9/site-packages/pandas/io/formats/format.py", line 105, in <module>
from pandas.io.common import (
File "/home/MY_LOGIN/.virtualenvs/MY_VIRTUAL_ENV_NAME/lib/python3.9/site-packages/pandas/io/common.py", line 8, in <module>
import bz2
File "/home/MY_LOGIN/.local/lib/python3.9/bz2.py", line 18, in <module>
from _bz2 import BZ2Compressor, BZ2Decompressor
ImportError: libbz2.so.1.0: cannot open shared object file: No such file or directory
when trying to run the command: airflow webserver - i get the below error message
i am having issues getting the application to launch.
python 3.8.0
postgress latest version
Airflow Latest Version
we are having troubles finding an answer to this in the forums / through basic google searching, thank you in advance!
~$ airflow webserver
Traceback (most recent call last):
File "/usr/local/bin/airflow", line 5, in <module>
from airflow.__main__ import main
File "/usr/local/lib/python3.8/dist-packages/airflow/__init__.py", line 34, in <module>
from airflow import settings
File "/usr/local/lib/python3.8/dist-packages/airflow/settings.py", line 35, in <module>
from airflow.configuration import AIRFLOW_HOME, WEBSERVER_CONFIG, conf # NOQA F401
File "/usr/local/lib/python3.8/dist-packages/airflow/configuration.py", line 1115, in <module>
conf = initialize_config()
File "/usr/local/lib/python3.8/dist-packages/airflow/configuration.py", line 829, in initialize_config
from cryptography.fernet import Fernet
File "/usr/lib/python3/dist-packages/cryptography/fernet.py", line 17, in <module>
from cryptography.hazmat.primitives import hashes, padding
File "/usr/lib/python3/dist-packages/cryptography/hazmat/primitives/padding.py", line 13, in <module>
from cryptography.hazmat.bindings._padding import lib
ModuleNotFoundError: No module named '_cffi_backend'
I have installed bandit with pip but when I run bandit --help in the command line, I get the following error:
Traceback (most recent call last):
File "/home/alipqb/.local/share/virtualenvs/django_with_pytest-FUuC6zdm/bin/bandit", line 5, in <module>
from bandit.cli.main import main
File "/home/alipqb/.local/share/virtualenvs/django_with_pytest-FUuC6zdm/lib/python3.8/site-packages/bandit/__init__.py", line 19, in <module>
from bandit.core import config # noqa
File "/home/alipqb/.local/share/virtualenvs/django_with_pytest-FUuC6zdm/lib/python3.8/site-packages/bandit/core/__init__.py", line 17, in <module>
from bandit.core import config # noqa
File "/home/alipqb/.local/share/virtualenvs/django_with_pytest-FUuC6zdm/lib/python3.8/site-packages/bandit/core/config.py", line 12, in <module>
from bandit.core import extension_loader
File "/home/alipqb/.local/share/virtualenvs/django_with_pytest-FUuC6zdm/lib/python3.8/site-packages/bandit/core/extension_loader.py", line 109, in <module>
MANAGER = Manager()
File "/home/alipqb/.local/share/virtualenvs/django_with_pytest-FUuC6zdm/lib/python3.8/site-packages/bandit/core/extension_loader.py", line 27, in __init__
self.load_blacklists(blacklists_namespace)
File "/home/alipqb/.local/share/virtualenvs/django_with_pytest-FUuC6zdm/lib/python3.8/site-packages/bandit/core/extension_loader.py", line 78, in load_blacklists
for val in six.itervalues(self.blacklist):
AttributeError: module 'six' has no attribute 'itervalues'
Also I should mention that bandit is in the path and there is no problem with it.
What should I do?
This is the hints,how can I resolve it?
I use Python 3.5.1 created a virtual envirement by virtualenv
The source code works well on my friend's computer machine
Error:
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "A:\Python3.5\lib\site-packages\django\core\management\__init__.py", line 385, in execute_from_command_line
utility.execute()
File "A:\Python3.5\lib\site-packages\django\core\management\__init__.py", line 354, in execute
django.setup()
File "A:\Python3.5\lib\site-packages\django\__init__.py", line 18, in setup
from django.utils.log import configure_logging
File "A:\Python3.5\lib\site-packages\django\utils\log.py", line 13, in <module>
from django.views.debug import ExceptionReporter, get_exception_reporter_filter
File "A:\Python3.5\lib\site-packages\django\views\debug.py", line 10, in <module>
from django.http import (HttpResponse, HttpResponseServerError,
File "A:\Python3.5\lib\site-packages\django\http\__init__.py", line 4, in <module>
from django.http.response import (
File "A:\Python3.5\lib\site-packages\django\http\response.py", line 13, in <module>
from django.core.serializers.json import DjangoJSONEncoder
File "A:\Python3.5\lib\site-packages\django\core\serializers\__init__.py", line 23, in <module>
from django.core.serializers.base import SerializerDoesNotExist
File "A:\Python3.5\lib\site-packages\django\core\serializers\base.py", line 6, in <module>
from django.db import models
File "A:\Python3.5\lib\site-packages\django\db\models\__init__.py", line 6, in <module>
from django.db.models.query import Q, QuerySet, Prefetch # NOQA
File "A:\Python3.5\lib\site-packages\django\db\models\query.py", line 13, in <module>
from django.db.models.fields import AutoField, Empty
File "A:\Python3.5\lib\site-packages\django\db\models\fields\__init__.py", line 18, in <module>
from django import forms
File "A:\Python3.5\lib\site-packages\django\forms\__init__.py", line 6, in <module>
from django.forms.fields import * # NOQA
File "A:\Python3.5\lib\site-packages\django\forms\fields.py", line 18, in <module>
from django.forms.utils import from_current_timezone, to_current_timezone
File "A:\Python3.5\lib\site-packages\django\forms\utils.py", line 15, in <module>
from django.utils.html import format_html, format_html_join, escape
File "A:\Python3.5\lib\site-packages\django\utils\html.py", line 16, in <module>
from .html_parser import HTMLParser, HTMLParseError
File "A:\Python3.5\lib\site-packages\django\utils\html_parser.py", line 12, in <module>
HTMLParseError = _html_parser.HTMLParseError
AttributeError: module 'html.parser' has no attribute 'HTMLParseError'
As you can read here this error is raised...
because HTMLParseError is deprecated from Python 3.3 onwards and removed in Python 3.5.
What you can do is downgrade your Python version or upgrade your Django version.
I've just got the same error here. The Django version installed on my machine was 1.7.
Upgrading to Django 1.8.* solved the problem for me.
You can upgrade your Django using following command:
If you are using pip3:
sudo pip3 install django --upgrade
If pip:
sudo pip install django --upgrade
pip install Django --upgrade
python manage.py runserver
I have a ubuntu server.(10.04)
I don't install requests module. I try pip and other methods. Usually ;
$ sudo pip install requests
Traceback (most recent call last):
File "/usr/local/lib/python3.1/dist-packages/pip-1.5.5-py3.1.egg/pip/_vendor/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py", line 3, in <module>
from ssl import CertificateError, match_hostname
ImportError: cannot import name CertificateError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.1/dist-packages/pip-1.5.5-py3.1.egg/pip/_vendor/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py", line 7, in <module>
from backports.ssl_match_hostname import CertificateError, match_hostname
ImportError: No module named backports.ssl_match_hostname
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/pip", line 9, in <module>
load_entry_point('pip==1.5.5', 'console_scripts', 'pip')()
File "/usr/local/lib/python3.1/dist-packages/distribute-0.6.49-py3.1.egg/pkg_resources.py", line 345, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/local/lib/python3.1/dist-packages/distribute-0.6.49-py3.1.egg/pkg_resources.py", line 2382, in load_entry_point
return ep.load()
File "/usr/local/lib/python3.1/dist-packages/distribute-0.6.49-py3.1.egg/pkg_resources.py", line 2088, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/usr/local/lib/python3.1/dist-packages/pip-1.5.5-py3.1.egg/pip/__init__.py", line 11, in <module>
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File "/usr/local/lib/python3.1/dist-packages/pip-1.5.5-py3.1.egg/pip/vcs/mercurial.py", line 9, in <module>
from pip.download import path_to_url
File "/usr/local/lib/python3.1/dist-packages/pip-1.5.5-py3.1.egg/pip/download.py", line 22, in <module>
from pip._vendor import requests, six
File "/usr/local/lib/python3.1/dist-packages/pip-1.5.5-py3.1.egg/pip/_vendor/requests/__init__.py", line 58, in <module>
from . import utils
File "/usr/local/lib/python3.1/dist-packages/pip-1.5.5-py3.1.egg/pip/_vendor/requests/utils.py", line 25, in <module>
from .compat import parse_http_list as _parse_list_header
File "/usr/local/lib/python3.1/dist-packages/pip-1.5.5-py3.1.egg/pip/_vendor/requests/compat.py", line 7, in <module>
from .packages import chardet
File "/usr/local/lib/python3.1/dist-packages/pip-1.5.5-py3.1.egg/pip/_vendor/requests/packages/__init__.py", line 3, in <module>
from . import urllib3
File "/usr/local/lib/python3.1/dist-packages/pip-1.5.5-py3.1.egg/pip/_vendor/requests/packages/urllib3/__init__.py", line 16, in <module>
from .connectionpool import (
File "/usr/local/lib/python3.1/dist-packages/pip-1.5.5-py3.1.egg/pip/_vendor/requests/packages/urllib3/connectionpool.py", line 31, in <module>
from .packages.ssl_match_hostname import CertificateError
File "/usr/local/lib/python3.1/dist-packages/pip-1.5.5-py3.1.egg/pip/_vendor/requests/packages/urllib3/packages/__init__.py", line 3, in <module>
from . import ssl_match_hostname
File "/usr/local/lib/python3.1/dist-packages/pip-1.5.5-py3.1.egg/pip/_vendor/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py", line 10, in <module>
from _implementation import CertificateError, match_hostname
ImportError: No module named _implementation
I guess I have already setup pip 3.1. But following
$ pip -V
Then I see same problem. How to install requests module for Python 3.1 ubuntu server 10.04?
Have you tried easy_install requests?
Or you could try a non-fancy way. Google requests package, download it, unzip it and then run setup.py script like this:
python setup.py install
Have you tried pip install backports.ssl-match-hostname
Probably no harm to upgrade Python either.