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
Related
I'm on Windows 10 and working in a git-bash terminal with anaconda environment. When I open a new terminal, I'm immediately presented with:
Error processing line 1 of C:\Users\e360769\AppData\Local\miniforge3\lib\site-packages\distutils-precedence.pth:
Traceback (most recent call last):
File "C:\Users\e360769\AppData\Local\miniforge3\lib\site.py", line 169, in addpackage
exec(line)
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named '_distutils_hack'
Remainder of file ignored
This same error comes up any time I run "pip" or "python" on the command line. The command still executes correctly, but only after displaying that error. Note that this started after installing a collection of packages needed for a project I'm working with, and after investigating I found some people attributed this to the setuptools package (I have v41.2.0), but even when I uninstall it, the issue persists. Also note that this is the contents of my distutils-precedence.pth file:
import os; var = 'SETUPTOOLS_USE_DISTUTILS'; enabled = os.environ.get(var, 'local') == 'local'; enabled and __import__('_distutils_hack').add_shim();
I'm not sure this is actively (for now) causing any issues with executing my python scripts, etc., but I'd like to know what's going on and how to fix this. Would appreciate any help!
I'm currently trying to install seafile 7.1.4 on a Raspberry Pi 4 following the official guide (https://download.seafile.com/published/seafile-manual/deploy/using_mysql.md). The setup went smoothly, but when I try to start the seahub (./seahub start) for the first time I get the following error:
Traceback (most recent call last):
File "check_init_admin.py", line 351, in <module>
rpc = RPC()
File "check_init_admin.py", line 284, in __init__
import ccnet
ModuleNotFoundError: No module named 'ccnet'
I've been on google for the past two hours, but can't find a solution to this problem. What am I doing wrong?
I ran into the same issue. There's a bug in the 7.1.4 package. Seafile uses some local site packages. They (apparently) used to be under ${INSTALLPATH}/seafile/lib/python3.6/site-packages, now the are under ${INSTALLPATH}/seafile/lib/python3.7/site-packages
To fix:
open seahub.sh in the editor of your choice.
find the line that says:
export PYTHONPATH=${INSTALLPATH}/seafile/lib/python3.6/site-packages:${INSTALLPATH}/seafile/lib64/python3.6/site-packages:${INSTALLPATH}/seahub:${INSTALLPATH}/seahub/thirdpart:$PYTHONPATH
change it to read:
export PYTHONPATH=${INSTALLPATH}/seafile/lib/python3.7/site-packages:${INSTALLPATH}/seafile/lib64/python3.7/site-packages:${INSTALLPATH}/seahub:${INSTALLPATH}/seahub/thirdpart:$PYTHONPATH
I have my project installed as a windows service and everything worked smoothly. I had some errors with using venv and pywin32, but eventually figuret that out. Stackoverflow link
However when I use pyinstaller to make onefile executable from it problems start occuring.
I use following command to create executable:
[Path_to_my_venv_pyinstaller] --onefile --hidden-import win32timezone myservice.py
Then I am executing it from cmd with install arg, service is installed.
However next step, executing it with start arg fails. Error message:
Starting service [Service_Name]
Error starting service: The service did not respond to the start or control request in a timely fashion.
So I tried debugging it with ``debug``` argument. It works normally, when I install service without executable, from source files. When service is installed from executable I am getting following error.
Debugging service [Service_Name] - press Ctrl+C to stop.
Traceback (most recent call last):
File "[Service]\[Service_Folder]\service.py", line 48, in <module>
File "lib\site-packages\win32\lib\win32serviceutil.py", line 640, in HandleCommandLine
File "lib\site-packages\win32\lib\win32serviceutil.py", line 461, in DebugService
AttributeError: module 'servicemanager' has no attribute 'Debugging'
[14252] Failed to execute script service
I found similar topic on stack, unanswered, link here. So the problem indeed lays in installing service from pyinstaller executable.
I have no idea, how to track error on this, Event Viewer does not display anything more than i could see from console.
Is there other way to debug a service?
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 don't have experience in downloading libraries, so any help is appreciated. I've got a fresh install of Python3.3 and am trying to get IPython for 64bit Windows 7. The IPython .exe installer ran fine and completed normally, but I can't access the program. I looked through their documentation, and tried the commands there, but
$ python setup.py install
returns invalid syntax, highlighting "setup". I thought the fix might be in the distribute library mentioned on the page, so I went to go try and get that first. However, using the script from distribute's install page revealed it's own errors, namely
Traceback (most recent call last):
File "C:\Python33\distribute_setup.py", line 541, in <module>
sys.exit(main())
File "C:\Python33\distribute_setup.py", line 537, in main
tarball = download_setuptools(download_base=options.download_base)
File "C:\Python33\distribute_setup.py", line 200, in download_setuptools
log.warn("Downloading %s", url)
File "C:\Python33\lib\distutils\log.py", line 47, in warn
self._log(WARN, msg, args)
File "C:\Python33\lib\distutils\log.py", line 30, in _log
if stream.errors == 'strict':
AttributeError: errors
I've been at it for a couple hours now, and I'm fresh out of ideas. What next?
It looks like you ran into Python bug 12967. You need to run distribute_setup.py outside of IDLE (i.e. in a command prompt).