pipenv install django failed on ubuntu - python

I tried to install django in my vscode, but the output is like this
(my ubuntu version is 20.04),is there something wrong with my ubuntu or my python?
pipenv install djangoTraceback (most recent call last):File "/usr/bin/pipenv", line 6, in <module>from pkg_resources import load_entry_pointFile "/usr/lib/python3/dist-packages/pkg_resources/_init_.py", line 3254, in <module>def _initialize_master_working_set():File "/usr/lib/python3/dist-packages/pkg_resources/_init_.py", line 3237, in _call_asidef(*args, **kwargs)File "/usr/lib/python3/dist-packages/pkg_resources/_init_.py", line 3266, in _initialize_master_working_setworking_set = WorkingSet._build_master()File "/usr/lib/python3/dist-packages/pkg_resources/_init_.py", line 584, in _build_masterws.require(_requires_)File "/usr/lib/python3/dist-packages/pkg_resources/_init_.py", line 901, in requireneeded = self.resolve(parse_requirements(requirements))File "/usr/lib/python3/dist-packages/pkg_resources/_init_.py", line 787, in resolveraise DistributionNotFound(req, requirers)pkg_resources.DistributionNotFound: The 'pathlib' distribution was not found and is required by pipenv
I tried use this
`sudo pip install --upgrade pip`
but i got this
Traceback (most recent call last):
File "/usr/bin/pip", line 11, in <module>
load_entry_point('pip==20.0.2', 'console_scripts', 'pip')()
File "/usr/lib/python3/dist-packages/pip/_internal/cli/main.py", line 73, in main
command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
File "/usr/lib/python3/dist-packages/pip/_internal/commands/__init__.py", line 96, in create_command
module = importlib.import_module(module_path)
File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/usr/lib/python3/dist-packages/pip/_internal/commands/install.py", line 24, in <module>
from pip._internal.cli.req_command import RequirementCommand
File "/usr/lib/python3/dist-packages/pip/_internal/cli/req_command.py", line 15, in <module>
from pip._internal.index.package_finder import PackageFinder
File "/usr/lib/python3/dist-packages/pip/_internal/index/package_finder.py", line 21, in <module>
from pip._internal.index.collector import parse_links
File "/usr/lib/python3/dist-packages/pip/_internal/index/collector.py", line 12, in <module>
from pip._vendor import html5lib, requests
ImportError: cannot import name 'html5lib' from 'pip._vendor' (/usr/lib/python3/dist-packages/pip/_vendor/__init__.py)

Related

AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK' error while using from snowflake.sqlalchemy import URL in python shell

Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 72, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 32, in <module>
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 12, in <module>
import os, glob, subprocess, os.path, time, pwd, sys, requests_unixsocket
File "/usr/lib/python3/dist-packages/requests_unixsocket/__init__.py", line 1, in <module>
import requests
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
File "<frozen zipimport>", line 259, in load_module
File "/usr/share/python-wheels/requests-2.22.0-py2.py3-none-any.whl/requests/__init__.py", line 95, in <module>
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
File "<frozen zipimport>", line 259, in load_module
File "/usr/share/python-wheels/urllib3-1.25.8-py2.py3-none-any.whl/urllib3/contrib/pyopenssl.py", line 46, in <module>
File "/usr/lib/python3/dist-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import crypto, SSL
File "/usr/lib/python3/dist-packages/OpenSSL/crypto.py", line 1553, in <module>
class X509StoreFlags(object):
File "/usr/lib/python3/dist-packages/OpenSSL/crypto.py", line 1573, in X509StoreFlags
CB_ISSUER_CHECK = _lib.X509_V_FLAG_CB_ISSUER_CHECK
AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'
I installed snowflake-sqlalchemy package in server after that
While importing from snowflake.sqlalchemy import URL in server it throughs this error.
I am using python3.8 and pip version.22. In spark shell also while importing this URL it throws the
same error.
AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'
ubuntu version 20

OSError: /usr/lib/libyara.so: cannot open shared object file: No such file or directory

