Related
Django is running into an issue where when I try to run the PyGraphViz manage.py script it errors when it tries to import django.core.management
Traceback (most recent call last):
File "/home/zoctavous/.local/lib/python3.8/site-packages/django/core/management/__init__.py", line 259, in fetch_command
app_name = commands[subcommand]
KeyError: 'graph_models'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./manage.py", line 21, in <module>
main()
File "./manage.py", line 17, in main
execute_from_command_line(sys.argv)
File "/home/zoctavous/.local/lib/python3.8/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
utility.execute()
File "/home/zoctavous/.local/lib/python3.8/site-packages/django/core/management/__init__.py", line 440, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/zoctavous/.local/lib/python3.8/site-packages/django/core/management/__init__.py", line 266, in fetch_command
settings.INSTALLED_APPS
File "/home/zoctavous/.local/lib/python3.8/site-packages/django/conf/__init__.py", line 92, in __getattr__
self._setup(name)
File "/home/zoctavous/.local/lib/python3.8/site-packages/django/conf/__init__.py", line 79, in _setup
self._wrapped = Settings(settings_module)
File "/home/zoctavous/.local/lib/python3.8/site-packages/django/conf/__init__.py", line 190, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
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 961, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'core'
nevermind that this module imports just fine when I open a python shell. I tried just pip install django and I can verify that it is in my venv.
Sort of at a loss.
I've recently cloned my django project into a linux vps. I used python3.10 in my system but in vps I have python3.8 . Actually I installed all necessary packages for it and also created database. I have this error whenever I run commands start with python manage.py. Can any body help me to solve it? Maybe this error is for different python version?
It also raised the error ModuleNotFoundError: No module named 'mysite' but I have no idea where I defined 'mysite' module.
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/django/core/management/base.py", line 402, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.8/dist-packages/django/core/management/commands/runserver.py", line 74, in execute
super().execute(*args, **options)
File "/usr/local/lib/python3.8/dist-packages/django/core/management/base.py", line 448, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python3.8/dist-packages/django/core/management/commands/runserver.py", line 81, in handle
if not settings.DEBUG and not settings.ALLOWED_HOSTS:
File "/usr/local/lib/python3.8/dist-packages/django/conf/__init__.py", line 92, in __getattr__
self._setup(name)
File "/usr/local/lib/python3.8/dist-packages/django/conf/__init__.py", line 79, in _setup
self._wrapped = Settings(settings_module)
File "/usr/local/lib/python3.8/dist-packages/django/conf/__init__.py", line 190, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
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 961, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'mysite'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "manage.py", line 22, in <module>
main()
File "manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.8/dist-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.8/dist-packages/django/core/management/__init__.py", line 440, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.8/dist-packages/django/core/management/base.py", line 415, in run_from_argv
connections.close_all()
File "/usr/local/lib/python3.8/dist-packages/django/utils/connection.py", line 84, in close_all
for conn in self.all(initialized_only=True):
File "/usr/local/lib/python3.8/dist-packages/django/utils/connection.py", line 76, in all
return [
File "/usr/local/lib/python3.8/dist-packages/django/utils/connection.py", line 73, in __iter__
return iter(self.settings)
File "/usr/local/lib/python3.8/dist-packages/django/utils/functional.py", line 57, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/usr/local/lib/python3.8/dist-packages/django/utils/connection.py", line 45, in settings
self._settings = self.configure_settings(self._settings)
File "/usr/local/lib/python3.8/dist-packages/django/db/utils.py", line 148, in configure_settings
databases = super().configure_settings(databases)
File "/usr/local/lib/python3.8/dist-packages/django/utils/connection.py", line 50, in configure_settings
settings = getattr(django_settings, self.settings_name)
File "/usr/local/lib/python3.8/dist-packages/django/conf/__init__.py", line 92, in __getattr__
self._setup(name)
File "/usr/local/lib/python3.8/dist-packages/django/conf/__init__.py", line 79, in _setup
self._wrapped = Settings(settings_module)
File "/usr/local/lib/python3.8/dist-packages/django/conf/__init__.py", line 190, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
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 961, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'mysite'
When I use py2app with option -An all work.
But without I have an error with pandas import.
I try an example code:
import sys
from PyQt5.QtWidgets import QApplication, QWidget
import pandas as pd
def main():
df = pd.read_csv("data.csv")
app = QApplication(sys.argv)
file = "theme.stylesheet"
w = QWidget()
w.resize(250, 150)
w.move(300, 300)
w.setWindowTitle('Simple')
with open(file,'r') as fh:
w.setStyleSheet(fh.read())
w.show()
sys.exit(app.exec_())
if __name__ == '__main__':
main()
And then python setup.py py2app
With setup.py:
from setuptools import setup
APP = ['main.py']
OPTIONS = {'argv_emulation': True}
DATA_FILES = ['theme.stylesheet', 'data.csv']
setup(
app=APP,
data_files=DATA_FILES,
options={'py2app':OPTIONS},
setup_requires=['py2app']
)
But I have this error:
Traceback (most recent call last):
File "<frozen zipimport>", line 259, in load_module
File "pandas/_libs/tslibs/conversion.pyc", line 14, in <module>
File "pandas/_libs/tslibs/conversion.pyc", line 10, in __load
File "imp.pyc", line 342, in load_dynamic
File "<frozen importlib._bootstrap>", line 711, in _load
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 1181, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "pandas/_libs/tslibs/conversion.pyx", line 1, in init pandas._libs.tslibs.conversion
ModuleNotFoundError: No module named 'pandas._libs.tslibs.base'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<frozen zipimport>", line 259, in load_module
File "pandas/_libs/missing.pyc", line 14, in <module>
File "pandas/_libs/missing.pyc", line 10, in __load
File "imp.pyc", line 342, in load_dynamic
File "<frozen importlib._bootstrap>", line 711, in _load
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 1181, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "pandas/_libs/missing.pyx", line 1, in init pandas._libs.missing
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
File "<frozen zipimport>", line 259, in load_module
File "pandas/_libs/tslibs/__init__.pyc", line 31, in <module>
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
File "<frozen zipimport>", line 261, in load_module
KeyError: 'pandas._libs.tslibs.conversion'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<frozen zipimport>", line 259, in load_module
File "pandas/_libs/hashtable.pyc", line 14, in <module>
File "pandas/_libs/hashtable.pyc", line 10, in __load
File "imp.pyc", line 342, in load_dynamic
File "<frozen importlib._bootstrap>", line 711, in _load
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 1181, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "pandas/_libs/hashtable.pyx", line 1, in init pandas._libs.hashtable
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
File "<frozen zipimport>", line 261, in load_module
KeyError: 'pandas._libs.missing'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<frozen zipimport>", line 259, in load_module
File "pandas/_libs/interval.pyc", line 14, in <module>
File "pandas/_libs/interval.pyc", line 10, in __load
File "imp.pyc", line 342, in load_dynamic
File "<frozen importlib._bootstrap>", line 711, in _load
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 1181, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "pandas/_libs/interval.pyx", line 1, in init pandas._libs.interval
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
File "<frozen zipimport>", line 261, in load_module
KeyError: 'pandas._libs.hashtable'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/jaysenoner/PycharmProjects/final/dist/main.app/Contents/Resources/__boot__.py", line 411, in <module>
_run()
File "/Users/jaysenoner/PycharmProjects/final/dist/main.app/Contents/Resources/__boot__.py", line 394, in _run
exec(compile(source, path, "exec"), globals(), globals())
File "/Users/jaysenoner/PycharmProjects/final/dist/main.app/Contents/Resources/main.py", line 6, in <module>
import pandas as pd
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
File "<frozen zipimport>", line 259, in load_module
File "pandas/__init__.pyc", line 22, in <module>
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
File "<frozen zipimport>", line 259, in load_module
File "pandas/compat/__init__.pyc", line 15, in <module>
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
File "<frozen zipimport>", line 259, in load_module
File "pandas/compat/numpy/__init__.pyc", line 7, in <module>
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
File "<frozen zipimport>", line 259, in load_module
File "pandas/util/__init__.pyc", line 1, in <module>
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
File "<frozen zipimport>", line 259, in load_module
File "pandas/util/_decorators.pyc", line 14, in <module>
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
File "<frozen zipimport>", line 259, in load_module
File "pandas/_libs/__init__.pyc", line 13, in <module>
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
File "<frozen zipimport>", line 261, in load_module
I try to use pyinstaller but when I open the app instant close.
If I use it by Windows that's works fine, but no in macos that I need.
I also tried to put pandas in packages of setup.py and includes but still not work.
I solved this problem downgrade python to 3.6 by 3.9.
I am trying to run a simple test in lettuce (gherkin) but I can't pass the following error.
This is the test:
Feature: Go to google
Scenario: Visit Google
Given I go to "http://www.google.com/"
When I fill in field with class "gsfi" with "testingbot"
Then I should see "testingbot.com" within 2 second
And this is the error:
PS C:\Users\\Documents\PYTHON\features\lettuce-browserstack> lettuce
Traceback (most recent call last):
File "C:\Users\mihai.costache.DEA\AppData\Roaming\Python\Python39\Scripts\lettuce-script.py", line 33, in <module>
sys.exit(load_entry_point('lettuce==0.2.23', 'console_scripts', 'lettuce')())
File "C:\Users\mihai.costache.DEA\AppData\Roaming\Python\Python39\Scripts\lettuce-script.py", line 25, in importlib_load_entry_point
return next(matches).load()
File "c:\program files\python39\lib\importlib\metadata.py", line 77, in load
module = import_module(match.group('module'))
File "c:\program files\python39\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 786, in exec_module
File "<frozen importlib._bootstrap_external>", line 923, in get_code
File "<frozen importlib._bootstrap_external>", line 853, in source_to_code
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "C:\Users\mihai.costache.DEA\AppData\Roaming\Python\Python39\site-packages\lettuce\__init__.py", line 179
print "Error loading step definitions:\n", e
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Error loading step definitions:\n", e)?
Is there a quick fix on this?
Thanks
I keep getting the same error when I import the keyring library. Just adding 'import keyring' to the code causes this error to appear. I have tried installing the library again, but that didn't solve it.
I'm using python 3.5 in pythonanywhere.
Can somebody help me figure out what might be going on or what I else I can try to do to fix it?
This is the Error message.
Traceback (most recent call last):
File "/home/Marketscale/Tests/OAuth Test.py", line 3, in <module> import keyring
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 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
File "/home/Marketscale/.local/lib/python3.5/site-packages/keyring-10.3.2-py3.5.egg/keyring/__init__.py", line 6, in <module>
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 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
File "/home/Marketscale/.local/lib/python3.5/site-packages/keyring-10.3.2-py3.5.egg/keyring/core.py", line 149, in <module>
File "/home/Marketscale/.local/lib/python3.5/site-packages/keyring-10.3.2-py3.5.egg/keyring/core.py", line 65, in init_backend
File "/home/Marketscale/.local/lib/python3.5/site-packages/keyring-10.3.2-py3.5.egg/keyring/util/__init__.py", line 20, in wrapper
File "/home/Marketscale/.local/lib/python3.5/site-packages/keyring-10.3.2-py3.5.egg/keyring/backend.py", line 179, in get_all_keyring
File "/home/Marketscale/.local/lib/python3.5/site-packages/keyring-10.3.2-py3.5.egg/keyring/backend.py", line 139, in _load_backends
File "/home/Marketscale/.local/lib/python3.5/site-packages/keyring-10.3.2-py3.5.egg/keyring/backend.py", line 131, in _load_backend
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 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
File "/home/Marketscale/.local/lib/python3.5/site-packages/keyring-10.3.2-py3.5.egg/keyring/backends/SecretService.py", line 9, in <module>
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 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
File "/home/Marketscale/.local/lib/python3.5/site-packages/SecretStorage-2.3.1-py3.5.egg/secretstorage/__init__.py", line 13, in <module>
File "/usr/lib/python3/dist-packages/dbus/__init__.py", line 81, in <module> import dbus.exceptions as exceptions
AttributeError: module 'dbus' has no attribute 'exceptions'
>>>
Thank you in advance for any help you can provide.
My guess is that there's some kind of conflict between one of the system-installed modules and the ones you've installed with pip install --user into ~/.local
I suggest switching to a virtualenv to get a "clean" set of modules/dependencies. More info here: https://help.pythonanywhere.com/pages/Virtualenvs