This is the web app I'm trying to clone: https://github.com/eddyharrington/Tendie-Tracker
Unfortunately, I'm not able to do it. I have followed all the steps provided. I'm a little confused with the last two steps.
Step 5: This is what I've typed
App variable
SECRET_KEY=randomText
DB variable
DATABASE_URL=postgres://{postgres}:{123}#{localhost}:{5432.0}/{tracker}
When I run the app, I get the following tracebacks.
File "app.py", line 6, in <module>
import tendie_dashboard
File "C:\Users\Maithri\Desktop\Mini Project\Tendie-Tracker-master\tendie_dashboard.py", line 3, in <module>
import tendie_budgets
File "C:\Users\Maithri\Desktop\Mini Project\Tendie-Tracker-master\tendie_budgets.py", line 3, in <module>
import tendie_categories
File "C:\Users\Maithri\Desktop\Mini Project\Tendie-Tracker-master\tendie_categories.py", line 10, in <module>
engine = create_engine(os.getenv("DATABASE_URL"))
File "C:\Users\Maithri\Desktop\Mini Project\Tendie-Tracker-master\env\lib\site-packages\sqlalchemy\engine\__init__.py", line 479, in create_engine
return strategy.create(*args, **kwargs)
File "C:\Users\Maithri\Desktop\Mini Project\Tendie-Tracker-master\env\lib\site-packages\sqlalchemy\engine\strategies.py", line 56, in create
plugins = u._instantiate_plugins(kwargs)
AttributeError: 'NoneType' object has no attribute '_instantiate_plugins'
Try putting the values without the curly braces. You should have something like,
DATABASE_URL=postgres://postgres:123#localhost:5432/tracker
Also, port numbers are integer values, not floats.
Related
I am trying to learn Python and following along some modules. I am using Anaconda Powershell Prompt and using Python 3.7 from there. I am trying to follow along via the code below.
Everything works until I get to the line
from wrf import getvar
When I do that line I receive this
>>> from wrf import getvar
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\Paul\anaconda3\lib\site-packages\wrf\__init__.py", line 6, in <module>
from . import api
File "C:\Users\Paul\anaconda3\lib\site-packages\wrf\api.py", line 1, in <module>
from .config import (xarray_enabled, disable_xarray, enable_xarray,
File "C:\Users\Paul\anaconda3\lib\site-packages\wrf\config.py", line 62, in <module>
_init_local()
File "C:\Users\Paul\anaconda3\lib\site-packages\wrf\config.py", line 52, in _init_local
_try_enable_xarray()
File "C:\Users\Paul\anaconda3\lib\site-packages\wrf\config.py", line 17, in _try_enable_xarray
from xarray import DataArray
File "C:\Users\Paul\anaconda3\lib\site-packages\xarray\__init__.py", line 1, in <module>
from . import testing, tutorial
File "C:\Users\Paul\anaconda3\lib\site-packages\xarray\testing.py", line 9, in <module>
from xarray.core import duck_array_ops, formatting, utils
File "C:\Users\Paul\anaconda3\lib\site-packages\xarray\core\duck_array_ops.py", line 26, in <module>
from . import dask_array_compat, dask_array_ops, dtypes, npcompat, nputils
File "C:\Users\Paul\anaconda3\lib\site-packages\xarray\core\npcompat.py", line 72, in <module>
_SupportsDType[np.dtype],
File "C:\Users\Paul\anaconda3\lib\typing.py", line 275, in inner
return func(*args, **kwds)
File "C:\Users\Paul\anaconda3\lib\typing.py", line 999, in __class_getitem__
_check_generic(cls, params, len(cls.__parameters__))
File "C:\Users\Paul\anaconda3\lib\typing.py", line 209, in _check_generic
raise TypeError(f"{cls} is not a generic class")
TypeError: <class 'numpy.typing._dtype_like._SupportsDType'> is not a generic class
Looks like the last few lines return an error but as a beginner I have zero clue what this means.
This looks like a similar error to <class 'numpy.typing._dtype_like._SupportsDType'> is not a generic class when importing the plotly.express library - an incompatibility between wrf-python and numpy.
Try upgrading those libraries to the latest versions.
I have a small python (2.7) script that works with several threads. One of the threads will read a global list and post an https post request for each one of the entries of this list.
For doing that I saw that the best way is to use python requests module. I have installed it with pip (no problem with that, it is placed in ...Python/2.7/site-packages/requests/...), but, when I import this module in my script, I get an error.
I have created another script with just one line (import requests) to reproduce the error, and I get this:
Traceback (most recent call last):
File "req.py", line 1, in <module>
import requests
File "/Library/Python/2.7/site-packages/requests/__init__.py", line 43, in <module>
import urllib3
File "/Library/Python/2.7/site-packages/urllib3/__init__.py", line 8, in <module>
from .connectionpool import (
File "/Library/Python/2.7/site-packages/urllib3/connectionpool.py", line 11, in <module>
from .exceptions import (
File "/Library/Python/2.7/site-packages/urllib3/exceptions.py", line 2, in <module>
from .packages.six.moves.http_client import (
File "/Library/Python/2.7/site-packages/urllib3/packages/six.py", line 203, in load_module
mod = mod._resolve()
File "/Library/Python/2.7/site-packages/urllib3/packages/six.py", line 115, in _resolve
return _import_module(self.mod)
File "/Library/Python/2.7/site-packages/urllib3/packages/six.py", line 82, in _import_module
__import__(name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 69, in <module>
from array import array
File "/Users/carlestalenssebastia/Documents/mychip/raspberry pi/array.py", line 3, in <module>
IndexError: list index out of range
Python 2.7.10
MacBook Pro with macOS Sierra (v 10.12)
Am I doing something wrong? Didn't I installed the module in the proper way?
it seems that you're having two modules with the same name array.py
rename your local array.py module to something more unique to resolve this.
take a look at this answer for more info on how to handle this issue and here to learn more on how python import system works.
I was using PYTTSX yesterday with no issues at all - it was acting exactly as expected and working fine. However, when I tried to run the exact same code not two hours later it threw this error:
Traceback (most recent call last):
File "C:\Python27\FUCK.py", line 2, in <module>
engine = pyttsx.init()
File "C:\Python27\lib\site-packages\pyttsx\__init__.py", line 39, in init
eng = Engine(driverName, debug)
File "C:\Python27\lib\site-packages\pyttsx\engine.py", line 45, in __init__
self.proxy = driver.DriverProxy(weakref.proxy(self), driverName, debug)
File "C:\Python27\lib\site-packages\pyttsx\driver.py", line 64, in __init__
self._module = __import__(name, globals(), locals(), [driverName])
File "C:\Python27\lib\site-packages\pyttsx\drivers\sapi5.py", line 19, in <module>
import win32com.client
File "C:\Python27\lib\site-packages\win32com\client\__init__.py", line 11, in <module>
import gencache
File "C:\Python27\lib\site-packages\win32com\client\gencache.py", line 662, in <module>
__init__()
File "C:\Python27\lib\site-packages\win32com\client\gencache.py", line 56, in __init__
_LoadDicts()
File "C:\Python27\lib\site-packages\win32com\client\gencache.py", line 109, in _LoadDicts
version = p.load()
EOFError
and it has been throwing this error ever since. The code which was working fine before hasn't been changed at all, and the same code works fine on my Linux partition, this error seems to be windows exclusive. Any idea what it could be?
It is a simple procedure:
Go to python27 folder
Search for dicts.dat
Delete that folder
It will work because I have done it
I assume this might be impossible but I've been wondering...
I'm building a flask application (running on google app engine)
and i'm using behave as the BDD tool.
it all works well if I keep everything separated through the browser automation.
what I want is to have a peek at the data structure (in my case, so I can check my simulated users attributes). when I try to :
from application.models import MyUserModel
I get the following error
File "/usr/local/bin/behave", line 8, in <module>
load_entry_point('behave==1.2.3', 'console_scripts', 'behave')()
File "/Library/Python/2.7/site-packages/behave/__main__.py", line 111, in main
failed = runner.run()
File "/Library/Python/2.7/site-packages/behave/runner.py", line 474, in run
return self.run_with_paths()
File "/Library/Python/2.7/site-packages/behave/runner.py", line 477, in run_with_paths
self.load_hooks()
File "/Library/Python/2.7/site-packages/behave/runner.py", line 437, in load_hooks
exec_file(hooks_path, self.hooks)
File "/Library/Python/2.7/site-packages/behave/runner.py", line 283, in exec_file
execfile(filename, globals, locals)
File "/Users/ido/Documents/workspace/talknet-0.2.02/src/features/environment.py", line 13, in <module>
import application
File "/Users/ido/Documents/workspace/talknet-0.2.02/src/application/__init__.py", line 1, in <module>
from flask import g, Flask, render_template
File "/Users/ido/Documents/workspace/talknet-0.2.02/src/lib/flask/__init__.py", line 19, in <module>
from jinja2 import Markup, escape
ImportError: No module named jinja2
I know my features and steps are not running in appserver context.
but I'm not there yet. this is an import issue...
is there a way around this ???
To fix the exception in the example you provided add:
libraries:
- name: jinja2
version: latest
To your app.yaml file.
See more info here: https://cloud.google.com/appengine/docs/python/tools/libraries27
I have following file structure:
/usr/share/pyshared/orca/scripts/toolkits/Gecko/script.py
In this file def getExtents is function that I have to access in following file i.e:
/usr/share/pyshared/orca/scripts/default.py
so I am trying to import function from script.py to the following file:
/usr/share/pyshared/orca/scripts/default.py
following line is added in /usr/share/pyshared/orca/scripts/default.py:
from orca.scripts.toolkits.Gecko.script import getExtents
But I get following errors:
File "<string>", line 1, in <module>
File "/usr/lib/pymodules/python2.7/orca/orca.py", line 1498, in main
init(pyatspi.Registry)
File "/usr/lib/pymodules/python2.7/orca/orca.py", line 1215, in init
loadUserSettings()
File "/usr/lib/pymodules/python2.7/orca/orca.py", line 837, in loadUserSettings
_scriptManager.activate()
File "/usr/lib/pymodules/python2.7/orca/script_manager.py", line 80, in activate
self.setActiveScript(self.getScript(None), "activate")
File "/usr/lib/pymodules/python2.7/orca/script_manager.py", line 247, in getScript
appScript = self.getDefaultScript()
File "/usr/lib/pymodules/python2.7/orca/script_manager.py", line 214, in getDefaultScript
import scripts.default as default
File "/usr/lib/pymodules/python2.7/orca/scripts/default.py", line 57, in <module>
from orca.scripts.toolkits.Gecko.script import getExtents
File "/usr/lib/pymodules/python2.7/orca/scripts/toolkits/Gecko/__init__.py", line 1, in <module>
from script import Script
File "/usr/lib/pymodules/python2.7/orca/scripts/toolkits/Gecko/script.py", line 52, in <module>
import orca.scripts.default as default
AttributeError: 'module' object has no attribute 'default'
I think you probably need
from orca.scripts import default
Also, as mentioned in the comments, check you've got the relevant __init__.py
edit: re-reading the stacktrace, looks like you've got a circular import too, you're trying to import orca.scripts.default in line 52 of "/usr/lib/pymodules/python2.7/orca/scripts/toolkits/Gecko/script.py"