I have some issue trying to run Volatility 3 Framework.
git clone https://github.com/volatilityfoundation/volatility3.git
cd volatility3/
python3 vol.py ../ramdumps/1289.raw windows.pslist.PsList
I got this error traceback:
Volatility 3 Framework 2.0.0
Failed to import '/usr/lib/libyara.so'
PATH = /home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/go/bin:/home/user/go/bin;/usr/lib
Traceback (most recent call last):
File "vol.py", line 10, in <module>
volatility3.cli.main()
File "/home/user/Documents/volatility3/volatility3/cli/__init__.py", line 625, in main
CommandLine().run()
File "/home/user/Documents/volatility3/volatility3/cli/__init__.py", line 229, in run
True) # Will not log as console's default level is WARNING
File "/home/user/Documents/volatility3/volatility3/framework/__init__.py", line 127, in import_files
ignore_errors)
File "/home/user/Documents/volatility3/volatility3/framework/__init__.py", line 152, in import_file
importlib.import_module(module)
File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/user/Documents/volatility3/volatility3/framework/plugins/yarascan.py", line 17, in <module>
import yara
File "/home/user/.local/lib/python3.6/site-packages/yara/__init__.py", line 7, in <module>
from yara.rules import compile
File "/home/user/.local/lib/python3.6/site-packages/yara/rules.py", line 17, in <module>
from yara.libyara_wrapper import *
File "/home/user/.local/lib/python3.6/site-packages/yara/libyara_wrapper.py", line 315, in <module>
libyaradll = cdll.LoadLibrary(library)
File "/usr/lib/python3.6/ctypes/__init__.py", line 426, in LoadLibrary
return self._dlltype(name)
File "/usr/lib/python3.6/ctypes/__init__.py", line 348, in __init__
self._handle = _dlopen(self._name, mode)
OSError: /usr/lib/libyara.so: cannot open shared object file: No such file or directory
Someone already had the same error a few years ago but none of the answers worked for me.
I'm using python 3.6.9 and Xubuntu 18.04.6
You have to uninstall yara with pip. Only tara-python must be installed.
Did you install the requirements with
pip3 install -r requirements.txt
?

pip --version failed on msys2

installed:
mingw-w64-x86_64-python-pip 21.0.1-2
mingw-w64-x86_64-python 3.8.8-2
environment variable:
PATH=/mingw64/bin:/usr/bin:/mingw64/lib/python3.8/lib-dynload:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
$ pip --version
Traceback (most recent call last):
File "C:\bin\msys64\mingw64\bin\pip-script.py", line 33, in <module>
sys.exit(load_entry_point('pip==21.0.1', 'console_scripts', 'pip')())
File "C:\bin\msys64\mingw64\bin\pip-script.py", line 25, in importlib_load_entry_point
return next(matches).load()
File "C:/bin/msys64/mingw64/lib/python3.8/importlib/metadata.py", line 77, in load
module = import_module(match.group('module'))
File "C:/bin/msys64/mingw64/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:/bin/msys64/mingw64/lib/python3.8/site-packages/pip/_internal/cli/main.py", line 8, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "C:/bin/msys64/mingw64/lib/python3.8/site-packages/pip/_internal/cli/autocompletion.py", line 9, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "C:/bin/msys64/mingw64/lib/python3.8/site-packages/pip/_internal/cli/main_parser.py", line 7, in <module>
from pip._internal.cli import cmdoptions
File "C:/bin/msys64/mingw64/lib/python3.8/site-packages/pip/_internal/cli/cmdoptions.py", line 22, in <module>
from pip._internal.cli.progress_bars import BAR_TYPES
File "C:/bin/msys64/mingw64/lib/python3.8/site-packages/pip/_internal/cli/progress_bars.py", line 9, in <module>
from pip._internal.utils.logging import get_indentation
File "C:/bin/msys64/mingw64/lib/python3.8/site-packages/pip/_internal/utils/logging.py", line 14, in <module>
from pip._internal.utils.misc import ensure_dir
File "C:/bin/msys64/mingw64/lib/python3.8/site-packages/pip/_internal/utils/misc.py", line 20, in <module>
from pip._vendor import pkg_resources
File "C:/bin/msys64/mingw64/lib/python3.8/site-packages/pip/_vendor/pkg_resources/__init__.py", line 35, in <module>
import plistlib
File "C:/bin/msys64/mingw64/lib/python3.8/plistlib.py", line 65, in <module>
from xml.parsers.expat import ParserCreate
File "C:/bin/msys64/mingw64/lib/python3.8/xml/parsers/expat.py", line 4, in <module>
from pyexpat import *
ImportError: DLL load failed while importing pyexpat: ▒Ҳ▒▒▒ָ▒▒▒▒ģ▒顣
[0x7FF8AD8DE0A4] ANOMALY: use of REX.w is meaningless (default operand size is 64)
[0x7FF8AD8DE0A4] ANOMALY: use of REX.w is meaningless (default operand size is 64)
please help me, big brother

ImportError: cannot import name 'memoize' when doing python3 manage.py migrate

