I'm trying to get paperless installed, and am running into an issue with dotenv under python. I've some digging, and ended up doing an uninstall of dotenv and then an install of python-dotenv via pip. I'm still running into the same error. Any help would be greatly appreciated!
Traceback (most recent call last):
File "./manage.py", line 18, in <module>
execute_from_command_line(sys.argv)
File "/usr/lib/python3/dist-packages/django/core/management/__init__.py", line 363, in execute_from_command_line
utility.execute()
File "/usr/lib/python3/dist-packages/django/core/management/__init__.py", line 307, in execute
settings.INSTALLED_APPS
File "/usr/lib/python3/dist-packages/django/conf/__init__.py", line 56, in __getattr__
self._setup(name)
File "/usr/lib/python3/dist-packages/django/conf/__init__.py", line 41, in _setup
self._wrapped = Settings(settings_module)
File "/usr/lib/python3/dist-packages/django/conf/__init__.py", line 110, in __init__
mod = importlib.import_module(self.SETTINGS_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 "/var/www/paperless/paperless/src/paperless/settings.py", line 15, in <module>
from dotenv import load_dotenv
ModuleNotFoundError: No module named 'dotenv'
I'm running
Linux ubuntu 4.13.0-21-generic #24-Ubuntu SMP Mon Dec 18 17:29:16 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Python 3.6.3
pip install python-dotenv returns Successfully installed python-dotenv-0.8.2
First check for dotenv with 'pip3 list'
install it if not on the list with: 'pip3 install python-dotenv'
Results:
Collecting python-dotenv
Downloading python_dotenv-0.20.0-py3-none-any.whl (17 kB)
Installing collected packages: python-dotenv
Successfully installed python-dotenv-0.20.0
Related
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
?
I'm facing this issue when I was trying to install matplotlib library using pip.
Then I found out that this error still occurs even when I try to install other libraries.
My python installation path -
C:\Program Files\Python38\python.exe
I did this - PS C:\Users\mihir> pip install matplotlib
Using the admin mode inside Windows Terminal. Still shows the same when I run in CMD prompt in admin mode.
Traceback (most recent call last):
File "c:\program files\python38\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\program files\python38\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Program Files\Python38\Scripts\pip.exe\__main__.py", line 7, in <module>
File "C:\Users\mihir\AppData\Roaming\Python\Python38\site-packages\pip\_internal\cli\main.py", line 73, in main
command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
File "C:\Users\mihir\AppData\Roaming\Python\Python38\site-packages\pip\_internal\commands\__init__.py", line 104, in create_command
module = importlib.import_module(module_path)
File "c:\program files\python38\lib\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:\Users\mihir\AppData\Roaming\Python\Python38\site-packages\pip\_internal\commands\install.py", line 17, in <module>
from pip._internal.cli.req_command import RequirementCommand, with_cleanup
File "C:\Users\mihir\AppData\Roaming\Python\Python38\site-packages\pip\_internal\cli\req_command.py", line 16, in <module>
from pip._internal.index.collector import LinkCollector
File "C:\Users\mihir\AppData\Roaming\Python\Python38\site-packages\pip\_internal\index\collector.py", line 14, in <module>
from pip._vendor import html5lib, requests
File "C:\Users\mihir\AppData\Roaming\Python\Python38\site-packages\pip\_vendor\html5lib\__init__.py", line 25, in <module>
from .html5parser import HTMLParser, parse, parseFragment
File "C:\Users\mihir\AppData\Roaming\Python\Python38\site-packages\pip\_vendor\html5lib\html5parser.py", line 6, in <module>
from . import _inputstream
File "C:\Users\mihir\AppData\Roaming\Python\Python38\site-packages\pip\_vendor\html5lib\_inputstream.py", line 10, in <module>
from pip._vendor import webencodings
ImportError: cannot import name 'webencodings' from 'pip._vendor' (C:\Users\mihir\AppData\Roaming\Python\Python38\site-packages\pip\_vendor\__init__.py)```<br>
You must have inadvertently upgraded your system pip (probably through something like pip install pip --upgrade)
If so, you will need to reinstall pip:
pip uninstall matplotlib
pip install matplotlib
Reinstalling the whole Python Interpreter helped me!
I am trying to install the following dependencies:
appdirs==1.4.3
click==6.7
Flask==1.0
itsdangerous==0.24
Jinja2==2.10.1
MarkupSafe==1.0
packaging==16.8
prometheus-client==0.0.19
pyparsing==2.2.0
Werkzeug==0.15.3
But no matter which dependency I try to install I get the following error:
Traceback (most recent call last):
File "/usr/bin/pip", line 11, in <module>
load_entry_point('pip==19.3', 'console_scripts', 'pip')()
File "/usr/lib/python3.8/site-packages/pip/_internal/main.py", line 45, in main
command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
File "/usr/lib/python3.8/site-packages/pip/_internal/commands/__init__.py", line 96, in create_command
module = importlib.import_module(module_path)
File "/usr/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 "/usr/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 24, in <module>
from pip._internal.cli.req_command import RequirementCommand
File "/usr/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 28, in <module>
from pip._internal.self_outdated_check import (
File "/usr/lib/python3.8/site-packages/pip/_internal/self_outdated_check.py", line 15, in <module>
from pip._vendor.six import ensure_binary
ImportError: cannot import name 'ensure_binary' from 'six' (/usr/lib/python3.8/site-packages/six.py)
What is the issue?
Posting this answer here specifically for people that use Manjaro Linux (where the use of pip is not recommended as it can break one's environment if not used correctly). It can also result in subsequent distro updates to not happen seamlessly and may result in manual intervention required.
The solution to undo the damage to the environment is to use:
sudo pacman -Syu python-pkgname --overwrite='*'
where pkgname is the name of the python dependency you want to install. After this is done, the environment should be fixed and subsequently it will not be required to apply the --overwrite option.
This whole Python 2 and Python 3 and the resulting pip2 and pip3 tools separation is insane.
Strange, this happened after i upgraded to 1.10.3 on Ubuntu 16, Anaconda Distribution. The old 0.9 worked fine for me. Reinstalled multiple times as well, no difference.
➜ django-admin startproject django_tutorial
Traceback (most recent call last):
File "/storage/programfiles/anaconda3/bin/django-admin", line 11, in <module>
sys.exit(execute_from_command_line())
File "/storage/programfiles/anaconda3/lib/python3.5/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
utility.execute()
File "/storage/programfiles/anaconda3/lib/python3.5/site-packages/django/core/management/__init__.py", line 316, in execute
settings.INSTALLED_APPS
File "/storage/programfiles/anaconda3/lib/python3.5/site-packages/django/conf/__init__.py", line 53, in __getattr__
self._setup(name)
File "/storage/programfiles/anaconda3/lib/python3.5/site-packages/django/conf/__init__.py", line 41, in _setup
self._wrapped = Settings(settings_module)
File "/storage/programfiles/anaconda3/lib/python3.5/site-packages/django/conf/__init__.py", line 97, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/storage/programfiles/anaconda3/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 944, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 986, in _gcd_import
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 956, in _find_and_load_unlocked
ImportError: No module named 'dash'
Can't find anything on google, anyone have any ideas? :)
EDIT:
Django-admin is installed at:
➜ ~ which django-admin
/storage/programfiles/anaconda3/bin/django-admin
Stuff I've tried so far:
1) Multiple pip uninstall Django and pip install Django
2) Verifying site-packages has Django uninstalled and reinstalling again
3) After uninstall, pip freeze | grep Django shows nothing.
4) pip install django-dash
Solves it, but now the error is ImportError: No module named 'dash.development_settings'
Strange:
python -m django --version
throws the same ImportError: No module named 'dash.development_settings'
but I can run python in a terminal and do
import django
django.get_version()
and it works fine
You don't have django-dash installed
pip install django-dash
Or remove dash and dash. related apps from INSTALLED_APPS
I finally figured out what the hell was wrong.
my bashrc had export DJANGO_SETTINGS = dash.development_settings or something like that (deleted it already) and removing that line worked.
Okay, Im trying to use cryptoassets.django here. Iv got some help from Mikko about the python version being an issue(I was using 2.7.x, cryptoassets uses 3.4.x). I just solved by doing this
$virtualenv -p python3 venv
I also reinstalled Django because manage.py was pulling up error, probably because it was overwriting the bin/activate.. files.
With that out of the way. I installed the cryptoassets.django app
$pip3 install cryptoassets.django
Wonderfull. I set it up like the tutorial on bitbucket for the cryptoassets django intergration.
The problem comes in when i try to initialize the cryptoasset database with
$python manage.py cryptoassets_initialize_database
I get an Import error:
ImportError: No module named 'zope'
Here is the Traceback
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/caleb/Desktop/bitkoin/lib/python3.4/site- packages/django/core/management/__init__.py", line 351, in execute_from_command_line
utility.execute()
File "/home/caleb/Desktop/bitkoin/lib/python3.4/site-packages/django/core/management/__init__.py", line 343, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/caleb/Desktop/bitkoin/lib/python3.4/site-packages/django/core/management/__init__.py", line 190, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/home/caleb/Desktop/bitkoin/lib/python3.4/site-packages/django/core/management/__init__.py", line 40, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "/home/caleb/Desktop/bitkoin/lib/python3.4/importlib/__init__.py", line 109, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
File "<frozen importlib._bootstrap>", line 1129, in _exec
File "<frozen importlib._bootstrap>", line 1471, in exec_module
File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
File "/home/caleb/Desktop/bitkoin/lib/python3.4/site-packages/cryptoassets/django/management/commands/cryptoassets_initialize_database.py", line 5, in <module>
from cryptoassets.core.service.main import Service
File "/home/caleb/Desktop/bitkoin/lib/python3.4/site-packages/cryptoassets/core/service/main.py", line 25, in <module>
from ..configure import Configurator
File "/home/caleb/Desktop/bitkoin/lib/python3.4/site-packages/cryptoassets/core/configure.py", line 13, in <module>
from zope.dottedname.resolve import resolve
ImportError: No module named 'zope'
What could be the issue now.
Cryptoassets is Python 3.4+ only and you are trying to run it on Python 2.