Running canopy-script.pyw gives traceback "No module named canopy.app.bootstrap" - enthought

I am trying to follow instruction from Enthought support website To test of what I have done i run line:
_python.exe canopy-script.pyw -d
Unfortunately this gives Traceback:
Traceback (most recent call last):
File "canopy-script.pyw", line 776, in <module>
File "canopy-script.pyw", line 336, in bootstrap
File "canopy-script.pyw", line 363, in chainload
File "canopy-script.pyw", line 762, in _chainload
File "C:\Users\User\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.7.4.3348.win-x86_64\Canopy-script.pyw", line 7, in <module>
from canopy.app.bootstrap import main
ImportError: No module named canopy.app.bootstrap
After "Search" I can see many of bootstrap.py files on the disc.
What would be the solution for this problem?

The current version of Canopy is 2.1.9. (You are running v 1.7.4).
To update Canopy, and for a link to release notes, please see "Installing a new Canopy version".
After you update, see:
https://support.enthought.com/hc/en-us/articles/360021798791--UnresolvableRequirements-or-Conflicting-requirements-when-installing-or-updating-packages

Related

Aws Cloudwatch Logs agent throws an error

I'm setting up awslogs agent on ec2 instance, When i run the python script of awslogs. I'm getting below message.
Downloading the latest CloudWatch Logs agent bits ... ERROR: Failed to create virtualenv. Try manually installing with pip and adding it to the sudo user's PATH before running this script.
And awslogs-agent-setup.log show below error.
Environment: CentOS 6.10 and Python 2.6
Traceback (most recent call last):
File "/usr/bin/pip", line 7, in <module>
from pip._internal import main
File "/usr/lib/python2.6/site-packages/pip-19.0.3-py2.6.egg/pip/_internal/__init__.py", line 19, in <module>
from pip._vendor.urllib3.exceptions import DependencyWarning
File "/usr/lib/python2.6/site-packages/pip-19.0.3-py2.6.egg/pip/_vendor/urllib3/__init__.py", line 8, in <module>
from .connectionpool import (
File "/usr/lib/python2.6/site-packages/pip-19.0.3-py2.6.egg/pip/_vendor/urllib3/connectionpool.py", line 92
_blocking_errnos = {errno.EAGAIN, errno.EWOULDBLOCK}
^
SyntaxError: invalid syntax
/usr/bin/virtualenv
Traceback (most recent call last):
File "/usr/bin/virtualenv", line 7, in <module>
from virtualenv import main
File "/usr/lib/python2.6/site-packages/virtualenv.py", line 51, in <module>
print("ERROR: {}".format(sys.exc_info()[1]))
ValueError: zero length field name in format
Basically, this error is due to your python version 2.6. Could you please update your python version from 2.6 to 2.7 or 3.1.
This should help.

Google Cloud SDK installation - gsutil error

I have installed Google Cloud SDK but having an issue running "gsutil". Here are the error I'm getting:
~/gcloud/google-cloud-sdk#> gsutil
Traceback (most recent call last):
File "/Users/gonyi/Desktop/gonyyi/gcloud/google-cloud-sdk/bin/bootstrapping/gsutil.py", line 13, in <module>
import bootstrapping
File "/Users/gonyi/Desktop/gonyyi/gcloud/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 40, in <module>
from googlecloudsdk.core import execution_utils
File "/Users/gonyi/Desktop/gonyyi/gcloud/google-cloud-sdk/lib/googlecloudsdk/core/execution_utils.py", line 33, in <module>
from googlecloudsdk.core import log
File "/Users/gonyi/Desktop/gonyyi/gcloud/google-cloud-sdk/lib/googlecloudsdk/core/log.py", line 810, in <module>
_log_manager = _LogManager()
File "/Users/gonyi/Desktop/gonyyi/gcloud/google-cloud-sdk/lib/googlecloudsdk/core/log.py", line 526, in __init__
self._file_formatter = _LogFileFormatter()
File "/Users/gonyi/Desktop/gonyyi/gcloud/google-cloud-sdk/lib/googlecloudsdk/core/log.py", line 315, in __init__
super(_LogFileFormatter, self).__init__(fmt=_LogFileFormatter.FORMAT)
TypeError: must be type, not classobj
~/gcloud/google-cloud-sdk#>
I have Python 2.7 installed, also tried to install this with "brew cask" as well as download it directly from Google Cloud site and install, but no luck either.
I googled this error but it seems like I'm the only one with this error..
"gcloud" command works just fine; but it's just "gsutil" that's not working.
Thank you

google-cloud-storage library from nosetests using testbed

I have google-cloud-storage pip installed into a lib directory and vendored in. It's running just fine locally during development of my python appengine app. However, when trying to run unit tests via nose and testbed I'm getting "The 'google-cloud-core' distribution was not found and is required by the application". Here is the stack:
Traceback (most recent call last):
File "/Users/jason/dev/gain-data/venv/lib/python2.7/site-packages/nose/loader.py", line 418, in loadTestsFromName
addr.filename, addr.module)
File "/Users/jason/dev/gain-data/venv/lib/python2.7/site-packages/nose/importer.py", line 47, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/Users/jason/dev/gain-data/venv/lib/python2.7/site-packages/nose/importer.py", line 94, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/Users/jason/dev/gain-data/data/storage/__init__.py", line 4, in <module>
from google.cloud.storage import Blob, Client
File "/Users/jason/dev/gain-data/lib/google/cloud/storage/__init__.py", line 42, in <module>
from google.cloud.storage.batch import Batch
File "/Users/jason/dev/gain-data/lib/google/cloud/storage/batch.py", line 30, in <module>
from google.cloud.storage.connection import Connection
File "/Users/jason/dev/gain-data/lib/google/cloud/storage/connection.py", line 17, in <module>
from google.cloud import connection as base_connection
File "/Users/jason/dev/gain-data/lib/google/cloud/connection.py", line 31, in <module>
get_distribution('google-cloud-core').version)
File "/Users/jason/dev/gain-data/venv/lib/python2.7/site-packages/pkg_resources/__init__.py", line 557, in get_distribution
dist = get_provider(dist)
File "/Users/jason/dev/gain-data/venv/lib/python2.7/site-packages/pkg_resources/__init__.py", line 431, in get_provider
return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
File "/Users/jason/dev/gain-data/venv/lib/python2.7/site-packages/pkg_resources/__init__.py", line 968, in require
needed = self.resolve(parse_requirements(requirements))
File "/Users/jason/dev/gain-data/venv/lib/python2.7/site-packages/pkg_resources/__init__.py", line 854, in resolve
raise DistributionNotFound(req, requirers)
DistributionNotFound: The 'google-cloud-core' distribution was not found and is required by the application
Any thoughts?
I had the same issue with google-cloud-translate, I was forced to also install the package "globally", i.e. pip install google-cloud-translate.
After struggling a lot with this same issue I found out that the error was because the vendor pip lib wasn't in the PYTHONPATH before calling the nosetests.
Try adding the vendor lib to the PYTHONPATH and then run the tests.
export PYTHONPATH="$(HOME)/Projects/myproject/pip_lib:$$PYTHONPATH"; \
nosetests .