I have an issue with migration in Django using python3 manage.py migrate it shows me about memoize
I have installed django-memoize and included it on my settings.py but it still shows the error.
Traceback (most recent call last):
File "manage.py", line 15, in <module>
execute_from_command_line(sys.argv)
File "/home/mycomputer/.local/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "/home/mycomputer/.local/lib/python3.6/site-packages/django/core/management/__init__.py", line 357, in execute
django.setup()
File "/home/mycomputer/.local/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/mycomputer/.local/lib/python3.6/site-packages/django/apps/registry.py", line 122, in populate
app_config.ready()
File "/home/mycomputer/.local/lib/python3.6/site-packages/django/contrib/admin/apps.py", line 24, in ready
self.module.autodiscover()
File "/home/mycomputer/.local/lib/python3.6/site-packages/django/contrib/admin/__init__.py", line 26, in autodiscover
autodiscover_modules('admin', register_to=site)
File "/home/mycomputer/.local/lib/python3.6/site-packages/django/utils/module_loading.py", line 47, in autodiscover_modules
import_module('%s.%s' % (app_config.name, module_to_search))
File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/mycomputer/.local/lib/python3.6/site-packages/adminsortable/admin.py", line 15, in <module>
from django.shortcuts import render
File "/home/mycomputer/.local/lib/python3.6/site-packages/django/shortcuts/__init__.py", line 14, in <module>
from django.core import urlresolvers
File "/home/mycomputer/.local/lib/python3.6/site-packages/django/core/urlresolvers.py", line 19, in <module>
from django.utils.functional import memoize, lazy
ImportError: cannot import name 'memoize'
It should have migrated after installation of memoize.
Thank you for all the support I need to install some dependencies and re-install my python then after that I created a virtual environment and install dependencies.

Srapy startproject error - Python 3 - BashOnUbuntuOnWindows

I try to use Scrapy for the first time in a Bash On Ubuntu On Windows 10 and get this error when i start a new project:
(myvenv) mothinx#DESKTOP-4M9JDPL:~/laplanetebleue$ scrapy startproject laplanetebleue
Traceback (most recent call last):
File "/home/mothinx/laplanetebleue/myvenv/bin/scrapy", line 11, in <module>
sys.exit(execute())
File "/home/mothinx/laplanetebleue/myvenv/lib/python3.5/site-packages/scrapy/cmdline.py", line 128, in execute
cmds = _get_commands_dict(settings, inproject)
File "/home/mothinx/laplanetebleue/myvenv/lib/python3.5/site-packages/scrapy/cmdline.py", line 46, in _get_commands_dict
cmds = _get_commands_from_module('scrapy.commands', inproject)
File "/home/mothinx/laplanetebleue/myvenv/lib/python3.5/site-packages/scrapy/cmdline.py", line 29, in _get_commands_from_module
for cmd in _iter_command_classes(module):
File "/home/mothinx/laplanetebleue/myvenv/lib/python3.5/site-packages/scrapy/cmdline.py", line 19, in _iter_command_classes
for module in walk_modules(module_name):
File "/home/mothinx/laplanetebleue/myvenv/lib/python3.5/site-packages/scrapy/utils/misc.py", line 71, in walk_modules
submod = import_module(fullpath)
File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 986, in _gcd_import
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 665, in exec_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "/home/mothinx/laplanetebleue/myvenv/lib/python3.5/site-packages/scrapy/commands/version.py", line 6, in <module>
import OpenSSL
File "/home/mothinx/laplanetebleue/myvenv/lib/python3.5/site-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import crypto, SSL
File "/home/mothinx/laplanetebleue/myvenv/lib/python3.5/site-packages/OpenSSL/crypto.py", line 16, in <module>
from OpenSSL._util import (
File "/home/mothinx/laplanetebleue/myvenv/lib/python3.5/site-packages/OpenSSL/_util.py", line 6, in <module>
from cryptography.hazmat.bindings.openssl.binding import Binding
File "/home/mothinx/laplanetebleue/myvenv/lib/python3.5/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 13, in <module>
from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: /home/mothinx/laplanetebleue/myvenv/lib/python3.5/site-packages/cryptography/hazmat/bindings/_openssl.abi3.so: cannot enable executable stack as shared object requires: Invalid argument
pip freeze:
asn1crypto==0.22.0
attrs==17.2.0
Automat==0.6.0
cffi==1.11.0
constantly==15.1.0
cryptography==2.0.3
cssselect==1.0.1
hyperlink==17.3.1
idna==2.6
incremental==17.5.0
lxml==4.0.0
parsel==1.2.0
pkg-resources==0.0.0
pyasn1==0.3.5
pyasn1-modules==0.1.4
pycparser==2.18
PyDispatcher==2.0.5
pyOpenSSL==17.3.0
queuelib==1.4.2
Scrapy==1.4.0
service-identity==17.0.0
six==1.11.0
Twisted==17.5.0
w3lib==1.18.0
zope.interface==4.4.2
Is it a problem with crypto or pyOpenSSL ? Pretty new here in python, can someone decrypt me the Traceback ?

Categories

Resources