I try to install the latest version of postgres sql using the latest version and the recommended set up.
However when I open the pg adming I receive this error.
Python Path: "C:\Program Files\PostgreSQL\13\pgAdmin 4\python\python.exe"
Runtime Config File: "C:\Users\User\AppData\Roaming\pgadmin\runtime_config.json"
pgAdmin Config File: "C:\Program Files\PostgreSQL\13\pgAdmin 4\web\config.py"
Webapp Path: "C:\Program Files\PostgreSQL\13\pgAdmin 4\web\pgAdmin4.py"
pgAdmin Command: "C:\Program Files\PostgreSQL\13\pgAdmin 4\python\python.exe C:\Program Files\PostgreSQL\13\pgAdmin 4\web\pgAdmin4.py"
Traceback (most recent call last):
File "../web/pgAdmin4.py", line 98, in <module>
app = create_app()
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\web\pgadmin\__init__.py", line 347, in create_app
if not os.path.exists(SQLITE_PATH) or get_version() == -1:
File "C:\Program Files\PostgreSQL\13\pgAdmin 4\web\pgadmin\setup\db_version.py", line 19, in get_version
return version.value
AttributeError: 'NoneType' object has no attribute 'value'
Any help on how to fix it?
After trying all the other suggestions without success, it finally worked for me now, with the way suggested here: Get fatal error: server could not be contacted when running pgAdmin4. 'NoneType' object has no attribute 'value'
Install the newest version of the standalone pgAdmin from https://www.pgadmin.org/download/pgadmin-4-windows/
(you can do the installation additionally to the existing bundled version, without having to remove anything before)
Delete the C:\Users\your_username\AppData\Roaming\pgadmin folder
(I restarted the postgres service once again)
Run the new pgAdmin as Administrator - it works!
Several people report that, from then on, even the old bundled version of pgAdmin works fine!
I resolved in this way:
I removed PGadmin from "Application Stack Builder"
download last version v4 5.2 (pgAdmin 4 v5.2 (released April 22, 2021)
installed...
lunched like admin... (error as usual)
clean-up folder C:\Users\XXXXX\AppData\Roaming\pgadmin (opsssss)
lunched like admin... All ran successfully!
Using all in one PGadmin with Application Stack gave me an usual error bind to some pyton or configuration file
Alen
I had a lot of trouble launching pgAdmin. Several solutions are there.
Try an older version of pgAdmin. The latest version might have unresolved issues.
Go to %APPDATA% (C:\Users{{your username}}\AppData\Roaming) folder and delete the pgadmin folder and run again.
go to environment variables (search environment on search bar) -> advanced, the click on Environment Variables. On System Variables click on path and set a new path for C:\Program Files\PostgreSQL\13\bin (the address might vary on your PC)
Related
Using flask, I'm trying to send a file to the user on clicking a button in UI using send_from_directory function. It used to work fine. I wanted to change the repo and since changing it, I'm no more able to download the file. On looking at the supervisor log, I see this:
[9617] [ERROR] Error handling request
Traceback (most recent call last):
File "path_to_file/venv/lib/python3.4/site-packages/gunicorn/workers/sync.py", line 182, in handle_request
resp.write_file(respiter)
File "path_to_file/venv/lib/python3.4/site-packages/gunicorn/http/wsgi.py", line 385, in write_file
if not self.sendfile(respiter):
File "path_to_file/venv/lib/python3.4/site-packages/gunicorn/http/wsgi.py", line 375, in sendfile
self.sock.sendfile(respiter.filelike, count=nbytes)
AttributeError: 'socket' object has no attribute 'sendfile'
In the same repo, this works fine locally. But when trying in remote server using the gunicorn + supervisor + nginx setup, I get the above error message. I do get 200 Ok response in the application log file. Spent a lot of time trying to fix but without success.
Also, the notable difference between the working app between the previous repo and the non-working current repo is the python version. Previous: python2.7, Current: python3.4
For me, usually when a script works locally but not when hosted its one (or more) of these possibilities:
Location / path to the files is different
older version of python
older version of the library
Pointing the virtual env to Python 3.6 and upgrading all the relevant libraries including Flask resolved the issue.
I am trying to run the appengine-endpoints-helloendpoints-python app locally using the google cloud platform SDK (which has been added to my path) using the command dev_appserver.py from the command line. It used to run perfectly, but now when I try, I get an error:
Error processing line 2 of
/Users/hannah/anaconda3/envs/py27/lib/python2.7/site-packages/grpc_google_pubsub_v1-0.8.1-py2.7-nspkg.pth:
Traceback (most recent call last):
File "/Users/hannah/anaconda3/envs/py27/lib/python2.7/site.py", line 161, in addpackage
exec line
File "<string>", line 1, in <module>
KeyError: 'google'
Remainder of file ignored
It's in a anaconda python2.7 environment. I've tried looking in site.py but I can't follow it back to a clear missing link.
The appcfg.py command used to deploy from the command line doens't work at all anymore. The command is not found.
bash: appcfg.py: command not found
As I said, I reinstalled and authorised the google cloud SDK and it is added to my path and that hasn't solved anything.
Oh finally, the error comes up whenever I run the dev_appserver.py command, not just with the example code from google.
Any tips would be appreciated
I'm new to Google App Engine and I followed multiple video tutorials (One from Udacity) and for some reason I am unable to get it to run on the local host with the simple "Hello World" program.
I do have the Python SDK installed as well as the Google App Engine program installed. I did modify the YAML file so that it matches with my application (it did by default). When I click "run" in the Google App Engine launcher, it shows a yellow triangle caution sign next to the program I'm attempting to run.
When I type the localhost:8080 in the search bar it says:
This webpage is not available
I've also tried reinstalling both Python 2.7.9 and the Google App Engine and to no avail. In short I would like to understand why the program shows no content when I attempt to run it. Here are the log files if it's any help:
2015-03-14 18:36:21 Running command: "['E:\\Python\\pythonw.exe', 'C:\\Program Files (x86)\\Google\\google_appengine\\dev_appserver.py', '--skip_sdk_update_check=yes', '--port=8080', '--admin_port=8000', 'C:\\Program Files (x86)\\Google\\google_appengine\\new_project_template']"
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\dev_appserver.py", line 83, in <module>
_run_file(__file__, globals())
File "C:\Program Files (x86)\Google\google_appengine\dev_appserver.py", line 79, in _run_file
execfile(_PATHS.script_file(script_name), globals_)
NameError: name 'execfile' is not defined
2015-03-14 18:36:21 (Process exited with code 1)
It looks like the default pythonw on your system (E:\Python\pythonw.exe) is some version of Python 3. That's where execfile is indeed not defined (and the GAE launcher's incompatible with Py3 in other ways, anyway, at this time).
To verify, run E:\Python\python.exe at a cmd prompt -- it should greet you with a version banner which I bet will mention Python 3.something.
Where did you (re-)install 2.7.9? How's your PATH environment variable? Likely with E:\Python before wherever 2.7.9 is installed.
Simplest might be to change your PATH so that wherever 2.7.9 is installed comes before E:\Python...!
I've just installed GAE SDK on a new computer and it failed to start.
When I open GAE Launcher it warns about errors, and log file has this.
WARNING:root: Warning: Prerequisites for App Engine development are
missing!
A valid python binary must be available. In addition, the App
Engine SDK must be installed. Here are the current values we found:
python = None
App Engine SDK root = C:\Program Files (x86)\Google\google_appengine
Please install the missing pieces and restart the launcher. If
these are installed but the Launcher failed to find them, you can
configure their location by editing Launcher preferences.
The Launcher preferences can be modified by selecting Edit >
Preferences.
Traceback (most recent call last):
A long list of traces there.
I've re-installed both Python and GAE SDK. Checked the PATH variables.
It's: C:\python27\;C:\Program Files (x86)\Google\google_appengine\
But it doesn't work!
How could I fix this?
I would appreciate any help on this.
Upd. I tried removing C:/users/username/Google/google_appengine_projects.ini this file.
The project is addede to the Launcher but it freezes the time I'm starting it. (server doesn't start)
Logs are:
2013-11-29 10:05:14 Running command:
"['C:\Python27\python.exe', 'C:\Program Files
(x86)\Google\google_appengine\dev_appserver.py',
'--skip_sdk_update_check=yes', '--port=8080', '--admin_port=8000',
u'C:\Users\\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\\u0414\u0438\u0441\u043a
Google\Work\E\Adriatika\\app-engine\adriatika]"
>
> Traceback (most recent call last): File
> "GoogleAppEngineLauncher.py", line 42, in <module> File
> "wx\_core.pyc", line 7913, in __init__ File "wx\_core.pyc", line
> 7487, in _BootstrapApp File "launcher\app.pyc", line 53, in OnInit
> File "launcher\app.pyc", line 97, in _CreateModels File
> "launcher\maintable.pyc", line 35, in __init__ File
> "launcher\maintable.pyc", line 96, in _LoadProjects File
> "launcher\project.pyc", line 63, in ProjectWithConfigParser File
> "launcher\project.pyc", line 285, in _LoadFromConfigParser File
> "ConfigParser.pyc", line 520, in get ConfigParser.NoOptionError: No
> option 'name' in section: '0'
I found a temporary fix.
First of all I removed everything and installed Python from scratch.
I also installed a previous version of GAE SDK (1.8.7)
Then I moved my working folder. Cause it had cyrillic utf symbols in its title. And I guess GAE Parser didnt like those symbols.
After all that I could finally launch GAELauncher.
I'm running Pycharm 2.6.3 with python 2.7 and django 1.5.1. When I try to run django's manage.py task from Pycharm (Tools / Run manage.py task), syncdb, for instance, I get the following:
bash -cl "/usr/bin/python2.7 /home/paulo/bin/pycharm-2.6.3/helpers/pycharm/django_manage.py syncdb /home/paulo/Projetos/repo2/Paulo Brito/phl"
Traceback (most recent call last):
File "/home/paulo/bin/pycharm-2.6.3/helpers/pycharm/django_manage.py", line 21, in <module>
run_module(manage_file, None, '__main__', True)
File "/usr/lib/python2.7/runpy.py", line 170, in run_module
mod_name, loader, code, fname = _get_module_details(mod_name)
File "/usr/lib/python2.7/runpy.py", line 103, in _get_module_details
raise ImportError("No module named %s" % mod_name)
ImportError: No module named manage
Process finished with exit code 1
If I run the first line on the console passing project path between single quotes, it runs without problems, like this:
bash -cl "/usr/bin/python2.7 /home/paulo/bin/pycharm-2.6.3/helpers/pycharm/django_manage.py syncdb '/home/paulo/Projetos/repo2/Paulo Brito/phl'"
I tried to format the path like that in project settings / django support, but Pycharm won't recognize the path.
How can I work in PyCharm with paths with spaces?
Thanks.
EDIT 1
PyCharm dont recognize path with baskslash as valid path either.
it's known bug http://youtrack.jetbrains.com/issue/PY-8449
Fixed in PyCharm 2.7
In UNIX you can escape whitespaces with a backslash:
/home/paulo/Projetos/repo2/Paulo\ Brito/phl
I had the same problem on ubuntu 18.4 LTS pycharm 2019.2.6.
I was trying to create a basic Django new project in folder 'Learing Django api' (my folder name had spaces in it). when I tried to run the server I got a error saying settings module not defined.
After spending few hours I realized pycharm was creating a seperate folder named 'Learning' in same directory.
I renamed my folder 'Learing Django api' to 'Learing_Django_api' and it worked.
I like pycharm but this folder insensitivity is insane.
Is it possible that you are taking in the argument with a space in it into a variable, then passing that to something that is seeing two arguments instead of one? If so, "requote" it before passing it along. Will you hit a point where that can't be corrected? If so, maybe the upgrade makes sense.