Error when creating virtualenv folder

I am working through the book Test Driven Devlopement, and am currently having a problem when I try to create a virtualenv folder using:
virtualenv --python=python3 ../virtualenv
I keep on getting this output:
Traceback (most recent call last):
File "C:\Python33\lib\runpy.py", line 160, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "C:\Python33\lib\runpy.py", line 73, in _run_code
exec(code, run_globals)
File "C:\Python33\Scripts\virtualenv.exe\__main__.py", line 9, in <module>
File "C:\Python33\lib\site-packages\virtualenv.py", line 774, in main
interpreter = resolve_interpreter(options.python)
File "C:\Python33\lib\site-packages\virtualenv.py", line 1575, in resolve_interpreter
python_versions = get_installed_pythons()
File "C:\Python33\lib\site-packages\virtualenv.py", line 93, in get_installed_pythons
path = winreg.QueryValue(python_core, "%s\\InstallPath" % ver)
FileNotFoundError: [WinError 2] The system cannot find the file specified
You are on windows: ../virutalenv is for unix
On unix, you are telling virtualenv to create a virtualenv directory in the directory up one level (previous) also windows uses backslash instead of slash.
Try to find a tutorial that is windows oriented, or if you can get your hand on a unix/linux machine, or maybe install cygwin.

Error when using pudb with ipython

I'm trying to use PuDB with ipython as the shell, but when I drop to shell, I get the following error:
can't set attribute
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/Library/Python/2.7/site-packages/IPython/core/interactiveshell.py", line 2744, in atexit_operations
self.reset(new_session=False)
File "/Library/Python/2.7/site-packages/IPython/core/interactiveshell.py", line 1132, in reset
self.displayhook.flush()
File "/Library/Python/2.7/site-packages/IPython/core/displayhook.py", line 255, in flush
self.shell.user_ns['_oh'].clear()
KeyError: '_oh'
Error in sys.exitfunc:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/Library/Python/2.7/site-packages/IPython/core/interactiveshell.py", line 2744, in atexit_operations
self.reset(new_session=False)
File "/Library/Python/2.7/site-packages/IPython/core/interactiveshell.py", line 1132, in reset
self.displayhook.flush()
File "/Library/Python/2.7/site-packages/IPython/core/displayhook.py", line 255, in flush
self.shell.user_ns['_oh'].clear()
KeyError: '_oh'
Version details:
PuDB 2011.3.1
IPython 0.12
Python 2.7.1
Mac OS X 10.7.3
This is a known issue, and should be fixed in IPython 0.12.1 or master. Does updating to current (0.12.1) IPython help?