I am currently trying to install google cloud sdk on my macbook. I am using scikit-learn and anaconda for machine learning so on my laptop python points to python3.5. However google cloud sdk requires python 2.7 for installation, and that's why I am facing the problem of not be able to install it.
when I ran the install.sh file the error occurred and I have no clue how to deal with it:
Adam | ~ $ git/google-cloud-sdk/install.sh
Welcome to the Google Cloud SDK!
Traceback (most recent call last):
File "/Users/AdamLiu/Git/google-cloud-sdk/lib/third_party/enum/__init__.py", line 364, in __getattr__
return cls._member_map_[name]
KeyError: '_convert'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/AdamLiu/git/google-cloud-sdk/bin/bootstrapping/install.py", line 8, in <module>
import bootstrapping
File "/Users/AdamLiu/Git/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 9, in <module>
import setup
File "/Users/AdamLiu/Git/google-cloud-sdk/bin/bootstrapping/setup.py", line 34, in <module>
from googlecloudsdk.core.util import platforms
File "/Users/AdamLiu/Git/google-cloud-sdk/lib/googlecloudsdk/core/util/platforms.py", line 18, in <module>
import platform
File "/Users/AdamLiu/anaconda/lib/python3.5/platform.py", line 117, in <module>
import sys, os, re, subprocess
File "/Users/AdamLiu/anaconda/lib/python3.5/subprocess.py", line 364, in <module>
import signal
File "/Users/AdamLiu/anaconda/lib/python3.5/signal.py", line 8, in <module>
_IntEnum._convert(
File "/Users/AdamLiu/Git/google-cloud-sdk/lib/third_party/enum/__init__.py", line 366, in __getattr__
raise AttributeError(name)
AttributeError: _convert
Super thanks in advance!
Set the CLOUDSDK_PYTHON environment variable to the location of your Python 2.x executable before running install.sh.
Or make sure that you have python2 in your path so that which python2 can find it.
Related
Cannot able to execute the command cqlsh in mac m1 based system.
% bin/cqlsh
Traceback (most recent call last):
File "/Users/avinashkasukurthi/devtools/apache-cassandra-4.0.7/bin/cqlsh.py", line 159, in <module>
from cqlshlib import cql3handling, cqlhandling, pylexotron, sslhandling, cqlshhandling
File "/Users/avinashkasukurthi/devtools/apache-cassandra-4.0.7/bin/../pylib/cqlshlib/cql3handling.py", line 19, in <module>
from cqlshlib.cqlhandling import CqlParsingRuleSet, Hint
File "/Users/avinashkasukurthi/devtools/apache-cassandra-4.0.7/bin/../pylib/cqlshlib/cqlhandling.py", line 23, in <module>
from cqlshlib import pylexotron, util
File "/Users/avinashkasukurthi/devtools/apache-cassandra-4.0.7/bin/../pylib/cqlshlib/pylexotron.py", line 342, in <module>
class ParsingRuleSet:
File "/Users/avinashkasukurthi/devtools/apache-cassandra-4.0.7/bin/../pylib/cqlshlib/pylexotron.py", line 343, in ParsingRuleSet
RuleSpecScanner = SaferScanner([
^^^^^^^^^^^^^^
File "/Users/avinashkasukurthi/devtools/apache-cassandra-4.0.7/bin/../pylib/cqlshlib/saferscanner.py", line 91, in __init__
s = re.sre_parse.State()
^^^^^^^^^^^^
AttributeError: module 're' has no attribute 'sre_parse'
Looks like there may have been a breaking change introduced to Python's synchronized regex engine (SRE) with Python 3.11. I have created a ticket for this on the Cassandra project (CASSANDRA-18088).
In the interim, downgrade your local Python to 3.10, and you should be fine.
I'm using nrfutil in a shell script. It's failing with this error:
Traceback (most recent call last):
File "/usr/local/bin/nrfutil", line 6, in <module>
from nordicsemi.__main__ import cli
File "/Library/Python/2.7/site-packages/nordicsemi/__main__.py", line 57, in <module>
from nordicsemi.zigbee.prod_config import ProductionConfig, ProductionConfigWrongException, ProductionConfigTooLargeException
File "/Library/Python/2.7/site-packages/nordicsemi/zigbee/prod_config.py", line 41, in <module>
import yaml
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/yaml/__init__.py", line 374
class YAMLObject(metaclass=YAMLObjectMetaclass):
It's starting in python 2.7, then it looks like its running "import yaml" from a 3.6 library.
Why would it do this? How do I prevent it?
Thanks
I had an old version of nrfutil. I upgraded, all is good
I just installed anaconda and I have udpated the PATH variable.
However, I cannot run any conda related commands.
Every time I run a command starting with "conda" I get the following error.
Can anyone help?
I am using macOs High Sierra 10.13.6.
Traceback (most recent call last):
File "/anaconda3/lib/python3.6/site-packages/conda/common/path.py", line 18, in <module>
from urllib.request import url2pathname
File "/anaconda3/lib/python3.6/urllib/request.py", line 2585, in <module>
from _scproxy import _get_proxy_settings, _get_proxies
ImportError: dlopen(/anaconda3/lib/python3.6/lib-dynload/_scproxy.cpython-36m-darwin.so, 2): Symbol not found: __cg_jpeg_resync_to_restart
Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
Expected in: /anaconda3/lib/libJPEG.dylib
in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/anaconda3/bin/conda", line 11, in <module>
sys.exit(main())
File "/anaconda3/lib/python3.6/site-packages/conda/cli/main.py", line 112, in main
from ..exceptions import conda_exception_handler
File "/anaconda3/lib/python3.6/site-packages/conda/exceptions.py", line 18, in <module>
from .common.io import timeout
File "/anaconda3/lib/python3.6/site-packages/conda/common/io.py", line 24, in <module>
from .path import expand
File "/anaconda3/lib/python3.6/site-packages/conda/common/path.py", line 21, in <module>
from urllib import unquote, url2pathname # NOQA
ImportError: cannot import name 'unquote'
I seem to recall something similar when I first ran Anaconda on my Mac as well. I believe I solved it by doing two things:
Uninstalling Anaconda (Link)
Reinstalling Anaconda (potentially in a different location, say, under your User home)
I think in the process of installation my PATH pointed finally to a different location than the Conda/Python install.
I'm a beginner in OpenGL/OpenCL.
I'm trying to execute code from this
example, but there is an error:
Traceback (most recent call last):
File "/home/anka-rybalko/workspace/bla/openGL.py", line 99, in initializeGL
self.initialize_buffers()
File "/home/anka-rybalko/workspace/bla/openGL.py", line 61, in initialize_buffers
self.ctx, self.queue = clinit()
File "/home/anka-rybalko/workspace/bla/openGL.py", line 37, in clinit
+ get_gl_sharing_context_properties())
File "/usr/lib64/python2.7/site-packages/pyopencl-2014.1-py2.7-linux-x86_64.egg/pyopencl/tools.py", line 422, in get_gl_sharing_context_properties
from OpenGL import platform as gl_platform, GLX, WGL
File "/usr/lib/python2.7/site-packages/OpenGL/WGL/__init__.py", line 1, in <module>
from OpenGL.raw.WGL.VERSION.WGL_1_0 import *
File "/usr/lib/python2.7/site-packages/OpenGL/raw/WGL/VERSION/WGL_1_0.py", line 48, in <module>
#_p.types(_cs.c_int,_cs.HDC,ctypes.POINTER(_cs.PIXELFORMATDESCRIPTOR))
File "/usr/lib/python2.7/site-packages/OpenGL/raw/WGL/VERSION/WGL_1_0.py", line 13, in _f
return _p.createFunction( function,_p.PLATFORM.WGL,'WGL_VERSION_WGL_1_0',error_checker=_errors._error_checker)
AttributeError: 'GLXPlatform' object has no attribute 'WGL'
As I understand, WGL is an API for Windows OS and not for Linux. Should I somehow specify my platform before? Or how can I fix this?
Thanks in advance!
The code you are using (PyOpenGL 2014.1) is importing two platform-specific modules (WGL and GLX). PyOpenGL should have raised that error as an ImportError (rather than the AttributeError), but it still would have failed.
PyOpenCL has, in the meantime, worked around the issue in their github repository. If you have git installed (and pip) then this should get you a new version (note: not set up for OpenCL development here, so can't actually test this):
pip install git+https://github.com/pyopencl/pyopencl#egg=pyopencl
I'm trying to freeze application written in python (PySide), Qt. I'm using LMDE, and in Windows application runs, but have problems with Linux.
When I try it at another computer with same version of Mint Debian it doesn't start, and when I try to start it in terminal, it pops:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/cx_Freeze/initscripts/Console.py", line 27, in <module>
File "start.py", line 3, in <module>
File "/home/alexdeb/Desktop/AlexW/EXE_Start.py", line 9, in <module>
File "ExtensionLoader_PySide_QtCore.py", line 11, in <module>
ImportError: libpyside-python2.7.so.1.1: cannot open shared object file: No such file or directory
Any help, please?
Run the application using strace to find out which object file it's trying to load